Skip to main content

Overview

The Synheart Core Swift SDK collects approved signals, processes human state on-device, and delivers HSI 1.3 state windows to native Apple applications. Key features:
  • iOS, macOS, watchOS, and tvOS support
  • On-device HSI processing
  • Typed and raw Combine publishers
  • Modular signal collection
  • Consent-aware local storage and cloud delivery

Installation

Add the Swift package

In Xcode, choose File → Add Package Dependencies and enter:
Or add the package dependency directly:

Install the native runtime

The Swift package provides the Apple integration layer. On-device HSI computation requires the native Synheart runtime.
See Install the runtime for runtime variants and linking instructions.
Stable and lab runtime variants require onnxruntime-c to be linked by the host application. Do not embed duplicate copies of the runtime or ONNX library.

Apple permissions

Add only the usage descriptions required by the features your app enables:
Enable HealthKit in Xcode when using wearable collection.

Quick start

The normal lifecycle is:
allowUnsignedCapabilities: true is for local development only. Production apps must use a verified capability configuration.

Production configuration

Use pseudonymous subject identifiers and the service origins issued for your environment. Do not embed API secrets or shared signing keys in the application.
Production cloud requests use registered device identity. Ensure registration and cloud consent are ready before enabling cloud delivery:
A feature operates only when it is activated, consented, allowed by capability policy, and an eligible session is active.
Consent revocation stops future use of that consent. It is separate from deleting previously retained data.

HSI state updates

Use the typed publisher for application logic:
Use the raw publisher when you need the complete HSI 1.3 payload:
currentHSIState provides the latest typed value and currentState provides the latest raw JSON. HSI is emitted in windows, not for every sensor sample, so applications should show a collecting state while waiting for the first valid window. See the HSI specification for the wire format.

Cloud delivery and diagnostics

Cloud delivery requires cloud configuration, consent, feature activation, device registration, and network availability.
For runtime and collection troubleshooting:
A zero-length queue does not by itself confirm successful ingestion. Inspect the flush result and the latest upload diagnostics.

Advanced capabilities

The Swift SDK also exposes the following runtime-backed features. Availability depends on the linked runtime and the application’s capability policy. Pairing tokens, recovery keys, and exported baseline material are sensitive. Keep them out of logs and analytics and store them using platform-protected storage.

Error handling

Troubleshooting

Resources