{"id":17488429,"url":"https://github.com/cap-go/capacitor-flash","last_synced_at":"2026-02-23T08:16:53.139Z","repository":{"id":40470081,"uuid":"428109916","full_name":"Cap-go/capacitor-flash","owner":"Cap-go","description":"Switch the Flashlight / Torch of your device.","archived":false,"fork":false,"pushed_at":"2025-05-28T23:29:58.000Z","size":652,"stargazers_count":15,"open_issues_count":5,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-12T14:05:11.574Z","etag":null,"topics":["capacitor","capacitor-plugin","ionic"],"latest_commit_sha":null,"homepage":"https://capgo.app","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Cap-go.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"Cap-go","patreon":null,"open_collective":"capgo","ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2021-11-15T03:25:25.000Z","updated_at":"2025-05-26T05:00:03.000Z","dependencies_parsed_at":"2023-02-10T00:15:34.145Z","dependency_job_id":"8c34d968-1264-4e01-b4cc-d0761696f412","html_url":"https://github.com/Cap-go/capacitor-flash","commit_stats":{"total_commits":123,"total_committers":5,"mean_commits":24.6,"dds":0.5853658536585367,"last_synced_commit":"c4f9cbaa0f2fe0b324f83be41d3d7f0b0762d2d3"},"previous_names":["riderx/capacitor-flash"],"tags_count":57,"template":false,"template_full_name":null,"purl":"pkg:github/Cap-go/capacitor-flash","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cap-go%2Fcapacitor-flash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cap-go%2Fcapacitor-flash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cap-go%2Fcapacitor-flash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cap-go%2Fcapacitor-flash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Cap-go","download_url":"https://codeload.github.com/Cap-go/capacitor-flash/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cap-go%2Fcapacitor-flash/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259820785,"owners_count":22916544,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["capacitor","capacitor-plugin","ionic"],"created_at":"2024-10-19T04:07:16.460Z","updated_at":"2026-02-23T08:16:53.127Z","avatar_url":"https://github.com/Cap-go.png","language":"Java","funding_links":["https://github.com/sponsors/Cap-go","https://opencollective.com/capgo"],"categories":[],"sub_categories":[],"readme":"# capacitor-flash\n  \u003ca href=\"https://capgo.app/\"\u003e\u003cimg src='https://raw.githubusercontent.com/Cap-go/capgo/main/assets/capgo_banner.png' alt='Capgo - Instant updates for capacitor'/\u003e\u003c/a\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \u003ch2\u003e\u003ca href=\"https://capgo.app/?ref=plugin_flash\"\u003e ➡️ Get Instant updates for your App with Capgo\u003c/a\u003e\u003c/h2\u003e\n  \u003ch2\u003e\u003ca href=\"https://capgo.app/consulting/?ref=plugin_flash\"\u003e Missing a feature? We’ll build the plugin for you 💪\u003c/a\u003e\u003c/h2\u003e\n\u003c/div\u003e\nSwitch the Flashlight / Torch of your device.\n\n## Why Capacitor Flash?\n\nA simple, **free**, and **lightweight** flashlight control plugin:\n\n- **Intensity control** - Adjust brightness levels (iOS and Android 13+)\n- **Status checking** - Query flashlight availability and current state\n- **Toggle support** - Simple on/off switching with toggle method\n- **Universal compatibility** - Works across iOS, Android, and web (Chrome on mobile devices)\n- **Modern package management** - Supports both Swift Package Manager (SPM) and CocoaPods (SPM-ready for Capacitor 8)\n- **Zero dependencies** - Minimal footprint, no bloat\n\nPerfect for QR scanner apps, emergency torch features, camera apps, and utility tools.\n\n## Documentation\n\nThe most complete doc is available here: https://capgo.app/docs/plugins/flash/\n\n## Compatibility\n\n| Plugin version | Capacitor compatibility | Maintained |\n| -------------- | ----------------------- | ---------- |\n| v8.\\*.\\*       | v8.\\*.\\*                | ✅          |\n| v7.\\*.\\*       | v7.\\*.\\*                | On demand   |\n| v6.\\*.\\*       | v6.\\*.\\*                | ❌          |\n| v5.\\*.\\*       | v5.\\*.\\*                | ❌          |\n\n\u003e **Note:** The major version of this plugin follows the major version of Capacitor. Use the version that matches your Capacitor installation (e.g., plugin v8 for Capacitor 8). Only the latest major version is actively maintained.\n\n## Install\n\n```bash\nnpm install @capgo/capacitor-flash\nnpx cap sync\n```\n\n## iOS\n\nWorks out of the box\n\n## Android\n\nWorks out of the box. No permissions are required since the `CameraManager.setTorchMode()` API (introduced in Android 6.0) does not require camera permission.\n\nOptionally, you can declare the flash hardware feature in your `AndroidManifest.xml`:\n\n```xml\n\u003cuses-feature android:name=\"android.hardware.camera.flash\" android:required=\"false\" /\u003e\n```\n\n## Web\n\nWorks in Chrome and Chromium-based browsers on mobile devices. Uses the MediaDevices API with torch constraint. Call `isAvailable()` first to check if torch control is supported on the current browser/device.\n\n## API\n\n\u003cdocgen-index\u003e\n\n* [`isAvailable()`](#isavailable)\n* [`switchOn(...)`](#switchon)\n* [`switchOff()`](#switchoff)\n* [`isSwitchedOn()`](#isswitchedon)\n* [`toggle()`](#toggle)\n* [`getPluginVersion()`](#getpluginversion)\n\n\u003c/docgen-index\u003e\n\n\u003cdocgen-api\u003e\n\u003c!--Update the source file JSDoc comments and rerun docgen to update the docs below--\u003e\n\nCapacitor Flash Plugin for controlling device flashlight/torch.\n\n### isAvailable()\n\n```typescript\nisAvailable() =\u003e Promise\u003c{ value: boolean; }\u003e\n```\n\nChecks if flashlight is available on the device.\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;{ value: boolean; }\u0026gt;\u003c/code\u003e\n\n**Since:** 1.0.0\n\n--------------------\n\n\n### switchOn(...)\n\n```typescript\nswitchOn(options: { intensity?: number; }) =\u003e Promise\u003cvoid\u003e\n```\n\nTurns the flashlight on.\n\n| Param         | Type                                 | Description                                        |\n| ------------- | ------------------------------------ | -------------------------------------------------- |\n| **`options`** | \u003ccode\u003e{ intensity?: number; }\u003c/code\u003e | - Optional configuration including light intensity |\n\n**Since:** 1.0.0\n\n--------------------\n\n\n### switchOff()\n\n```typescript\nswitchOff() =\u003e Promise\u003cvoid\u003e\n```\n\nTurns the flashlight off.\n\n**Since:** 1.0.0\n\n--------------------\n\n\n### isSwitchedOn()\n\n```typescript\nisSwitchedOn() =\u003e Promise\u003c{ value: boolean; }\u003e\n```\n\nChecks if the flashlight is currently turned on or off.\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;{ value: boolean; }\u0026gt;\u003c/code\u003e\n\n**Since:** 1.0.0\n\n--------------------\n\n\n### toggle()\n\n```typescript\ntoggle() =\u003e Promise\u003c{ value: boolean; }\u003e\n```\n\nToggle the flashlight on or off.\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;{ value: boolean; }\u0026gt;\u003c/code\u003e\n\n**Since:** 1.0.0\n\n--------------------\n\n\n### getPluginVersion()\n\n```typescript\ngetPluginVersion() =\u003e Promise\u003c{ version: string; }\u003e\n```\n\nGet the native Capacitor plugin version.\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;{ version: string; }\u0026gt;\u003c/code\u003e\n\n**Since:** 1.0.0\n\n--------------------\n\n\u003c/docgen-api\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcap-go%2Fcapacitor-flash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcap-go%2Fcapacitor-flash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcap-go%2Fcapacitor-flash/lists"}