HealthKit
PrismHealthKit provides a Sendable, actor-based wrapper around Apple’s HealthKit framework. Query health samples, compute statistics, and write data without managing HKHealthStore or HKSampleQuery directly.
Permissions
Request authorization for specific data types:Request Health Permissions
Supported Data Types
Querying Samples
Fetch individual health samples within a date range:Query Heart Rate
PrismHealthSample
Statistics
Get aggregated statistics (sum, average, min, max) over a period:Daily Step Statistics
PrismHealthStatistics
Writing Data
Save health samples to HealthKit:Save Body Mass
Observing Changes
Stream real-time updates when new samples are added:Observe Heart Rate