android-health-connect
npm GitHub
Docs · Install

Install

Same package name on both registries: @solutionforest/android-health-connect. Use npmjs unless your org already consumes GitHub Packages.

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.

terminal
yarn add @solutionforest/android-health-connect

GitHub Packages mirror

Classic PAT with read:packages.

.npmrc
@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+.

LineHealth Connect SDKAGPcompileSdkNode
0.3.x (latest)1.2.0-alpha06≥ 9.1.037≥ 22.22
0.2.x (release-0.2)1.1.0 stable≥ 8.9.136≥ 22.11
terminal
# 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

RequirementValue
React Native≥ 0.84, New Architecture (TurboModules)
Node.js≥ 22.22
AGP / Gradle9.1.0+ / 9.3.1+
compileSdk37
Android OSAPI 29+. Health Connect app needed on Android 9–13, built in on 14+
ExpoSDK 50+ via the config plugin
PlatformAndroid 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.

app.json
{
  "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:

terminal
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.

terminal
mkdir -p .cursor/skills/android-health-connect
cp node_modules/@solutionforest/android-health-connect/skills.md \
  .cursor/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 →