Skip to main content

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 runs SessionEngine 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.

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 includeRawSamples for live HR trace, RR intervals, and accelerometer data
  • Motion metrics on watch: Watch companion apps stream per-frame motion_rms_g and motion_sample_count alongside HR metrics (iOS also includes active_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

  1. You call startSession(config) which returns a Stream<SessionEvent>
  2. The stream emits SessionStarted when the engine begins
  3. SessionFrame events arrive at the configured emitIntervalSec
  4. If includeRawSamples: true, BiosignalFrame events also arrive at rawEmitIntervalSec (defaults to emitIntervalSec)
  5. When the session ends (duration elapsed or you call stopSession), a SessionSummary is emitted
  6. The stream closes automatically after summary or error

Session Modes

Compute Profile

The ComputeProfile controls how often session frames are emitted and the window size for computation:

Raw Biosignal Streaming

When includeRawSamples is enabled in SessionConfig, the engine emits BiosignalFrame events alongside session frames. Each BiosignalFrame contains an array of BiosignalSample objects with: This is useful for live HR trace display, RR interval visualization, and motion artifact detection. Session frames continue to emit normally — raw biosignal data is additive.

Available SDKs

Flutter SDK

Cross-platform SDK for iOS and Android apps with mock mode for development. Supports optional BehaviorProvider in mock mode; in production, behavioral data flows from the native SessionEngine automatically.

Flutter SDK Documentation

Flutter integration guide
Installation:
Version: 0.2.0 Min OS: iOS 13+ / Android API 21+ Repository: synheart-session-flutter · runnable example

Swift SDK

Native Swift SDK for iOS and watchOS with SessionEngine, pluggable BiosignalProvider and BehaviorProvider.

Swift SDK Documentation

Swift and watchOS integration guide
Installation:
Version: 0.2.0 Min OS: iOS 13.0+ / macOS 10.15+ / watchOS 6.0+ / tvOS 13.0+ Repository: synheart-session-swift

Kotlin SDK

Native Kotlin SDK for Android with SessionEngine, pluggable BiosignalProvider and BehaviorProvider (reflection-based wrappers). Installation:
Version: 0.2.0 Min OS: Android API 21+ (Android 5.0) Repository: synheart-session-kotlin

Stability

Synheart Session is pre-1.0. Minor version bumps may include breaking API changes — pin exact versions in production, and read the CHANGELOG before upgrading. The on-watch SessionEngine and the phone-side bridge are versioned together; check the watch protocol page if you’re shipping a custom watch companion.

Session Frame Structure

Each SessionFrame 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

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

Flutter SDK

Flutter integration guide

Swift SDK

Swift and watchOS guide

Kotlin SDK

Android integration guide

Community

  • GitHub: github.com/synheart-ai — every Session SDK lives in its per-language repo (synheart-session-flutter, synheart-session-kotlin, synheart-session-swift).
  • Issues: file against the relevant per-language repo.