How does the new Mental Health API work?
Generated on 8/5/2024
1 search
The new Mental Health API, introduced in the session Explore wellbeing APIs in HealthKit, allows developers to integrate mental health features into their apps using HealthKit. Here are the key points about how it works:
-
Logging State of Mind: Users can log their state of mind from their Apple Watch or the Health app, making it easy to check in at any point in the day. This helps users keep track of their mental wellbeing.
-
Standardized Questionnaires: The API supports standardized questionnaires like the GAD-7 for anxiety and the PHQ-9 for depression. These questionnaires are widely used by clinicians for mental health screening. Developers can read and write the results of these questionnaires, allowing users to track the efficacy of treatments or save results from their doctor's office.
-
State of Mind API: This API includes four parameters:
- Feeling Kind: Represents either a daily mood or a momentary emotion.
- Valence: A self-reported measure of how good or bad someone is feeling, on a scale from -1 (very poor) to +1 (very good).
- Labels: Descriptive terms like "passionate," "overwhelmed," and "relieved" to fully represent someone's state of mind.
- Associations: Describes the cause of a feeling, with options like "family," "identity," and "work."
-
Integration and Use Cases: The API is designed to be integrated into various types of apps, not just those focused on mental wellbeing. For example, it can be used in journaling apps to provide personalized state of mind suggestions or in apps that visualize how someone spends their time, associating events with how they felt during those times.
For a detailed dive into the API, you can watch the session Explore wellbeing APIs in HealthKit.
Get started with HealthKit in visionOS
Discover how to use HealthKit to create experiences that take full advantage of the spatial canvas. Learn the capabilities of HealthKit on the platform, find out how to bring an existing iPadOS app to visionOS, and explore the special considerations governing HealthKit during a Guest User session. You’ll also learn ways to use SwiftUI, Swift Charts, and Swift concurrency to craft innovative experiences with HealthKit.
Explore wellbeing APIs in HealthKit
Learn how to incorporate mental health and wellbeing into your app using HealthKit. There are new APIs for State of Mind, as well as for Depression Risk and Anxiety Risk. We’ll dive into principles of emotion science to cover how reflecting on feelings can be beneficial, and how State of Mind can be used to represent different types of mood and emotion.