Guides

Install Sahha SDK

Learn how to seamlessly integrate the Sahha SDK into your web or mobile project and start getting meaningful behavioral, physical and mental health insights for your customers.

Choose your platform:


iOS

Step 1) Install Library

Choose how you would like to install the Sahha library into your Xcode project.

You can opt to use either the Swift Package Manager or CocoaPods.


Option A) Using Swift Package Manager

Add the Sahha swift package to your project's package dependencies.

View Sahha Swift SDK on GitHub

https://github.com/sahha-ai/sahha-swift

Option B) Using CocoaPods

Add the Sahha pod to your project's pod dependencies.

View Sahha Swift SDK on CocoaPods

Install CocoaPods

Visit CocoaPods to learn how to install CocoaPods.

Step 1) Add the Sahha pod to your project's Podfile.
pod 'Sahha'
Step 2) Run pod install from the Terminal app in your project root folder.
$ pod install

Step 2) Import Module

After you have installed the Sahha library, import the Sahha module into any files inside your project that use the SDK.

import Sahha

Android

Learn how to integrate the Sahha SDK into your Android project.


Step 1) Add Repository

Add the repository to your project's Settings.gradle.

repositories {
mavenCentral()
}

Step 2) Add Implementation

Add the Sahha SDK implementation to your project's dependencies in Build.gradle.

View Sahha Android SDK on GitHub

dependencies {
...
implementation 'ai.sahha:sahha-android:+'
...
}

Step 3) Import Module

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

import sdk.sahha.android.source.*

Flutter

Learn how to integrate the Sahha SDK into your Flutter project


Step 1) Add Flutter Package Dependency

Add sahha_flutter as a dependency in your pubspec.yaml file.

View Sahha Flutter SDK on PubDev

dependencies:
flutter:
sdk: flutter
sahha_flutter:
git:
url: git://github.com/sahha-ai/sahha_flutter.git

Step 2) Install Flutter Package

Run flutter pub get inside the root folder of your Flutter project.

$ flutter pub get

Step 3) 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

Step 4) Import Sahha Package

Import the sahha_flutter package into any files inside your Flutter project that use the SDK.

import 'package:sahha_flutter/sahha_flutter.dart';

React Native

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.

View Sahha React Native SDK on NPM

$ 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 CocoaPods 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

Step 3) 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