Web Bluetooth

This page is an extract from the repository

Sections in this article

Check browser support.

Install the package

yarn add @ledgerhq/hw-transport-web-ble

API

BluetoothTransport

Extends Transport

react-native bluetooth BLE implementation

Parameters

  • device Device
  • writeCharacteristic Characteristic
  • notifyObservable Observable<any>
  • deviceModel DeviceModel

Examples

import BluetoothTransport from "@ledgerhq/hw-transport-web-ble";

exchange

Exchange with the device using APDU protocol.

Parameters

Returns Promise<Buffer> a promise of apdu response

observeAvailability

observe event with { available: bool, type: string } (available is generic, type is specific) an event is emit once and then each time it changes

Parameters

  • observer any

listen

Scan for Ledger Bluetooth devices. On this web implementation, it only emits ONE device, the one that was selected in the UI (if any).

Parameters

  • observer any

open

open a bluetooth device.

Parameters

  • deviceOrId (Device | string)

disconnect

globally disconnect a bluetooth device by its id.

Parameters

  • id any

Did you find this page helpful?

What would you like to see here?
WebUSB
Node Hid Singleton
Getting Started
Theme Features
Customization