Overview
The Synheart Wear Swift SDK provides native iOS support for streaming biometric data from Apple Watch via HealthKit, vendor cloud APIs (WHOOP, Garmin, Fitbit, Oura), direct BLE heart-rate sensors, and offline Apple Healthexport.xml backfill.
Installation
Swift Package Manager
Add to yourPackage.swift:
- File → Add Packages…
- Enter:
https://github.com/synheart-ai/synheart-wear-swift.git
Requirements
- iOS 13.0+
- Swift 5.9+
- Xcode 15.0+
Quick Start
Configure HealthKit
Add toInfo.plist:
- Target → Signing & Capabilities → + Capability → HealthKit
Initialize SDK
Request Permissions & Read Data
Real-Time Streaming
streamHR(interval:) returns a Combine AnyPublisher<WearMetrics, Error>. Use streamHRAsync(interval:) if you prefer AsyncStream.
BLE Heart Rate Monitor
Connect directly to any standard Bluetooth LE heart rate monitor for real-time HR streaming.Setup
Add toInfo.plist:
Usage
Supported Devices
Works with any BLE device implementing the standard Heart Rate Profile (0x180D):- WHOOP (Broadcast HR mode)
- Polar H10, OH1
- Wahoo TICKR
- Garmin HRM-Pro / HRM-Dual
Cloud providers (WHOOP / Garmin / Fitbit / Oura)
Each cloud vendor is exposed via a typed accessor onSynheartWear plus the generic getProvider() lookup:
provider.connect() to launch the system browser at the authorize URL, then provider.connectWithCode(code:state:redirectUri:) from your deep-link handler. For Fitbit and Oura, the cloud delivers a vendor_user_id directly via deep link — pass that as the code argument.
Apple Health XML Backfill
TheAppleXmlImport module ingests an Apple Health export.xml (the file produced by the Health app’s “Export All Health Data” feature) and converts it into a stream of AppleHealthSample records. The streaming SAX parser stays under a 200 MB working-set budget regardless of file size, so multi-hundred-MB exports are safe.
IdempotencyKey (SHA-256 over a canonical subset of fields), so re-running the import on the same file produces the same keys and downstream sinks can dedupe safely.
Garmin Health SDK (Native RTS)
TheGarminHealth facade provides native Garmin device integration for scanning, pairing, and real-time streaming using generic SDK-owned types.
Important: The Garmin Health SDK Real-Time Streaming (RTS) capability requires a separate license from Garmin. This facade is available on demand for licensed integrations. The underlying Garmin Health SDK code is proprietary to Garmin and is not distributed as open source.
GarminProvider instead.
Resources
- Repository: synheart-wear-swift
- Full README: View on GitHub
- Issues: GitHub Issues