Installation

1. Create a Github Personal Access Token (classic) with read:packages access selected.

2. Create an .npmrc file in the root of your project with the following lines replacing GITHUB_ACCESS_TOKEN with the token you've created.

//npm.pkg.github.com/:_authToken=GITHUB_ACCESS_TOKEN
@passiolife:registry=https://npm.pkg.github.com

3. Add the Passio SDK dependency to your package.json and run npm install or yarn.

npm install @passiolife/nutritionai-react-native-sdk-v2 

or

yarn add @passiolife/nutritionai-react-native-sdk-v2

4. Ensure the native dependencies are linked to your app.

For iOS, run pod install.

cd ios; pod install

If pod install is failed with error message Specs satisfying the ReactNativePassioSDK (from ../node_modules/@passiolife/nutritionai-react-native-sdk-v2) dependency were found, but they required a higher minimum deployment target. , ensure Podfile is configured with minimum ios version '13.0'

platform :ios, '13.0'

For Android, add this implementation line to the dependencies section on app/build.gradle file.

dependencies {
    // Add this line below for Passio SDK library
    implementation files("$rootDir/../node_modules/@passiolife/nutritionai-react-native-sdk-v2/android/libs/passiolib-release.aar")
    ...
}

Also for Android, make sure the android project is configured with minSdkVersion 26 or above (check the project's build.gradle file).

buildscript {
    ext {
        ...
        minSdkVersion = 26
        ...
    }
}

If at any point you need help from the Passio team, please reach out to us at support@passiolife.com

Last updated