React Native
Instructions for getting started using React Native for mobile onboarding with Incode. We currently support NPM and Expo.
Getting Started
Access documentation for the React Native SDK at the React Native website.
The React Native SDK is distributed through a private NPM package. Before you install it, you must have a free NPM account. Once your NPM account is set up, contact Incode and share your NPM username. We will send an invitation to join our React Native team to the email address associated with your NPM account. You must accept this invitation within 7 days to access the SDK.
Add .npmrc file to your project
An .npmrc file is used to customize the behavior of NPM distributions and configure private package access. Within the root directory of your React Native project, create an .npmrc file using the code shown here as a guide. Tokens can be obtained from NPM using these instructions .
//registry.npmjs.org/:_authToken=<your-npm-token>
//registry.npmjs.org/:username=<your-npm-username>
//registry.npmjs.org/:email=<your-email-assocated-with-your-npm-account>
Install the React Native SDK
Use the private NPM package to install the SDK using this code.
npm i @incode-sdks/react-native-incode-sdkAdditional Setup for iOS
If you are using the React Native CLI as a build tool, you must link to iOS.
Requirements
- Xcode 13+
- Git LFS
- Cocoapods 1.11 (If applicable)
- SSH authentication for Git configured on your Mac
Steps
- Change your Podfile so it requires deployment target 11 or higher.
-platform :ios, '10.0'
+platform :ios, '11.0'- To the top of your Podfile, add:
- RN >= 0.69: no changes needed
- RN < 0.69:
pod 'react-native-incode-sdk', :path => '../node_modules/@incode-sdks/react-native-incode-sdk/'
-
Using xCode, add an empty Swift file (such as Void.swift) to your native project. When prompted, choose Create Bridging header.
-
Use React Native's auto-linking to run:
cd ios && pod install cd ..- Adapt your
Info.plistwith the following:
NSCameraUsageDescription: Causes the SDK to use the device camera to verify end user identity (such as in ID scan, Selfie scan and so on).NSLocationWhenInUseUsageDescription: Causes the SDK to use the device's current user location to detect exact location for Geolocation.NSMicrophoneUsageDescription: Causes the SDK to use the device microphone for performing a video call (for example, during Video Conference or for speech recognition during Video Selfie).
- Go to your project's Target > Build Settings > Other Linker Flags and add these flags:
$(inherited) -all_load -ObjC -l “stdc++” -l “iconv”
Additional setup for Android
If you are using the React Native CLI as a build tool, configure these settings in your app's build.gradle file
-
Change your
minSdkVersionto 21 or higher. -
Set
compileSdkVersionto 33 or higher. -
Add this dependency:
dependencies {
+ implementation 'com.incode.sdk:core-light:2.6.2'
}
- Verify that your application has multidex support enabled. Your
Applicationclass should now be able to extendMultiDexApplication. Refer to these code samples as needed.
defaultConfig {
...
+ multiDexEnabled true
...
} dependencies {
...
+ implementation 'com.android.support:multidex:1.0.3'
...
}
+ import androidx.multidex.MultiDexApplication;
+ public class MyApplication extends MultiDexApplication implements ReactApplication {
...
}- Modify your project's
build.gradleso it contains the GitHub Packages username and password that has been provided by Incode.
IMPORTANT
Support for Artifactory distribution ended September 19th, 2025. Migration to GitHub Packages is required to ensure uninterrupted access to the SDK.
allprojects {
repositories {
...
+ jcenter()
+ maven {
+ url "https://maven.pkg.github.com/Incode-Technologies-Example-Repos/android-omni-packages"
+ credentials {
+ username = "incode-customers"
+ password = "GITHUB_PACKAGE_TOKEN"
+ }
+ }
...
}
}Expo Installation
If you are using Expo as a build tool, you can install the SDK using the Expo CLI. Ensure you have configured an .npmrc file to access our private React Native SDK.
//registry.npmjs.org/:_authToken=<your-npm-token>
//registry.npmjs.org/:username=<your-npm-username>
//registry.npmjs.org/:email=<your-email-assocated-with-your-npm-account>
- Install the React Native SDK.
npx expo install @incode-sdks/react-native-incode-sdk- Install the configuration plugin.
npx expo install @incode-sdks/expo-incode-sdk-configuration- Integrate and configure this plugin. Update the 'plugins' field in app.json file:
{
"expo": {
"plugins": [
[
"@incode-sdks/expo-incode-sdk-configuration",
{
"artifactoryUserName": "incode-customers",
"artifactoryPassword": "your_githubpackage_token"
}
]
]
}
}Updated 11 days ago
