Add Passage
Add Passage to your React Native app
Prerequisites
- React Native development environment setup (learn more here)
- A Passage app.
If you don’t already have a React Native project and just want to try out Passage, consider cloning our React Native Example App.
Install
You can install Passage React Native with npm or yarn:
Via NPM
npm i --save @passageidentity/passage-react-nativeVia yarn
yarn add @passageidentity/passage-react-nativeiOS cocoapod
For non-Expo apps:
cd ios && pod installImport
To access Passage methods, import the package.
import { Passage } from '@passageidentity/passage-react-native';Expo configuration
Add your associated domain to your .env:
ASSOCIATED_DOMAIN=example.comAdd the plugin in your app.json:
{
"expo": {
"plugins": ["@passageidentity/passage-react-native"]
}
}Run expo prebuild:
npx expo prebuildReact Native (non-Expo) configuration
** Native Android configuration (non-Expo) **
Follow the Android cross platform configuration guide.
** Native iOS configuration (non-Expo) **
Follow the iOS cross platform configuration guide.