Integrating Sahha

React Native Integration

Learn how to integrate the Sahha SDK into your React Native project


Step 1) Install NPM package

Install the sahha-react-native NPM Package inside the root folder of your React Native project.

$ npm i sahha-react-native

Step 2) Setup iOS Project

Follow these additional steps to install the Sahha SDK in your iOS project.

Install CocoaPods

You will need to install CocoaPoads before you can install the Sahha SDK to your iOS project.

Visit Cocoapods to learn how to install CocoaPods.


Install Sahha Pod

Run pod install from the Terminal app in your project root folder.

$ pod install

Xcode Project Settings

Setup Xcode

You will need to edit your Xcode project settings to enable the Sahha SDK.

View the Xcode Project Settings in the iOS-installation guide to configure


Step 3) Setup Android Project

Android Sensor Permissions

You will need to add sensor permissions for the Sahha SDK in your Android project.

View the SDK Integration guide for Android .


Step 4) Import Sahha Module

Import the Sahha module into any files inside your React Native project that use the SDK.

import { Sahha } from 'sahha-react-native';

Using Sahha in an Expo Project

This section is for developers using Expo to run their React Native project.

The Sahha SDK can be used inside an Expo project

In order to use native platform code for Android and iOS, you will need to convert your Expo Go project to an Expo development build.

Visit the Expo documentation to learn how to create development builds.


Step 1) (Optional) Create Expo project

If you don't have an Expo project, create one.

Use the command npx create-expo-app "ProjectName".

npx create-expo-app MyExpoProject

Step 2) Go to Expo project folder

Go to your project folder.

Use the command cd ProjectName.

cd MyExpoProject

Step 3) (Optional) Install Expo modules

You can optionally add Expo to an existing React Native project.

Visit the Expo documentation to learn how to add Expo to an existing React Native project.

Use the command npx install-expo-modules@latest inside your project folder.

npx install-expo-modules@latest

Step 4) (Optional) Install Expo dev client

If you are starting a new React Native project, you will need to install the Expo dev client.

Use the command npx expo install expo-dev-client inside your project folder.

npx expo install expo-dev-client

Step 5) Install Sahha SDK

Install the Sahha SDK as an npm package.

Use the command npm i sahha-react-native inside your project folder.

npm i sahha-react-native

Step 6) Add the iOS platform to your project

If your app uses iOS, you will need to add the iOS platform to your project.

Use the command npx expo run:ios -d inside your project folder.

npx expo run:ios -d

After you've added the iOS platform to your project, follow these steps to complete iOS setup.


Step 7) Add the Android platform to your project

If your app uses Android, you will need to add the Android platform to your project.

Use the command npx expo run:ios -d inside your project folder.

npx expo run:android -d

Step 8) Browse the Sahha Expo demo app

We've provided a demo app to show how to setup the Sahha SDK inside an Expo development build.

Sahha Expo demo app