Back to Content

Bluetooth

files/en-us/web/api/bluetooth/index.md

latest1.3 KB
Original Source

{{APIRef("Bluetooth API")}}{{securecontext_header}}{{SeeCompatTable}}

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

{{InheritanceDiagram}}

Instance properties

Inherits properties from its parent {{domxref("EventTarget")}}.

Instance methods

  • {{domxref("Bluetooth.getAvailability","Bluetooth.getAvailability()")}} {{Experimental_Inline}}
    • : Returns a {{jsxref("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.
  • {{domxref("Bluetooth.getDevices","Bluetooth.getDevices()")}} {{Experimental_Inline}}
    • : Returns a {{jsxref("Promise")}} that resolves to an array of {{domxref("BluetoothDevice")}}s this origin is allowed to access. Permission is obtained via previous calls to {{domxref("Bluetooth.requestDevice","Bluetooth.requestDevice()")}}.
  • {{domxref("Bluetooth.requestDevice","Bluetooth.requestDevice()")}} {{Experimental_Inline}}
    • : Returns a {{jsxref("Promise")}} that resolves to a {{domxref("BluetoothDevice")}} object matching the specified options.

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}