01Pick a registry
Every release is published to npmjs.org by GitHub Actions through OIDC Trusted Publishing, then mirrored to GitHub Packages.
npmjs.org primary
No .npmrc needed.
yarn add @solutionforest/android-health-connect
GitHub Packages mirror
Classic PAT with read:packages.
@solutionforest:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=YOUR_GITHUB_PAT
SSO orgs: if your GitHub org enforces SAML SSO,
authorize the PAT for solutionforest or installs from
GitHub Packages return 403.
02Choose a version line
Pick by your Android toolchain (Health Connect SDK, AGP), not by React Native version. Both lines need RN 0.84+.
| Line | Health Connect SDK | AGP | compileSdk | Node |
|---|---|---|---|---|
0.3.x (latest) | 1.2.0-alpha06 | ≥ 9.1.0 | 37 | ≥ 22.22 |
0.2.x (release-0.2) | 1.1.0 stable | ≥ 8.9.1 | 36 | ≥ 22.11 |
# 0.3.x — AGP 9.1+ / compileSdk 37
yarn add @solutionforest/android-health-connect@0.3.18
# 0.2.x — AGP 8.9.1+ / compileSdk 36
yarn add @solutionforest/android-health-connect@release-0.2
03Requirements for 0.3.x
| Requirement | Value |
|---|---|
| React Native | ≥ 0.84, New Architecture (TurboModules) |
| Node.js | ≥ 22.22 |
| AGP / Gradle | 9.1.0+ / 9.3.1+ |
| compileSdk | 37 |
| Android OS | API 29+. Health Connect app needed on Android 9–13, built in on 14+ |
| Expo | SDK 50+ via the config plugin |
| Platform | Android only. No iOS implementation |
04Expo
Add the config plugin to app.json and list the permissions
your app uses. On prebuild it writes them, plus the Health Connect intent
filters, into AndroidManifest.xml.
{
"expo": {
"plugins": [
"expo-dev-client",
["expo-build-properties", { "android": { "minSdkVersion": 29 } }],
[
"@solutionforest/android-health-connect",
{ "permissions": ["android.permission.health.READ_STEPS"] }
]
]
}
}
Health Connect is a native module, so it does not run in Expo Go. Build a development client instead:
npx expo install expo-dev-client expo-build-properties
npx expo prebuild --platform android
npx expo run:android
The Expo example app (Expo SDK 58, React Native 0.88) shows the full flow: availability, permission request, the last 7 days of steps, and an aggregate.
05Install the AI agent skill
The package includes skills.md, a skill file that tells
coding agents how to use this library: which version line to pick, the
hard constraints, and the availability → permissions → read order. Copy
it from node_modules so it matches the version you installed.
mkdir -p .cursor/skills/android-health-connect
cp node_modules/@solutionforest/android-health-connect/skills.md \
.cursor/skills/android-health-connect/SKILL.md
mkdir -p .claude/skills/android-health-connect
cp node_modules/@solutionforest/android-health-connect/skills.md \
.claude/skills/android-health-connect/SKILL.md
mkdir -p .agents/skills/android-health-connect
cp node_modules/@solutionforest/android-health-connect/skills.md \
.agents/skills/android-health-connect/SKILL.md
Commit the skill folder and re-copy it after upgrading. Prefer to let the agent do it? Use the copy-paste prompt, or read skills.md first.
06Alternatives
- Git:
solutionforest/AndroidHealthConnect#v0.3.18 -
Download the
GitHub Release
.tgz(ships an SPDX SBOM and build attestations) and install from path.
Next: Getting started →