---
description: The Capacitor Bluetooth Low Energy plugin enables interaction with Bluetooth Low Energy (BLE) devices in the central and peripheral role.
title: Announcing the Bluetooth Low Energy Plugin for Capacitor - Capawesome
image: https://capawesome.io/docs/assets/images/social/blog/announcing-the-capacitor-bluetooth-low-energy-plugin.png
---

[ Skip to content](#announcing-the-capacitor-bluetooth-low-energy-plugin) 

[ 🔐 Introducing the **Capacitor Vault** plugin — store secrets behind biometrics or a device passcode.](/blog/announcing-the-capacitor-vault-plugin/) 

* [  Formbricks ](/docs/plugins/formbricks/)
* [  Geocoder ](/docs/plugins/geocoder/)
* [  Google Sign-In ](/docs/plugins/google-sign-in/)
* [  Grafana Faro ](/docs/plugins/grafana-faro/)
* [  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/)
* [  Navigation Bar ](/docs/plugins/navigation-bar/)
* [  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 ](/docs/plugins/torch/)
* [  Vault ](/docs/plugins/vault/)
* [  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

* [  Peripheral role ](#peripheral-role)
* [  Closing Thoughts ](#closing-thoughts)

* Related links

# Announcing the Capacitor Bluetooth Low Energy Plugin[¶](#announcing-the-capacitor-bluetooth-low-energy-plugin "Permanent link")

Today we are excited to announce our brand new [Capacitor Bluetooth Low Energy](/docs/plugins/bluetooth-low-energy/) plugin. This plugin enables interaction with Bluetooth Low Energy (BLE) devices in the central and peripheral role and provides cross-platform support for Android and iOS. The project is now available for all Capawesome [Insiders](/docs/insiders/).

Let's take a quick look at the [API](/docs/plugins/bluetooth-low-energy/#api) and how you can use the pugin to communicate with BLE devices.

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

To install the Capacitor Bluetooth Low Energy plugin, please refer to the [Installation](/docs/plugins/bluetooth-low-energy/#installation) section in the plugin documentation.

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

Let's take a look at the basic usage of the plugin. The plugin supports two roles:

* **Central role**: The app acts as a central device that can connect to and communicate with peripheral devices.
* **Peripheral role**: The app acts as a peripheral device that can advertise its services and accept connections from central devices.

The plugin supports both roles on Android and iOS. The following sections will show you how to use the plugin in both roles.

### Central role[¶](#central-role "Permanent link")

The central role allows you to connect to and communicate with BLE devices.

#### Initialize the plugin[¶](#initialize-the-plugin "Permanent link")

First, you need to initialize the plugin and request the necessary permissions:

`[](#%5F%5Fcodelineno-0-1)import { BluetoothLowEnergy } from "@capawesome-team/capacitor-bluetooth-low-energy";
[](#%5F%5Fcodelineno-0-2)import { Capacitor } from "@capacitor/core";
[](#%5F%5Fcodelineno-0-3)
[](#%5F%5Fcodelineno-0-4)const initialize = async () => {
[](#%5F%5Fcodelineno-0-5)  if (Capacitor.getPlatform() === "ios") {
[](#%5F%5Fcodelineno-0-6)    await BluetoothLowEnergy.initialize({
[](#%5F%5Fcodelineno-0-7)      mode: "central",
[](#%5F%5Fcodelineno-0-8)    });
[](#%5F%5Fcodelineno-0-9)  } else {
[](#%5F%5Fcodelineno-0-10)    await BluetoothLowEnergy.requestPermissions();
[](#%5F%5Fcodelineno-0-11)  }
[](#%5F%5Fcodelineno-0-12)};
`

In this context, there are differences between Android and iOS. On **iOS**, you need to call the [initialize](/docs/plugins/bluetooth-low-energy/#initialize) method to initialize the plugin every time the app starts. On **Android**, you need to call the [requestPermissions](/docs/plugins/bluetooth-low-energy/#requestpermissions) method to request the necessary permissions.

#### Scan for devices[¶](#scan-for-devices "Permanent link")

Before you can connect to a device for the first time, you need to scan for devices. For this, you can use the [startScan](/docs/plugins/bluetooth-low-energy/#startscan):

`[](#%5F%5Fcodelineno-1-1)import { BluetoothLowEnergy } from "@capawesome-team/capacitor-bluetooth-low-energy";
[](#%5F%5Fcodelineno-1-2)
[](#%5F%5Fcodelineno-1-3)const startScan = async () => {
[](#%5F%5Fcodelineno-1-4)  await BluetoothLowEnergy.addListener("deviceScanned", (event) => {
[](#%5F%5Fcodelineno-1-5)    console.log("Device scanned", event.device);
[](#%5F%5Fcodelineno-1-6)  });
[](#%5F%5Fcodelineno-1-7)  await BluetoothLowEnergy.startScan();
[](#%5F%5Fcodelineno-1-8)};
[](#%5F%5Fcodelineno-1-9)
[](#%5F%5Fcodelineno-1-10)const stopScan = async () => {
[](#%5F%5Fcodelineno-1-11)  await BluetoothLowEnergy.stopScan();
[](#%5F%5Fcodelineno-1-12)};
`

Every time a device is found, the `deviceScanned` event is emitted. You can now display the found devices to your users and let them select the device they want to connect to. As soon as the user has selected a device, you should stop the scan with [stopScan](/docs/plugins/bluetooth-low-energy/#stopscan).

#### Connect to a device[¶](#connect-to-a-device "Permanent link")

To connect to a device, you can use the [connect](/docs/plugins/bluetooth-low-energy/#connect) method:

`[](#%5F%5Fcodelineno-2-1)import { BluetoothLowEnergy } from "@capawesome-team/capacitor-bluetooth-low-energy";
[](#%5F%5Fcodelineno-2-2)
[](#%5F%5Fcodelineno-2-3)const connect = async (deviceId: string) => {
[](#%5F%5Fcodelineno-2-4)  await BluetoothLowEnergy.connect({ deviceId });
[](#%5F%5Fcodelineno-2-5)};
`

You just need to pass the `deviceId` of the device you want to connect to. The `deviceId` is the address of the device (e.g. `00:11:22:33:AA:BB`) and is usually provided by the `deviceScanned` event.

Reconnect to a device 

You don't need to scan for devices every time you want to connect to a device. You can simply save the `deviceId` of the device and use it to reconnect to the device later.

#### Communicate with a device[¶](#communicate-with-a-device "Permanent link")

Before you can communicate with a device, you need to discover the services and characteristics of the device. For this, you can use the [discoverServices](/docs/plugins/bluetooth-low-energy/#discoverservices) method:

`[](#%5F%5Fcodelineno-3-1)import { BluetoothLowEnergy } from "@capawesome-team/capacitor-bluetooth-low-energy";
[](#%5F%5Fcodelineno-3-2)
[](#%5F%5Fcodelineno-3-3)const discoverServices = async () => {
[](#%5F%5Fcodelineno-3-4)  await BluetoothLowEnergy.discoverServices();
[](#%5F%5Fcodelineno-3-5)};
`

Use the [getServices](/docs/plugins/bluetooth-low-energy/#getservices) method to get a list of all services, characteristics, and descriptors of the device:

`[](#%5F%5Fcodelineno-4-1)import { BluetoothLowEnergy } from "@capawesome-team/capacitor-bluetooth-low-energy";
[](#%5F%5Fcodelineno-4-2)
[](#%5F%5Fcodelineno-4-3)const getServices = async () => {
[](#%5F%5Fcodelineno-4-4)  const { services } = await BluetoothLowEnergy.getServices();
[](#%5F%5Fcodelineno-4-5)  console.log("Services: ", services);
[](#%5F%5Fcodelineno-4-6)};
`

Now you can read, write, and subscribe to characteristics and descriptors using the following methods:

* [readCharacteristic](/docs/plugins/bluetooth-low-energy/#readcharacteristic)
* [writeCharacteristic](/docs/plugins/bluetooth-low-energy/#writecharacteristic)
* [startCharacteristicNotifications](/docs/plugins/bluetooth-low-energy/#startcharacteristicnotifications)
* [stopCharacteristicNotifications](/docs/plugins/bluetooth-low-energy/#stopcharacteristicnotifications)
* [readDescriptor](/docs/plugins/bluetooth-low-energy/#readdescriptor)
* [writeDescriptor](/docs/plugins/bluetooth-low-energy/#writedescriptor)

This is an example of how to read a characteristic value:

`[](#%5F%5Fcodelineno-5-1)import { BluetoothLowEnergy } from "@capawesome-team/capacitor-bluetooth-low-energy";
[](#%5F%5Fcodelineno-5-2)
[](#%5F%5Fcodelineno-5-3)const readCharacteristic = async (characteristicId: string) => {
[](#%5F%5Fcodelineno-5-4)  const { value } = await BluetoothLowEnergy.readCharacteristic({
[](#%5F%5Fcodelineno-5-5)    characteristicId,
[](#%5F%5Fcodelineno-5-6)  });
[](#%5F%5Fcodelineno-5-7)  console.log("Value: ", value); // e.g. [1, 2, 3, 4]
[](#%5F%5Fcodelineno-5-8)};
`

Values are exchanged as byte arrays. You can convert them to a hex string using the [convertBytesToHex](https://github.com/capawesome-team/capacitor-plugins/blob/main/packages/bluetooth-low-energy/docs/utils/README.md) method:

`[](#%5F%5Fcodelineno-6-1)import { BluetoothLowEnergyUtils } from "@capawesome-team/capacitor-bluetooth-low-energy";
[](#%5F%5Fcodelineno-6-2)
[](#%5F%5Fcodelineno-6-3)const convertBytesToHex = async (bytes: number[]) => {
[](#%5F%5Fcodelineno-6-4)  const { hex } = await BluetoothLowEnergyUtils.convertBytesToHex({ bytes });
[](#%5F%5Fcodelineno-6-5)  console.log("Hex: ", hex); // e.g. "01020304"
[](#%5F%5Fcodelineno-6-6)};
`

#### Disconnect from a device[¶](#disconnect-from-a-device "Permanent link")

To disconnect from a device, you simply need to call the [disconnect](/docs/plugins/bluetooth-low-energy/#disconnect) method:

`[](#%5F%5Fcodelineno-7-1)import { BluetoothLowEnergy } from "@capawesome-team/capacitor-bluetooth-low-energy";
[](#%5F%5Fcodelineno-7-2)
[](#%5F%5Fcodelineno-7-3)const disconnect = async () => {
[](#%5F%5Fcodelineno-7-4)  await BluetoothLowEnergy.disconnect();
[](#%5F%5Fcodelineno-7-5)};
`

### Peripheral role[¶](#peripheral-role "Permanent link")

The peripheral role allows you to advertise your app as a BLE device and accept connections from central devices.

#### Initialize the plugin[¶](#initialize-the-plugin%5F1 "Permanent link")

The initialization process is the same as in the central role. You need to call the [initialize](/docs/plugins/bluetooth-low-energy/#initialize) method on iOS and the [requestPermissions](/docs/plugins/bluetooth-low-energy/#requestpermissions) method on Android.

`[](#%5F%5Fcodelineno-8-1)import { BluetoothLowEnergy } from "@capawesome-team/capacitor-bluetooth-low-energy";
[](#%5F%5Fcodelineno-8-2)
[](#%5F%5Fcodelineno-8-3)const initialize = async () => {
[](#%5F%5Fcodelineno-8-4)  if (Capacitor.getPlatform() === "ios") {
[](#%5F%5Fcodelineno-8-5)    await BluetoothLowEnergy.initialize({
[](#%5F%5Fcodelineno-8-6)      mode: "peripheral",
[](#%5F%5Fcodelineno-8-7)    });
[](#%5F%5Fcodelineno-8-8)  } else {
[](#%5F%5Fcodelineno-8-9)    await BluetoothLowEnergy.requestPermissions();
[](#%5F%5Fcodelineno-8-10)  }
[](#%5F%5Fcodelineno-8-11)};
`

#### Start advertising[¶](#start-advertising "Permanent link")

To start advertising your app as a BLE device, you can use the [startAdvertising](/docs/plugins/bluetooth-low-energy/#startadvertising) method:

`[](#%5F%5Fcodelineno-9-1)import { BluetoothLowEnergy } from "@capawesome-team/capacitor-bluetooth-low-energy";
[](#%5F%5Fcodelineno-9-2)
[](#%5F%5Fcodelineno-9-3)const startAdvertising = async () => {
[](#%5F%5Fcodelineno-9-4)  await BluetoothLowEnergy.startAdvertising({
[](#%5F%5Fcodelineno-9-5)    name: "CapBLE",
[](#%5F%5Fcodelineno-9-6)    services: [
[](#%5F%5Fcodelineno-9-7)      {
[](#%5F%5Fcodelineno-9-8)        id: "12345678-1234-1234-1234-1234567890AB",
[](#%5F%5Fcodelineno-9-9)        characteristics: [
[](#%5F%5Fcodelineno-9-10)          {
[](#%5F%5Fcodelineno-9-11)            id: "87654321-4321-4321-4321-BA0987654321",
[](#%5F%5Fcodelineno-9-12)            descriptors: [],
[](#%5F%5Fcodelineno-9-13)            permissions: {
[](#%5F%5Fcodelineno-9-14)              read: true,
[](#%5F%5Fcodelineno-9-15)              write: true,
[](#%5F%5Fcodelineno-9-16)            },
[](#%5F%5Fcodelineno-9-17)            properties: {
[](#%5F%5Fcodelineno-9-18)              indicate: true,
[](#%5F%5Fcodelineno-9-19)              notify: true,
[](#%5F%5Fcodelineno-9-20)              read: true,
[](#%5F%5Fcodelineno-9-21)              write: true,
[](#%5F%5Fcodelineno-9-22)            },
[](#%5F%5Fcodelineno-9-23)          },
[](#%5F%5Fcodelineno-9-24)        ],
[](#%5F%5Fcodelineno-9-25)      },
[](#%5F%5Fcodelineno-9-26)    ],
[](#%5F%5Fcodelineno-9-27)  });
[](#%5F%5Fcodelineno-9-28)};
`

The `startAdvertising` method allows you to specify the name of the peripheral and the services it provides. The services can include characteristics with various properties and permissions.

#### Communicate with a device[¶](#communicate-with-a-device%5F1 "Permanent link")

After starting advertising, devices can connect to your app. You can listen to the `deviceConnected` event to get notified when a device connects to your app:

`[](#%5F%5Fcodelineno-10-1)import { BluetoothLowEnergy } from "@capawesome-team/capacitor-bluetooth-low-energy";
[](#%5F%5Fcodelineno-10-2)
[](#%5F%5Fcodelineno-10-3)const addListener = async () => {
[](#%5F%5Fcodelineno-10-4)  await BluetoothLowEnergy.addListener("deviceConnected", (event) => {
[](#%5F%5Fcodelineno-10-5)    console.log("Device connected", event.deviceId);
[](#%5F%5Fcodelineno-10-6)  });
[](#%5F%5Fcodelineno-10-7)};
`

You can also listen to the `deviceDisconnected` event to get notified when a device disconnects from your app:

`[](#%5F%5Fcodelineno-11-1)import { BluetoothLowEnergy } from "@capawesome-team/capacitor-bluetooth-low-energy";
[](#%5F%5Fcodelineno-11-2)
[](#%5F%5Fcodelineno-11-3)const addListener = async () => {
[](#%5F%5Fcodelineno-11-4)  await BluetoothLowEnergy.addListener("deviceDisconnected", (event) => {
[](#%5F%5Fcodelineno-11-5)    console.log("Device disconnected", event.deviceId);
[](#%5F%5Fcodelineno-11-6)  });
[](#%5F%5Fcodelineno-11-7)};
`

Read requests from devices are handled automatically by the plugin. You can use the [setCharacteristicValue](/docs/plugins/bluetooth-low-energy/#setcharacteristicvalue) method to set or update the value of a characteristic:

`[](#%5F%5Fcodelineno-12-1)import { BluetoothLowEnergy } from "@capawesome-team/capacitor-bluetooth-low-energy";
[](#%5F%5Fcodelineno-12-2)
[](#%5F%5Fcodelineno-12-3)const setCharacteristicValue = async () => {
[](#%5F%5Fcodelineno-12-4)  await BluetoothLowEnergy.setCharacteristicValue({
[](#%5F%5Fcodelineno-12-5)    characteristicId: "87654321-4321-4321-4321-BA0987654321",
[](#%5F%5Fcodelineno-12-6)    serviceId: "12345678-1234-1234-1234-1234567890AB",
[](#%5F%5Fcodelineno-12-7)    value: [1, 2, 3, 4], // Value byte array
[](#%5F%5Fcodelineno-12-8)  });
[](#%5F%5Fcodelineno-12-9)};
`

If a device wants to write a value to a characteristic, the plugin will emit the `characteristicWriteRequest` event. You can listen to this event and respond to the write request using the [setCharacteristicValue](/docs/plugins/bluetooth-low-energy/#setcharacteristicvalue) method:

`[](#%5F%5Fcodelineno-13-1)import { BluetoothLowEnergy } from "@capawesome-team/capacitor-bluetooth-low-energy";
[](#%5F%5Fcodelineno-13-2)
[](#%5F%5Fcodelineno-13-3)const addListener = async () => {
[](#%5F%5Fcodelineno-13-4)  await BluetoothLowEnergy.addListener(
[](#%5F%5Fcodelineno-13-5)    "characteristicWriteRequest",
[](#%5F%5Fcodelineno-13-6)    (event) => {
[](#%5F%5Fcodelineno-13-7)      console.log("Characteristic write request", event);
[](#%5F%5Fcodelineno-13-8)      // Respond to the write request
[](#%5F%5Fcodelineno-13-9)      void BluetoothLowEnergy.setCharacteristicValue({
[](#%5F%5Fcodelineno-13-10)        characteristicId: event.characteristicId,
[](#%5F%5Fcodelineno-13-11)        serviceId: event.serviceId,
[](#%5F%5Fcodelineno-13-12)        value: event.value,
[](#%5F%5Fcodelineno-13-13)      });
[](#%5F%5Fcodelineno-13-14)    }
[](#%5F%5Fcodelineno-13-15)  );
[](#%5F%5Fcodelineno-13-16)};
`

## Closing Thoughts[¶](#closing-thoughts "Permanent link")

We hope you are as excited as we are about the new [Capacitor Bluetooth Low Energy](/docs/plugins/bluetooth-low-energy/) plugin. Be sure to check out the [API Reference](/docs/plugins/bluetooth-low-energy/#api) to see what else you can do with this plugin. If you are missing any features, just [create a feature request](https://github.com/capawesome-team/capacitor-plugins/issues/new/choose) in the [GitHub repository](https://github.com/capawesome-team/capacitor-plugins). Make sure you follow us on [X](https://twitter.com/capawesomeio) so you don't miss any future updates.

March 18, 2026 

 Back to top 