MDN self-hosted library · e01.org

Bluetooth

Bluetooth API

no runnable cells web-api-interface upstream source

Bluetooth API

The Bluetooth interface of the Web Bluetooth API provides methods to query Bluetooth availability and request access to devices.

Instance properties

Inherits properties from its parent EventTarget.

Instance methods

  • Bluetooth.getAvailability()
  • : Returns a Promise that resolves to a boolean value indicating whether the user agent can support Bluetooth. Some user agents let the user configure an option that specifies what value is returned by this method.
  • Bluetooth.getDevices()
  • : Returns a Promise that resolves to an array of BluetoothDevices this origin is allowed to access. Permission is obtained via previous calls to Bluetooth.requestDevice().
  • Bluetooth.requestDevice()
  • : Returns a Promise that resolves to a BluetoothDevice object matching the specified options.

Specifications

Browser compatibility