Web Bluetooth SDK — scan, connect, read/write BLE devices from web apps (iOS Safari + Chrome)
WebBLE is a Web Bluetooth SDK for web apps. It works on Chrome natively and on iOS Safari via a companion app + Safari extension. The SDK provides scan, connect, read/write/subscribe operations for BLE devices.
| You want to... | Install | Scope |
|---|---|---|
| Scan, connect, read/write BLE devices | npm install @ios-web-bluetooth/core | @ios-web-bluetooth |
| Use typed device profiles (heart rate, battery, device info) | npm install @ios-web-bluetooth/profiles | @ios-web-bluetooth |
| React hooks and components for BLE | npm install @ios-web-bluetooth/react | @ios-web-bluetooth |
| Detect iOS Safari extension, show install banner | npm install @ios-web-bluetooth/detect |
| @ios-web-bluetooth |
| AI agent MCP tools | npx -y @ios-web-bluetooth/mcp | @ios-web-bluetooth |
| CLI scaffolding | npx ioswebble init | @ios-web-bluetooth |
Scope: All packages are published under @ios-web-bluetooth/*.
npm install @ios-web-bluetooth/core
import { WebBLE } from '@ios-web-bluetooth/core'
const ble = new WebBLE()
const device = await ble.requestDevice({
filters: [{ services: ['heart_rate'] }]
})
await device.connect()
const value = await device.read('heart_rate', 'heart_rate_measurement')
device.subscribe('heart_rate', 'heart_rate_measurement', (data) => {
console.log('Heart rate:', data)
})
npm install @ios-web-bluetooth/profiles
import { HeartRateProfile } from '@ios-web-bluetooth/profiles'
const profile = new HeartRateProfile(device)
profile.onHeartRate((data) => {
console.log(`BPM: ${data.heartRate}, Contact: ${data.contactDetected}`)
})
npm install @ios-web-bluetooth/detect
import { initIOSWebBLE } from '@ios-web-bluetooth/detect'
initIOSWebBLE({})
npm install @ios-web-bluetooth/detect
For React/Next.js:
import { IOSWebBLEProvider } from '@ios-web-bluetooth/detect/react'
// Wrap your app:
<IOSWebBLEProvider>{children}</IOSWebBLEProvider>
For any framework:
import { initIOSWebBLE } from '@ios-web-bluetooth/detect'
initIOSWebBLE({})
For plain HTML:
<script src="https://ioswebble.com/webble.js"></script>
npx ioswebble check
{
"ioswebble": {
"command": "npx",
"args": ["-y", "@ios-web-bluetooth/mcp"]
}
}
navigator.bluetooth calls — the extension handles compatibility'heart_rate') not hex ('0x180D') — the SDK resolves automatically@ios-web-bluetooth/profiles for standard devices instead of writing raw GATT parsing code@ios-web-bluetooth/react hooks instead of raw event listeners