Bluetooth: getDevices() method

Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The getDevices() method of Bluetooth interface of Web Bluetooth API exposes the Bluetooth devices this origin is allowed to access. This method does not display any permission prompts.

Note: This method returns a BluetoothDevice for each device the origin is currently allowed to access, even the ones that are out of range or powered off.

Syntax

js

getDevices()

Parameters

None.

Return value

A Promise that resolves with an array of BluetoothDevices.

Exceptions

This method doesn't throw any exceptions.

Specifications

Specification
Web Bluetooth
# dom-bluetooth-getdevices

Browser compatibility

BCD tables only load in the browser