---
description: Control the device's flashlight (torch) in your Capacitor app, enabling or disabling it as needed. Supports Android and iOS.
title: Capacitor Torch Plugin for Android & iOS - Capawesome
image: https://capawesome.io/docs/assets/images/social/plugins/torch.png
---

[ Skip to content](#capawesomecapacitor-torch) 

[ 🎉 Introducing **Capawesome Platform** — one platform for Live Updates, Native Builds, App Store Publishing, and Insider SDKs.](https://capawesome.io) 

* [  Formbricks ](/docs/plugins/formbricks/)
* [  Geocoder ](/docs/plugins/geocoder/)
* [  Google Sign-In ](/docs/plugins/google-sign-in/)
* [  libSQL ](/docs/plugins/libsql/)
* [  Live Update ](/docs/plugins/live-update/)
* [  Managed Configurations ](/docs/plugins/managed-configurations/)
* [  Media Session ](/docs/plugins/media-session/)
* [  ML Kit ](/docs/plugins/mlkit/)
* [  NFC ](/docs/plugins/nfc/)
* [  OAuth ](/docs/plugins/oauth/)
* [  Pedometer ](/docs/plugins/pedometer/)
* [  Photo Editor ](/docs/plugins/photo-editor/)
* [  PostHog ](/docs/plugins/posthog/)
* [  Printer ](/docs/plugins/printer/)
* [  Purchases ](/docs/plugins/purchases/)
* [  RealtimeKit ](/docs/plugins/realtimekit/)
* [  Screen Orientation ](/docs/plugins/screen-orientation/)
* [  Screenshot ](/docs/plugins/screenshot/)
* [  Secure Preferences ](/docs/plugins/secure-preferences/)
* [  Speech Recognition ](/docs/plugins/speech-recognition/)
* [  Speech Synthesis ](/docs/plugins/speech-synthesis/)
* [  Share Target ](/docs/plugins/share-target/)
* [  Square Mobile Payments ](/docs/plugins/square-mobile-payments/)
* [  SQLite ](/docs/plugins/sqlite/)
* [  Superwall ](/docs/plugins/superwall/)
* Torch [  Torch ](/docs/plugins/torch/)
* [  Configuration ](#configuration)
* [  Demo ](#demo)
* [  Usage ](#usage)
* [  API ](#api)
* [  Changelog ](#changelog)
* [  License ](#license)
* [  Wifi ](/docs/plugins/wifi/)
* [  Zip ](/docs/plugins/zip/)
* [  Cloud ](/docs/cloud/)
* [  Live Updates ](/docs/cloud/live-updates/)
* Advanced
* Integrations
* [  Native Builds ](/docs/cloud/native-builds/)
* [  Configuration ](/docs/cloud/native-builds/configuration/)
* [  Environments ](/docs/cloud/native-builds/environments/)
* Guides
* [  Sample Projects ](/docs/cloud/native-builds/sample-projects/)
* [  Troubleshooting ](/docs/cloud/native-builds/troubleshooting/)
* [  Automations ](/docs/cloud/automations/)
* [  Assist ](/docs/cloud/assist/)
* Account
* Organizations
* [  Organization and User Management ](/docs/cloud/organizations/memberships/)
* [  Single Sign-On (SSO) ](/docs/cloud/organizations/sso/)
* [  Teams ](/docs/cloud/organizations/teams/)
* [  Two-Factor Authentication ](/docs/cloud/organizations/two-factor-authentication/)
* [  Integrations ](/docs/cloud/integrations/)
* [  License Keys ](/docs/cloud/license-keys/)
* [  Webhooks ](/docs/cloud/webhooks/)
* [  Pricing ](https://capawesome.io/pricing/)
* [  FAQ ](/docs/cloud/faq/)
* [  Support ](/docs/cloud/support/)
* [  Contributing ](/docs/contributing/)
* [  LLMs ](/docs/llms/)
* [  Insiders ](/docs/insiders/)
* [  License ](https://capawesome.io/legal/eula/)
* [  Support ](/docs/insiders/support/)
* [  FAQ ](/docs/insiders/faq/)
* [  Blog ](/blog/)
* Categories

* [  Configuration ](#configuration)
* [  Demo ](#demo)
* [  Usage ](#usage)
* [  API ](#api)
* [  Changelog ](#changelog)
* [  License ](#license)

# @capawesome/capacitor-torch[¶](#capawesomecapacitor-torch "Permanent link")

Capacitor plugin for switching the flashlight on and off.

[ ![Deliver Live Updates to your Capacitor app with Capawesome Cloud](../../assets/external/cloud.capawesome.io/assets/banners/cloud-build-and-deploy-capacitor-apps.69628c3f.png) ](https://cloud.capawesome.io/) 

## Features[¶](#features "Permanent link")

We are proud to offer one of the most complete and feature-rich Capacitor plugins for torch/flashlight control. Here are some of the key features:

* 🖥️ **Cross-platform**: Supports Android, iOS, and Web.
* 🔦 **Torch control**: Enable, disable, and toggle torch/flashlight.
* ✅ **Availability check**: Check if torch is available on the device.
* 🌐 **Web support**: Uses MediaStream API for web torch control.
* 🔁 **Up-to-date**: Always supports the latest Capacitor version.

Missing a feature? Just [open an issue](https://github.com/capawesome-team/capacitor-plugins/issues) and we'll take a look!

## Newsletter[¶](#newsletter "Permanent link")

Stay up to date with the latest news and updates about the Capawesome, Capacitor, and Ionic ecosystem by subscribing to our [Capawesome Newsletter](https://cloud.capawesome.io/newsletter/).

## Compatibility[¶](#compatibility "Permanent link")

| Plugin Version | Capacitor Version | Status         |
| -------------- | ----------------- | -------------- |
| 8.x.x          | \>=8.x.x          | Active support |

## Installation[¶](#installation "Permanent link")

You can use our **AI-Assisted Setup** to install the plugin. Add the [Capawesome Skills](https://github.com/capawesome-team/skills) to your AI tool using the following command:

`[](#%5F%5Fcodelineno-0-1)npx skills add capawesome-team/skills --skill capacitor-plugins
`

Then use the following prompt:

`` [](#%5F%5Fcodelineno-1-1) Use the `capacitor-plugins` skill from `capawesome-team/skills` to install the `@capawesome/capacitor-torch` plugin in my project.
 ``

If you prefer **Manual Setup**, install the plugin by running the following commands and follow the platform-specific instructions below:

`[](#%5F%5Fcodelineno-2-1)npm install @capawesome/capacitor-torch
[](#%5F%5Fcodelineno-2-2)npx cap sync
`

### Android[¶](#android "Permanent link")

#### Permissions[¶](#permissions "Permanent link")

This API requires the following permissions be added to your `AndroidManifest.xml` before the `application` tag:

`[](#%5F%5Fcodelineno-3-1)<!-- To get access to the flashlight. -->
[](#%5F%5Fcodelineno-3-2)<uses-permission android:name="android.permission.FLASHLIGHT"/>
`

#### Variables[¶](#variables "Permanent link")

If needed, you can define the following project variable in your app’s `variables.gradle` file to change the default version of the dependency:

* `$androidxCameraCoreVersion` version of `androidx.camera:camera-core` (default: `1.5.2`)

This can be useful if you encounter dependency conflicts with other plugins in your project.

## Configuration[¶](#configuration "Permanent link")

No configuration required for this plugin.

## Demo[¶](#demo "Permanent link")

A working example can be found here: [robingenz/capacitor-plugin-demo](https://github.com/robingenz/capacitor-plugin-demo)

## Usage[¶](#usage "Permanent link")

`[](#%5F%5Fcodelineno-4-1)import { Torch } from '@capawesome/capacitor-torch';
[](#%5F%5Fcodelineno-4-2)
[](#%5F%5Fcodelineno-4-3)const enable = async () => {
[](#%5F%5Fcodelineno-4-4)  await Torch.enable();
[](#%5F%5Fcodelineno-4-5)};
[](#%5F%5Fcodelineno-4-6)
[](#%5F%5Fcodelineno-4-7)const disable = async () => {
[](#%5F%5Fcodelineno-4-8)  await Torch.disable();
[](#%5F%5Fcodelineno-4-9)};
[](#%5F%5Fcodelineno-4-10)
[](#%5F%5Fcodelineno-4-11)const isAvailable = async () => {
[](#%5F%5Fcodelineno-4-12)    const result = await Torch.isAvailable();
[](#%5F%5Fcodelineno-4-13)    return result.available;
[](#%5F%5Fcodelineno-4-14)};
[](#%5F%5Fcodelineno-4-15)
[](#%5F%5Fcodelineno-4-16)const isEnabled = async () => {
[](#%5F%5Fcodelineno-4-17)    const result = await Torch.isEnabled();
[](#%5F%5Fcodelineno-4-18)    return result.enabled;
[](#%5F%5Fcodelineno-4-19)};
[](#%5F%5Fcodelineno-4-20)
[](#%5F%5Fcodelineno-4-21)const toggle = async () => {
[](#%5F%5Fcodelineno-4-22)  await Torch.toggle();
[](#%5F%5Fcodelineno-4-23)};
`

## API[¶](#api "Permanent link")

* [enable(...)](#enable)
* [disable(...)](#disable)
* [isAvailable()](#isavailable)
* [isEnabled(...)](#isenabled)
* [toggle(...)](#toggle)
* [Interfaces](#interfaces)

### enable(...)[¶](#enable "Permanent link")

`[](#%5F%5Fcodelineno-5-1)enable(options?: EnableOptions | undefined) => Promise<void>
`

Enable the torch.

Only available on Android (SDK 23+), iOS and Web.

| Param       | Type                            |
| ----------- | ------------------------------- |
| **options** | [EnableOptions](#enableoptions) |

**Since:** 6.0.0

---

### disable(...)[¶](#disable "Permanent link")

`[](#%5F%5Fcodelineno-6-1)disable(options?: DisableOptions | undefined) => Promise<void>
`

Disable the torch.

Only available on Android (SDK 23+), iOS and Web.

| Param       | Type                              |
| ----------- | --------------------------------- |
| **options** | [DisableOptions](#disableoptions) |

**Since:** 6.0.0

---

### isAvailable()[¶](#isavailable "Permanent link")

`[](#%5F%5Fcodelineno-7-1)isAvailable() => Promise<IsAvailableResult>
`

Check if the torch is available.

Only available on Android, iOS and Web.

**Returns:** `Promise<[IsAvailableResult](#isavailableresult)>`

**Since:** 6.0.0

---

### isEnabled(...)[¶](#isenabled "Permanent link")

`[](#%5F%5Fcodelineno-8-1)isEnabled(options?: IsEnabledOptions | undefined) => Promise<IsEnabledResult>
`

Check if the torch is enabled.

Only available on Android, iOS and Web.

| Param       | Type                                  |
| ----------- | ------------------------------------- |
| **options** | [IsEnabledOptions](#isenabledoptions) |

**Returns:** `Promise<[IsEnabledResult](#isenabledresult)>`

**Since:** 6.0.0

---

### toggle(...)[¶](#toggle "Permanent link")

`[](#%5F%5Fcodelineno-9-1)toggle(options?: ToggleOptions | undefined) => Promise<void>
`

Toggle the torch.

Only available on Android (SDK 23+), iOS and Web.

| Param       | Type                            |
| ----------- | ------------------------------- |
| **options** | [ToggleOptions](#toggleoptions) |

**Since:** 6.0.0

---

### Interfaces[¶](#interfaces "Permanent link")

#### EnableOptions[¶](#enableoptions "Permanent link")

| Prop       | Type        | Description                                                                                                                                                                                             | Since |
| ---------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- |
| **stream** | MediaStream | The stream of media to enable the torch on. **Attention**: The stream must have a video track. The facing mode of the video track must be the one that corresponds to the torch. Only available on Web. | 6.2.0 |

#### DisableOptions[¶](#disableoptions "Permanent link")

| Prop       | Type        | Description                                                                                                                                                                                              | Since |
| ---------- | ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- |
| **stream** | MediaStream | The stream of media to disable the torch on. **Attention**: The stream must have a video track. The facing mode of the video track must be the one that corresponds to the torch. Only available on Web. | 6.2.0 |

#### IsAvailableResult[¶](#isavailableresult "Permanent link")

| Prop          | Type    | Description                            | Since |
| ------------- | ------- | -------------------------------------- | ----- |
| **available** | boolean | Whether the torch is available or not. | 6.0.0 |

#### IsEnabledResult[¶](#isenabledresult "Permanent link")

| Prop        | Type    | Description                          | Since |
| ----------- | ------- | ------------------------------------ | ----- |
| **enabled** | boolean | Whether the torch is enabled or not. | 6.0.0 |

#### IsEnabledOptions[¶](#isenabledoptions "Permanent link")

| Prop       | Type        | Description                                                                                                                                                                                                          | Since |
| ---------- | ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- |
| **stream** | MediaStream | The stream of media to check if the torch is enabled on. **Attention**: The stream must have a video track. The facing mode of the video track must be the one that corresponds to the torch. Only available on Web. | 6.2.0 |

#### ToggleOptions[¶](#toggleoptions "Permanent link")

| Prop       | Type        | Description                                                                                                                                                                                             | Since |
| ---------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- |
| **stream** | MediaStream | The stream of media to toggle the torch on. **Attention**: The stream must have a video track. The facing mode of the video track must be the one that corresponds to the torch. Only available on Web. | 6.2.0 |

## Changelog[¶](#changelog "Permanent link")

See [CHANGELOG.md](https://github.com/capawesome-team/capacitor-plugins/blob/main/packages/torch/CHANGELOG.md).

## License[¶](#license "Permanent link")

See [LICENSE](https://github.com/capawesome-team/capacitor-plugins/blob/main/packages/torch/LICENSE).

May 17, 2026 

 Back to top 