Skip to main content

Overview

The Synheart Core iOS/Swift SDK provides a unified API for collecting HSI-compatible data, processing human state on-device, and generating focus/emotion signals in native iOS applications. Key Features:
  • Native iOS support
  • On-device HSI Runtime
  • Combine framework integration
  • Real-time state updates
  • Privacy-first architecture

Installation

Swift Package Manager

Add to your Package.swift:

Xcode

  1. File > Add Packages…
  2. Enter repository URL: https://github.com/synheart-ai/synheart-core-swift.git
  3. Select version: 0.0.4 or later (match the dependency entry above)
  4. Add to your target

Configuration

Info.plist

Add required usage descriptions:

Capabilities

Enable required capabilities in Xcode:
  1. Select your target
  2. Go to “Signing & Capabilities”
  3. Add “HealthKit” (if using Wear module)

Basic Usage

Initialize the SDK

Subscribe to HSI Updates

Activate features

The SynheartFeature enum gates collection by feature. Activation is one of four conditions a feature needs (consent, capability tier, an active session — see Capability System).
State signals (focus, emotion, recovery, etc.) are not separate features — they’re axes inside the HSI JSON emitted by Synheart.onHSIUpdate. Parse the JSON to read them.

Complete example

SwiftUI view

HSI snapshot reference

The Synheart Runtime emits raw JSON strings via onHSIUpdate (AnyPublisher<String, Never>). Parse the JSON to extract fields like the affect / engagement / activity / context axes. See the HSI specification for the wire format.

Cloud Connector

Configuration Options

Authentication for cloud uploads is hardware-backed device ECDSA (Secure Enclave) per RFC-AUTH-MOBILE-0001. The runtime owns request signing via the host’s synheart-auth integration — CloudConfig does not carry shared secrets or HMAC keys. See Synheart Auth overview for the device-identity flow.

Diagnostics & upload inspection

Use the diagnostics surface to inspect runtime state and force a flush when consent and network are eligible.

Error handling

See Consent System for the full consent model.

Async/await

API reference

Synheart

Main SDK class. Static methods: Publishers:

Resources