Read Heart Rate via WebSocket

This method allows reading the heart rate of the user in real-time. The WebSocket connection can be interrupted at any point in time, make sure to have retry logic with backoff.

Request

name
value

url

wss://dev.pulsoid.net/api/v1/data/real_time

scope

data:heart_rate:read

Authentication

Provide your OAuth2 Bearer token using one of the following methods:

Method
Example

Query parameter

wss://dev.pulsoid.net/api/v1/data/real_time?access_token=YOUR_TOKEN

Header

Authorization: Bearer YOUR_TOKEN

Query Parameters explained:

name
type
description

access_token

string

OAuth2 access token (alternative to Authorization header)

Websocket URL Request Example

wss://dev.pulsoid.net/api/v1/data/real_time?access_token=8c4da3ce-7ed7-4a19-a1f1-058498661e45

WebSocket Message Example

{
  "measured_at": 1625310655000,
  "data": {
    "heart_rate": 40
  }
}

Websocket URL Request Example With response_mode=text_plain_only_heart_rate

WebSocket Message Example With response_mode=text_plain_only_heart_rate


JavaScript / TypeScript

For JavaScript and TypeScript applications, use the official @pulsoid/socketarrow-up-right library instead of managing WebSocket connections manually. It provides auto-reconnection with exponential backoff, typed events, and zero dependencies.

See the GitHub repositoryarrow-up-right for full documentation and configuration options.

Last updated