# How do I Integrate a Passio SDK in EXPO?

### Step 1:

if you are currently using `yarn 1.22.0+` version, then follow the steps below:

add `.npmrc` file at the root level of your project

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

### _OR_

If you are currently using `yarn 4+` version, then follow the steps below:

add `.yarnrc` file at the root level of your project

```javascript
nodeLinker: node-modules
npmScopes:
  passiolife:
    npmRegistryServer: "https://npm.pkg.github.com"
    npmAuthToken: "YOUR_GITHUB_TOKEN"
yarnPath: .yarn/releases/yarn-4.3.1.cjs

```

### Step 2:

```typescript
yarn add @passiolife/nutritionai-react-native-sdk-v3 
```

### Step 3:

```typescript
npx expo prebuild -- clean
```

## **IOS**

```
cd ios && pod install && cd ..
```

* please double-check that pod install was run in the ios directory and that all pods were installed correctly.

```
yarn ios
```

## **Android**

```
yarn add expo-build-properties
```

Open `app.json` and add `minSdkVersion`  in plugins -> expo-build-properties -> android

```
 "plugins": [
     ...,
      [
        "expo-build-properties",
        {
          "android": {
            "minSdkVersion": 26
          }
        }
      ]
    ],
```

```javascript
yarn android
```

## 🚀 Happy coding ...

## Reference

GITHUB: [https://github.com/Passiolife/RN-Expo-Nutrition-Reference-App](https://github.com/Passiolife/RN-Expo-Nutrition-Reference-App)

## Troubleshooting:

`ERROR PassioSDK Error: TypeError: Cannot read property 'configure' of null`

->  Make sure to run the project after completing the prebuild and pod install steps, or ensure that you're running the project from an Expo rebuild.

```typescript
Step 1:  
npx expo prebuild --clean

Step 2:
cd ios && pod install && cd ..

Step 3:  
yarn ios
```

