Install Sahha SDK for React Native
Set up your platform projects and add the Sahha SDK to your React Native app.
Prerequisites
Your project must support:
- iOS: iOS 15 or above, Swift 5 or above
- Android: compileSdk 36 or above, Kotlin 1.9.24 or above — see full Android requirements
Set Up Platform Projects
React Native apps target both iOS and Android, so you need to complete the platform-specific setup for each. These guides cover Xcode capabilities, manifest permissions, and everything your project needs before the SDK can collect health data.
Enable HealthKit, background delivery, background processing, and add usage descriptions in Xcode
Add Health Connect permissions to your AndroidManifest.xml
Install the Library
Install the sahha-react-native package from npm:
View Sahha React Native SDK on npm
$ npm i sahha-react-native $ npm i sahha-react-native
Install the native iOS pod
Install CocoaPods
You need CocoaPods to install the native iOS library. Visit CocoaPods to install it if you don't have it yet.
$ cd ios && pod install && cd .. $ cd ios && pod install && cd ..
Import the Module
Import Sahha in any file where you use the SDK:
import Sahha, { SahhaEnvironment, SahhaSensor } from 'sahha-react-native'; import Sahha, { SahhaEnvironment, SahhaSensor } from 'sahha-react-native';
Next Steps
Continue to Step 2) Configure Settings to set your environment and notification preferences.