navigator.bluetooth returns a Bluetooth object — the entry point to Web Bluetooth. Learn secure-context rules, feature detection, getAvailability(), how requestDevice() works, five examples, and try-it labs.
01
Kind
Read-only property
02
Returns
Bluetooth
03
Status
Experimental
04
Context
Secure (HTTPS)
05
Baseline
Not yet
06
Key methods
getAvailability
Fundamentals
Introduction
Web Bluetooth lets a page talk to nearby Bluetooth Low Energy (BLE) devices — heart-rate monitors, bulbs, sensors — after the user picks a device in a browser chooser.
Your starting point is navigator.bluetooth. When the API exists, that property returns a Bluetooth object with methods such as getAvailability() and requestDevice().
💡
User gesture required
requestDevice() must run from a click (or similar user activation). Browsers block silent device prompts for privacy.
Concept
Understanding the bluetooth Property
navigator.bluetooth is read-only. You do not assign to it — you call methods on the object it returns.
getAvailability() — Promise<boolean>: can this UA support Bluetooth?
requestDevice(options) — Promise<BluetoothDevice>: user picks a device.
getDevices() — previously permitted devices for this origin (where supported).
Requires HTTPS (or localhost) and explicit user permission via the chooser.
Foundation
📝 Syntax
General form of the property:
JavaScript
navigator.bluetooth
Value
A Bluetooth object for the current document (when supported).
Common patterns
JavaScript
if (!("bluetooth" in navigator)) {
console.log("Web Bluetooth not available");
} else {
const ok = await navigator.bluetooth.getAvailability();
console.log("available:", ok);
// From a button click:
// const device = await navigator.bluetooth.requestDevice({
// acceptAllDevices: true
// });
}
Cheat Sheet
⚡ Quick Reference
Goal
Code
Feature detect
"bluetooth" in navigator
Secure page?
window.isSecureContext
Hardware available?
await navigator.bluetooth.getAvailability()
Pick a device
await navigator.bluetooth.requestDevice(opts)
When to request
Inside a click handler
Missing API
Show fallback UI — do not throw
Snapshot
🔍 At a Glance
Four facts to remember about navigator.bluetooth.
Returns
Bluetooth
API entry
Status
experimental
Not Baseline
HTTPS
required
Secure context
Chooser
user click
requestDevice
Compare
📋 Detect vs availability vs request
Check
What it answers
Example
"bluetooth" in navigator
Is the Web Bluetooth API present?
API exists in this browser
isSecureContext
Are we on HTTPS / localhost?
Required for the API
getAvailability()
Can Bluetooth be used right now?
Adapter / UA policy
requestDevice()
User-approved device access
Opens chooser UI
Hands-On
Examples Gallery
Examples follow MDN Navigator.bluetooth / Web Bluetooth patterns with safe detection. Use View Output or Try It Yourself for each case.
Even on HTTPS, many browsers still omit the property. Secure context is necessary but not sufficient.
📈 Practical Patterns
Availability, requestDevice shape, and a safe helper.
Example 3 — getAvailability()
Ask whether the user agent can support Bluetooth right now.
JavaScript
async function checkBt() {
if (!("bluetooth" in navigator)) {
return "Web Bluetooth API missing";
}
const ok = await navigator.bluetooth.getAvailability();
return "getAvailability: " + ok;
}
checkBt().then(console.log);
Web Bluetooth API missing
(or "getAvailability: true/false")
How It Works
MDN notes some UAs let users configure what getAvailability() returns.
Example 4 — requestDevice() Pattern
Call only from a button click; handle cancel/errors.
JavaScript
async function onConnectClick() {
if (!("bluetooth" in navigator)) {
return "Web Bluetooth not supported";
}
try {
const device = await navigator.bluetooth.requestDevice({
acceptAllDevices: true
});
return "selected: " + (device.name || "(unnamed)");
} catch (err) {
return "requestDevice failed: " + err.name;
}
}
// Wire to a button in Try It — do not auto-run without a gesture
navigator.bluetooth is Experimental and not Baseline. Chromium-based browsers historically lead support; Safari and Firefox generally do not expose Web Bluetooth for typical sites. Always feature-detect.
✓ Experimental · Not Baseline
Navigator.bluetooth
Use Web Bluetooth only as progressive enhancement on supporting Chromium builds over HTTPS.
LimitedNot Baseline
Google ChromeWeb Bluetooth on supported desktop/Android builds (check MDN)
Limited
Microsoft EdgeChromium Edge — follow Chrome Web Bluetooth status
Limited
OperaChromium-based — check current compat
Limited
Mozilla FirefoxNot available for typical web content
Unavailable
Apple SafariNot available for typical web content
Unavailable
Internet ExplorerNo Web Bluetooth API
Unavailable
bluetoothLimited
Bottom line: Detect navigator.bluetooth, require HTTPS, and offer non-Bluetooth fallbacks for unsupported browsers.
Wrap Up
Conclusion
navigator.bluetooth is the experimental entry point to Web Bluetooth. Feature-detect it, serve over HTTPS, check getAvailability(), and only call requestDevice() from a user click — with a fallback when the API is missing.
Experimental Web Bluetooth entry — detect, HTTPS, user gesture.
5
Core concepts
📡01
Returns
Bluetooth
API
🧪02
Status
experimental
Caution
🔒03
HTTPS
secure context
Security
🔍04
Availability
getAvailability
Check
🖱05
Chooser
requestDevice
Click
❓ Frequently Asked Questions
It is a read-only Navigator property that returns a Bluetooth object for the current document. That object is the entry point to the Web Bluetooth API (availability checks and device requests).
Yes. MDN marks it Experimental and not Baseline. Support is limited — always feature-detect and check compatibility before production use.
Yes. It is available only in secure contexts (HTTPS or localhost) in supporting browsers.
If navigator.bluetooth exists, call await navigator.bluetooth.getAvailability() which resolves to a boolean. Some browsers also let users configure what that method returns.
Call navigator.bluetooth.requestDevice(options) from a user gesture (for example a button click). It opens a chooser and resolves to a BluetoothDevice when the user picks a device.
No. The property is read-only. You use methods on the returned Bluetooth object such as getAvailability() and requestDevice().
Did you know?
Web Bluetooth is designed around user choice: the browser chooser is the permission UI. Sites cannot silently scan and connect to arbitrary nearby devices without that step.