diff --git a/README.md b/README.md index 2e91698..b01a0c7 100644 --- a/README.md +++ b/README.md @@ -123,6 +123,11 @@ export default function App() { ### Documentation +#### SDK functions: + +[initializeHealth](./docs/initializeHealth.md) +[isAvailable](./docs/isAvailable.md) + #### Data functions: [read](./docs/read.md) diff --git a/docs/initializeHealth.md b/docs/initializeHealth.md new file mode 100644 index 0000000..82e210f --- /dev/null +++ b/docs/initializeHealth.md @@ -0,0 +1,19 @@ +# `initializeHealth` Function + +The `initializeHealth` function sets up health integration for the application by requesting necessary permissions based on the platform (iOS or Android). + +It accepts a `permissions` object with keys `read` and `write`. Use the `HealthLinkPermissions` enum to add permissions to the arrays. + +Write method does not support `BloodPressure`, `RestingHeartRate` and `OxygenSaturation`, so I'd recommend not to ask for write permissions for those data types. + +--- + +## **Example Usage** + +```typescript +const permissions = { + read: [HealthLinkPermissions.StepCount, HealthLinkPermissions.HeartRate], + write: [HealthLinkPermissions.StepCount], +}; +await initializeHealth(permissions); +``` diff --git a/docs/isAvailable.md b/docs/isAvailable.md new file mode 100644 index 0000000..cab4862 --- /dev/null +++ b/docs/isAvailable.md @@ -0,0 +1,9 @@ +# `isAvailable` Function + +## The `isAvailable` function returns a `true` if the SDK is available on the current platform, `false` otherwise. + +## **Example Usage** + +```typescript +const available = await isAvailable(); +```