react-native-rook-sdk
v5.1.0
Published
Extract health data from health connect, apple health and samsung health to transform to a RookScore
Readme
react-native-rook-sdk
Purpose
This repo exposes the ROOK mobile SDKs to React Native APPs so they can configure ROOK, request permissions, read on-device health data, trigger sync flows, and manage API data_source connections on iOS and Android.
The same paragraph lives in foundations/purpose.md. Foundations is the source of truth.
Context
Read these before changing anything:
foundations/, the purpose, requirements, glossary, user stories, and AGENTS.md that govern this repo.service-manifest.yaml, the machine-readable inventory of components, dependencies, and public documentation links.docs/CONTEXT.md, the architecture diagram and data flow narrative for the SDK.
If you are an AI agent, read foundations/AGENTS.md first.
Top related repos:
- Upstream: none verified in this repo today; owner confirmation pending.
- Downstream: host React Native APP repos that integrate this package.
- Sibling: the underlying ROOK native SDK repos or package sources; exact repo mapping pending owner confirmation.
- Shared infra:
docs.tryrook.iofor public React Native SDK documentation.
If you change an exported API, permission flow, or native dependency, update the manifest and the example APP in the same PR.
Architecture
The SDK has three main layers:
- A TypeScript surface that exports
RookSdk,RookSyncGate, anduseRook*hooks fromsrc/. - An iOS bridge in
ios/backed by theRookSDKpod. - An Android bridge in
android/backed by ROOK Health Connect, Samsung Health, and API Sources libraries.
See docs/CONTEXT.md for the Mermaid diagram and flow details.
Tech stack
- TypeScript, React Native, Turbo Modules, and npm workspaces.
- Kotlin for the Android bridge and Swift or Objective-C++ for the iOS bridge.
- Jest for unit tests.
- GitHub Actions for CI.
react-native-builder-bobfor package builds.- Public package distribution through npm.
Setup
Prerequisites:
- Node.js
v22.20.0from.nvmrc. - npm and the Node.js version from
.nvmrc(v22.20.0). - JDK 17 for Android builds.
- Xcode 16.3 and CocoaPods for iOS builds.
Local install:
npm install
cd example
bundle install
bundle exec pod install --project-directory=ios
cd ..Run
Use the example APP for manual validation:
npm run example -- start
npm run example -- android
npm run example -- iosThe example APP currently mounts AndroidStep in example/src/App.tsx. To validate a different hook or flow, switch the mounted screen first.
Test
npm run lint
npm run typecheck
npm test -- --coverage
npm run prepareCI also builds the example APP for Android and iOS through Turbo tasks defined in the repo workflow.
Coverage threshold for this repo: 60 percent on new code per the current SonarCloud Stage A target in the playbook. Current repo reality is lower because only src/__tests__/index.test.tsx exists today as a placeholder, so meaningful test work is still pending.
Endpoints
This repo does not expose an HTTP API or an OpenAPI contract. It is an SDK package.
Configuration
The main runtime inputs come from RookSyncGate and NativeRookSdk:
environment:sandboxorproduction.clientUUID: ROOK client identifier.secret: ROOK client secret.bundleId: iOS host APP bundle identifier.packageName: Android host APP package name.enableLogs: opt-in local logging.enableBackgroundSync: background sync toggle for supported flows.
Do not commit real credentials. Keep secrets in local development tooling only.
Deployment
This repo is published as a versioned npm package. Release automation is configured through release-it, and CI in .github/workflows/ci.yml validates lint, typecheck, Jest coverage, package build, and example APP builds before merge.
Operational notes
README.mdwas previously a generated placeholder and did not describe the real exported API.- The test command is wired in CI, but the current suite is not representative of the SDK surface yet.
- The repo still contains Yarn workspace metadata, but this documentation now uses
npmcommands by convention. - Android
initRookmapsenvironment=productionto production for Health Connect and API Sources, but Samsung still uses sandbox inandroid/src/main/java/com/rooksdk/RookSdkModule.kt; owner confirmation is still needed before that behavior is treated as intentional. - Public docs are referenced from code at
docs.tryrook.io, but the full page inventory still needs owner confirmation.
Owners
Current inferred owner from package metadata:
- Javier Villanueva,
[email protected]
Tech lead and CODEOWNERS still need explicit confirmation in repo-profile.yaml and service-manifest.yaml.
Related
CONTRIBUTING.mdfoundations/docs/CONTEXT.mdservice-manifest.yamlhttps://docs.tryrook.io/docs/category/reactnative
License
MIT
