--- title: Bluetooth slug: Web/API/Bluetooth tags: - API - Bluetooth - Experimental - Interface - NeedsTranslation - Reference - TopicStub - Web Bluetooth API translation_of: Web/API/Bluetooth ---
{{APIRef("Bluetooth API")}}{{securecontext_header}}{{SeeCompatTable}}
The Bluetooth
interface of the Web Bluetooth API returns a {{jsxref("Promise")}} to a {{domxref("BluetoothDevice")}} object with the specified options.
interface Bluetooth : EventTarget { [SecureContext] Promise<boolean> getAvailability(); [SecureContext] attribute EventHandler onavailabilitychanged; [SecureContext, SameObject] readonly attribute BluetoothDevice? referringDevice; [SecureContext] Promise<BluetoothDevice> requestDevice(optional RequestDeviceOptions options); }; Bluetooth implements BluetoothDeviceEventHandlers; Bluetooth implements CharacteristicEventHandlers; Bluetooth implements ServiceEventHandlers;
Inherits properties from its parent {{domxref("EventTarget")}}.
navigator.bluetooth.referringDevice
.Specification | Status | Comment |
---|---|---|
{{SpecName('Web Bluetooth', '#bluetooth', 'Bluetooth')}} | {{Spec2('Web Bluetooth')}} | Initial definition. |
{{Compat("api.Bluetooth")}}