Skip to content

StanfordSpezi/SpeziSensorKit

Spezi SensorKit

Build and Test codecov DOI

Interact with SensorKit in your Spezi app.

Overview

The Spezi SensorKit module enables apps to integrate with Apple's SensorKit system, such as requesting authorization, setting up background data collection, and fetching collected samples.

Example

import SpeziSensorKit

let sensor = Sensor.heartRate
let devices = try await sensor.fetchDevices()
for device in devices {
    let results = try await sensor.fetch(from: device, mostRecentAvailable: .days(2))
    for sample in results {
        print(sample.timestamp, sample.value, sample.confidence)
    }
}

For more information, please refer to the API documentation.

The Spezi Template Application

The Spezi Template Application provides a great starting point and example using the SpeziSensorKit module.

Contributing

Contributions to this project are welcome. Please make sure to read the contribution guidelines and the contributor covenant code of conduct first.

License

This project is licensed under the MIT License. See Licenses for more information.

Spezi Footer Spezi Footer