Overview
Apple Health integration uses a push-based model where health data is sent from the user’s device to Open Wearables using our mobile SDK. This is different from cloud providers like Garmin or Polar that use webhooks.Why Push-Based? Apple HealthKit doesn’t expose a cloud API. Health data lives exclusively on the user’s device, so your mobile app must actively push data to your backend using our SDK.
Integration Options
iOS SDK (Swift)
Native iOS SDK — the core implementation for Apple HealthKit sync.
Flutter SDK
Cross-platform wrapper — syncs Apple Health on iOS via the native iOS SDK.
React Native SDK
Cross-platform wrapper — syncs Apple Health on iOS via the native iOS SDK.
XML Import
Import Apple Health data from XML exports. Useful for one-time migrations.
Flutter SDK Quick Start
The fastest way to integrate Apple Health:Full Integration Guide
Complete step-by-step guide including backend setup, authentication flow, and best practices.
Requirements
Supported Data Types
Apple Health provides the widest range of health data types:- Activity: Steps, distance, flights climbed, active energy
- Heart: Heart rate, resting HR, HRV, VO2 max
- Sleep: Sleep sessions with stages
- Workouts: All workout types with detailed metrics
- Body: Weight, height, body fat percentage
- Nutrition: Dietary intake tracking
When a Night’s Sleep Becomes Available
HealthKit has no sleep session object, only stage samples, so Open Wearables builds sessions from them:- The app with the SDK uploads new sleep samples when iOS wakes it (HealthKit background delivery or a background refresh). Samples an Apple Watch records usually reach the phone after waking, sometimes hours later: iOS decides when the watch syncs with the phone.
-
Open Wearables keeps one open session per writer app (the Apple Watch and iPhone count as one, an app such as Oura as another) and closes it once it is complete:
- a session with Apple Watch sleep 15 minutes after the last upload that added to it (
SLEEP_UPLOAD_QUIET_MINUTES), since the watch writes the whole night after waking; - any other session 2 hours after its last sample ended (
SLEEP_END_GAP_MINUTES), since apps writing to HealthKit can send a night over several syncs; - a night uploaded later than that as soon as it arrives.
SLEEP_SYNC_INTERVAL_SECONDS). A piece from the same source that arrives after its night was closed is merged into it; one from another source is stored as its own session. - a session with Apple Watch sleep 15 minutes after the last upload that added to it (
-
With OW scores on (
OW_SCORES_ENABLED, the default), the OW sleep score follows within about 10 minutes.
Condensed Workout Samples
HealthKit condenses the heart rate, energy and distance samples of Apple Watch workouts that are a few months old into series and deletes the originals. The SDK uploads such a series like any new sample, so Open Wearables drops it when it already holds the originals from the same Apple device; otherwise the workout would count twice. A series whose originals never reached Open Wearables, such as one condensed before the first sync, is kept as a single sample spanning its time window. Series stored before this was in place are repaired once, by a background Celery task queued when Open Wearables starts; series webhooks already sent for them are not retracted. The repair can’t be undone: a series that overwrote an original gets the original’s value back, the others are deleted. Back up the database before upgrading if you want to keep those rows. To preview it, pull the new images and run the repair with--dry-run before starting the backend: