Skip to content

useHeartRateBroadcast

useHeartRateBroadcast(bpm, options?): void

Defined in: console-sdk/src/react/hooks/useHeartRateBroadcast.ts:86

Declaratively forward watch heart-rate to connected consoles (SDK_PLAN.md §3.7 row 14). While mounted, the current bpm is fanned out to every ready console (or the options.devices subset) — deduped and rate-limited per device by the engine — and recorded into the active session’s HR track. Returns nothing: it is a side-effecting bridge with zero cleanup for the consumer (unmount removes the registration).

null/undefined bpm sends nothing. A changed bpm is forwarded on the next commit; a changed options.devices re-registers the broadcast.

number | null | undefined

the latest heart-rate reading, or null/undefined for none.

HeartRateBroadcastOptions

optional fan-out restriction (devices).

void

useHeartRateBroadcast(bpm); // all ready consoles
useHeartRateBroadcast(bpm, { devices: [rower.id] }); // one console