Polar H10 Integration
The Polar H10 chest strap is the gold standard for consumer heart rate monitoring. It provides beat-to-beat RR intervals via Bluetooth Low Energy, enabling high-precision HRV analysis.
How It Works
- Connect to the Polar H10 via Web Bluetooth in the browser (Chrome, Edge) or native BLE on mobile
- Subscribe to the Heart Rate Measurement characteristic (UUID
0x2A37) - Extract heart rate and RR intervals from each notification
- Calculate HRV metrics (RMSSD, SDNN) from the RR intervals
- Send to Nefesh via
POST /v1/ingest
Example: Web Bluetooth Connection
// Request Bluetooth device
const device = await navigator.bluetooth.requestDevice({
filters: [{ services: ['heart_rate'] }]
});
// Connect and subscribe
const server = await device.gatt.connect();
const service = await server.getPrimaryService('heart_rate');
const char = await service.getCharacteristic('heart_rate_measurement');
char.addEventListener('characteristicvaluechanged', (event) => {
const value = event.target.value;
const hr = value.getUint8(1);
// Extract RR intervals from bytes 2+ (16-bit little-endian, in 1/1024s)
// Calculate RMSSD/SDNN from collected RR intervals
// Send to Nefesh API
});
await char.startNotifications();
Sending to Nefesh
await fetch('https://api.nefesh.ai/v1/ingest', {
method: 'POST',
headers: {
'X-Nefesh-Key': 'YOUR_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
session_id: 'your-session-id',
timestamp: new Date().toISOString(),
heart_rate: 74,
rmssd: 42.5,
sdnn: 51.3,
source_device: 'polar_h10',
}),
});
Recommended Update Frequency
Send data every 5-10 seconds. The Polar H10 sends HR notifications approximately once per second, but HRV metrics (RMSSD, SDNN) require a window of at least 5 seconds of RR intervals to be meaningful.
Browser Support
| Browser | Web Bluetooth |
|---|---|
| Chrome (desktop + Android) | Supported |
| Edge | Supported |
| Safari / iOS | Not supported — use native BLE |
| Firefox | Not supported |