Web Bluetooth API
Published
Web Bluetooth API — The Web Bluetooth API lets a web app request access to nearby Bluetooth Low Energy devices via navigator.bluetooth.requestDevice() and communicate with their GATT services.
Browser & ecosystem support
Section titled “Browser & ecosystem support”- Legend
- Yes
- Partial
- Flag
- No
- Unknown
| Browser / Platform | Support | Versions | Confidence | Source | Notes |
|---|---|---|---|---|---|
| Chrome (Desktop) | Yes | 56 | high | source | — |
| Chrome (Android) | Yes | 56 | high | source | 1 |
| Edge (Desktop) | Yes | 79 | high | source | 2 |
| Firefox (Desktop) | No | — | high | source | 3 |
| Firefox (Android) | No | — | high | source | 45 |
| Safari (macOS) | No | — | high | source | 6 |
| Safari (iOS) | No | — | high | source | 78 |
| Samsung Internet | Yes | 6.0 | high | source | 9 |
| WebView (Android) | No | — | high | source | 10 |
| Opera | Yes | 43 | high | source | 11 |
- Derived by browser-compat-data mirroring from Chrome.
- Derived by browser-compat-data mirroring from Chrome.
- Implementation tracking: https://bugzil.la/674737.
- Implementation tracking: https://bugzil.la/674737.
- Derived by browser-compat-data mirroring from Firefox.
- Implementation tracking: https://webkit.org/b/101034.
- Implementation tracking: https://webkit.org/b/101034.
- Derived by browser-compat-data mirroring from Safari.
- Derived by browser-compat-data mirroring from Chrome Android.
- No WebView Android support is recorded in browser-compat-data.
- Mirrors Chrome's implementation (BCD `opera: mirror`): Linux support exists but is not enabled by default.
How to use it
Section titled “How to use it”Requesting a device must happen inside a user gesture (e.g. a click handler), and you narrow
the request with filters naming the GATT service(s) you intend to use:
async function connectHeartRateMonitor() { const device = await navigator.bluetooth.requestDevice({ filters: [{ services: ['heart_rate'] }], }); const server = await device.gatt.connect(); const service = await server.getPrimaryService('heart_rate'); const characteristic = await service.getCharacteristic('heart_rate_measurement'); await characteristic.startNotifications(); return characteristic;}How to detect it at runtime
Section titled “How to detect it at runtime”Check for navigator.bluetooth before offering the feature, and give the reader a fallback
path when it is absent:
if ('bluetooth' in navigator) { connectButton.hidden = false;} else { connectButton.hidden = true; fallbackNotice.textContent = 'This browser cannot pair Bluetooth devices from the page.';}Practical checklist
Section titled “Practical checklist”- Requires a secure context — calling it from an insecure origin is not permitted.
requestDevice()requires transient user activation (a click or tap handler); without it, the returned promise rejects with aSecurityError.- If no device is available to return — for example the user does not select one —
requestDevice()rejects with aNotFoundError. - Support is not uniform across browsers or platforms; check the support table above before relying on the feature for a given target.
- Always pair the runtime check above with the support table, since a browser can expose
navigator.bluetoothwhile still restricting behaviour in ways that only surface at request time.
Where to go next
Section titled “Where to go next”For the full reference (device-picker flow, GATT model, permission behaviour), see Web Bluetooth API.
Related: WebUSB API.
← Back to the Compatibility explorer.