What is Synheart Session?
Synheart Session is a real-time biometric session SDK that captures heart rate data from wearable sensors, computes session metrics on-device, and optionally fuses timing-based behavioral signals alongside HR data. It supports timed sessions with configurable modes, streaming session frames at regular intervals, and delivers a final session summary when complete. The watch runsSessionEngine locally, computes session frames with flat HR/HRV metrics (and optional motion metrics), and streams them back to the phone in real time via WatchConnectivity (iOS) or Wearable Data Layer (Android). When no watch is available, the SDK falls back to a local engine transparently. The SDK optionally integrates with Synheart Flux for normalized HSI 1.0 scoring when the Flux binary is bundled.
Key Features
Session Lifecycle
- Configurable sessions: Set mode (focus, breathing), duration, and compute profile
- Streaming session frames: Receive periodic session frames with flat metrics during the session
- Session summary: Get a final computation covering the full session duration
- Typed event stream:
SessionStarted,SessionFrame,BiosignalFrame,SessionSummary,SessionError - Optional raw biosignal streaming: Opt-in
includeRawSamplesfor live HR trace, RR intervals, and accelerometer data - Motion metrics on watch: Watch companion apps stream per-frame
motion_rms_gandmotion_sample_countalongside HR metrics (iOS also includesactive_energy_kcal)
Pluggable Providers
- BiosignalProvider: Pluggable HR source — mock (sinusoidal), BLE HRM (via synheart-wear), HealthKit, Health Connect
- BehaviorProvider: Optional pull-based behavioral signal source — mock (stable mid-range values), synheart-behavior SDK (typing, scrolling, taps, app switches, idle gaps, stability/fragmentation indices)
- Backward compatible: All providers are optional with sensible defaults — existing code works unchanged
Phone-Watch Streaming
- WatchConnectivity relay: Phone sends session commands to the watch via
WCSession - Watch-side engine: SessionEngine runs on watchOS with direct sensor access
- Real-time streaming: Session frames stream from watch to phone as they are computed
- Transparent fallback: If the watch is not reachable, the SDK falls back to a local engine automatically
Cross-Platform
- Flutter/Dart: Cross-platform mobile SDK with mock and native modes
- Swift: Native iOS and watchOS SDK with SessionEngine and pluggable providers
- Kotlin: Native Android SDK with SessionEngine and reflection-based provider wrappers
- Mock mode: Built-in mock engine for development and testing without hardware
Architecture
Event Flow
- You call
startSession(config)which returns aStream<SessionEvent> - The stream emits
SessionStartedwhen the engine begins SessionFrameevents arrive at the configuredemitIntervalSec- If
includeRawSamples: true,BiosignalFrameevents also arrive atrawEmitIntervalSec(defaults toemitIntervalSec) - When the session ends (duration elapsed or you call
stopSession), aSessionSummaryis emitted - The stream closes automatically after summary or error
Session Modes
| Mode | Description |
|---|---|
focus | Steady-state measurement for attention and cognitive sessions |
breathing | Guided breathing sessions with HRV-focused computation |
Compute Profile
TheComputeProfile controls how often session frames are emitted and the window size for computation:
| Parameter | Default | Description |
|---|---|---|
windowSec | 60 | Size of the sliding window (seconds) for HR/HRV computation |
emitIntervalSec | 5 | How often to emit a session frame (seconds) |
rawEmitIntervalSec | null | How often to emit raw biosignal frames (seconds). Defaults to emitIntervalSec when null |
Raw Biosignal Streaming
WhenincludeRawSamples is enabled in SessionConfig, the engine emits BiosignalFrame events alongside session frames. Each BiosignalFrame contains an array of BiosignalSample objects with:
| Field | Type | Description |
|---|---|---|
timestampMs | int | Unix timestamp in milliseconds |
bpm | double | Instantaneous heart rate in BPM |
rrIntervalMs | double? | Inter-beat (RR) interval in milliseconds |
accelerometer | {x, y, z}? | 3-axis accelerometer reading |
spo2 | double? | SpO2 percentage (0-100) when available |
Available SDKs
Flutter/Dart SDK
Cross-platform SDK for iOS and Android apps with mock mode for development. Supports optionalBehaviorProvider in mock mode; in production, behavioral data flows from the native SessionEngine automatically.
Dart SDK Documentation
Flutter integration guide
Swift SDK
Native Swift SDK for iOS and watchOS with SessionEngine, pluggableBiosignalProvider and BehaviorProvider.
Swift SDK Documentation
Swift and watchOS integration guide
Kotlin SDK
Native Kotlin SDK for Android with SessionEngine, pluggableBiosignalProvider and BehaviorProvider (reflection-based wrappers).
Installation:
Session Frame Structure
EachSessionFrame contains a flat metrics dictionary with HR, HRV, and optional motion metrics. When a BehaviorProvider is configured, an optional behavior map is also included:
Frame Metrics
| Key | Type | Platforms | Description |
|---|---|---|---|
hr_mean_bpm | double | All | Mean heart rate in BPM over the window |
hr_sdnn_ms | double | All | Standard deviation of NN intervals (ms) |
rmssd_ms | double | All | Root mean square of successive RR differences (ms) |
sample_count | int | All | Number of HR samples in the window |
start_ms | int | All | Window start timestamp (ms since epoch) |
end_ms | int | All | Window end timestamp (ms since epoch) |
motion_rms_g | double | Watch | RMS acceleration magnitude in g-force (optional) |
motion_sample_count | int | Watch | Number of accelerometer samples in the frame interval (optional) |
active_energy_kcal | double | watchOS | Cumulative active energy burned in kcal (optional, iOS only) |
motion_rms_g and motion_sample_count are present when the wearable has an accelerometer. active_energy_kcal is iOS-only (from HKLiveWorkoutBuilder). All motion/energy keys are optional — absent if the sensor is unavailable.
Next Steps
Dart SDK
Flutter integration guide
Swift SDK
Swift and watchOS guide
Kotlin SDK
Android integration guide
Watch Companion Apps
- watchOS: synheart-wear-watch-ios — Swift/SwiftUI companion with HR, motion, and active energy sensors
- Wear OS: synheart-wear-watch-android — Kotlin/Compose companion with HR and motion sensors
Community
- GitHub: synheart-ai/synheart-session
- Issues: Report Bugs
Author: Israel Goytom Made with care by the Synheart AI Team