enroll-react-native
v1.0.3
Published
eNROLL SDK plugin for React Native — eKYC identity verification for Android and iOS
Maintainers
Readme
eNROLL React Native Plugin
React Native plugin for the eNROLL SDK — full-featured eKYC identity verification for React Native apps on Android and iOS.
eNROLL is a compliance solution that prevents identity fraud and phishing. Powered by AI, it reduces errors and speeds up identification, ensuring secure verification. This is the standard eNROLL SDK variant with full theme and icon customization on Android and color theming on iOS.
Supports both the Old Architecture (Bridge) and New Architecture (TurboModules).
Full feature parity with the Capacitor plugin.
Current native SDK versions:
- Android: eNROLL-Android v1.5.22 (via JitPack) + Innovatrics biometrics
- iOS: EnrollFramework ~> 3.0.7 (via CocoaPods)
Requirements
| Platform | Minimum | |----------|---------| | React Native | >= 0.71.0 | | Android minSdk | 24 | | Android compileSdk | 34 | | iOS deployment target | 13.0 | | Kotlin | 2.0+ | | Swift | 5.0 | | Node.js | 18+ |
Installation
npm install enroll-react-native
# or
yarn add enroll-react-nativeAndroid Setup
1. Add Repositories
Add the JitPack and Innovatrics repositories to your project-level android/build.gradle (or android/settings.gradle):
allprojects {
repositories {
google()
mavenCentral()
maven { url 'https://jitpack.io' }
maven { url 'https://maven.innovatrics.com/releases' }
}
}2. Add Innovatrics License File
Place the iengine.lic file (from your Innovatrics/LuminSoft account) at:
android/app/src/main/res/raw/iengine.licWithout this file, biometric features (face liveness, document scanning, ePassport NFC) will fail at runtime.
3. Verify minSdkVersion
Ensure minSdkVersion is at least 24 in your project-level android/build.gradle:
ext {
minSdkVersion = 24
kotlinVersion = "2.0.21"
}iOS Setup
1. Configure Podfile
Add the required pod sources and enable frameworks at the top of your ios/Podfile:
source 'https://github.com/LuminSoft/eNROLL-iOS-specs.git'
source 'https://github.com/innovatrics/innovatrics-podspecs.git'
source 'https://cdn.cocoapods.org/'
platform :ios, '15.0'
use_frameworks!
use_modular_headers!2. Add Innovatrics License File
Place the iengine.lic file at ios/YourApp/iengine.lic, then add it to your Xcode project:
- Open
ios/YourApp.xcworkspacein Xcode - Drag
iengine.licinto the App group - Ensure "Copy items if needed" is checked and the target is selected
Without this file, biometric features will fail at runtime.
3. Add Info.plist Permissions
Add to ios/YourApp/Info.plist:
<key>NSCameraUsageDescription</key>
<string>We need camera access to capture your ID and face for verification</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>We need your location for security compliance</string>4. Install Pods
cd ios && pod installNote: Core iOS verification flows should be tested on a physical device. Even when a simulator build succeeds, camera, NFC, provisioning, and license-bound behavior are only reliable on real hardware.
ePassport / NFC (Optional — iOS only)
If you need electronic passport NFC reading:
- Add the permission message to
Info.plist:
<key>NFCReaderUsageDescription</key>
<string>We need NFC access to read your electronic passport</string>In Xcode, open Target → Signing & Capabilities and add Near Field Communication Tag Reading.
Add the NFC entitlement to your app target entitlements file:
<key>com.apple.developer.nfc.readersession.formats</key>
<array>
<string>TAG</string>
</array>
<key>com.apple.developer.nfc.readersession.iso7816.select-identifiers</key>
<array>
<string>A0000002471001</string>
<string>A0000002472001</string>
</array>Build on a physical iPhone. NFC does not work in the simulator.
Make sure your Apple team / provisioning profile includes the NFC capability.
If you are running this repository's example app on your own device, use a bundle identifier that belongs to your Apple team and matches your iengine.lic. The helper script supports:
IOS_BUNDLE_ID=com.yourcompany.EnrollExample IOS_DEVELOPMENT_TEAM=YOURTEAMID ./scripts/run-example-ios.shUsage
Basic Example
import {
startEnroll,
addRequestIdListener,
type StartEnrollOptions,
} from 'enroll-react-native';
// Listen for request ID events (fires mid-flow)
const subscription = addRequestIdListener((event) => {
console.log('Request ID:', event.requestId);
});
try {
const result = await startEnroll({
tenantId: 'YOUR_TENANT_ID',
tenantSecret: 'YOUR_TENANT_SECRET',
enrollMode: 'onboarding',
enrollEnvironment: 'staging',
localizationCode: 'en',
skipTutorial: false,
});
console.log('Success! Applicant ID:', result.applicantId);
console.log('Exit step completed:', result.exitStepCompleted);
} catch (error) {
console.error('Enrollment failed:', error);
} finally {
subscription.remove();
}Authentication Mode
const result = await startEnroll({
tenantId: 'YOUR_TENANT_ID',
tenantSecret: 'YOUR_TENANT_SECRET',
enrollMode: 'auth',
applicationId: 'APPLICATION_ID',
levelOfTrust: 'LEVEL_OF_TRUST_TOKEN',
});Sign Contract Mode
const result = await startEnroll({
tenantId: 'YOUR_TENANT_ID',
tenantSecret: 'YOUR_TENANT_SECRET',
enrollMode: 'signContract',
templateId: '12345',
contractParameters: '{"key": "value"}',
});Enroll Modes
| Mode | Description | Required Params |
|------|-------------|-----------------|
| onboarding | Register a new user | tenantId, tenantSecret |
| auth | Authenticate existing user | + applicationId, levelOfTrust |
| update | Re-verify / update user | + applicationId |
| signContract | Sign contract templates | + templateId |
Configuration Options
| Key | Type | Required | Default | Description |
|-----|------|----------|---------|-------------|
| tenantId | string | ✅ | — | Organization tenant ID |
| tenantSecret | string | ✅ | — | Organization tenant secret |
| enrollMode | EnrollMode | ✅ | — | SDK flow mode |
| applicationId | string | mode-dep | — | Application ID (required for auth, update) |
| levelOfTrust | string | mode-dep | — | Level-of-trust token (required for auth) |
| templateId | string | mode-dep | — | Contract template ID (required for signContract) |
| enrollEnvironment | EnrollEnvironment | | 'staging' | Target environment |
| localizationCode | EnrollLocalization | | 'en' | UI language |
| googleApiKey | string | | — | Google Maps API key for location step |
| skipTutorial | boolean | | false | Skip the tutorial screen |
| correlationId | string | | — | Link your user ID with eNROLL request ID |
| requestId | string | | — | Resume a previous enrollment request |
| contractParameters | string | | — | JSON string of contract parameters |
| enrollTheme | EnrollTheme | | — | Unified theme (colors + icons) |
| appColors | EnrollColors | | — | Color overrides (deprecated — use enrollTheme.colors) |
| enrollForcedDocumentType | EnrollForcedDocumentType | | — | Force specific document type |
| enrollExitStep | EnrollStepType | | — | Auto-close SDK after this step |
Success Result
| Field | Type | Description |
|-------|------|-------------|
| applicantId | string | Assigned applicant ID |
| enrollMessage | string? | Human-readable success message |
| documentId | string? | Document ID (if applicable) |
| requestId | string? | Request ID for resuming later |
| exitStepCompleted | boolean | true if flow ended early via enrollExitStep |
| completedStepName | string? | Name of the completed exit step |
Theme Customization
The eNROLL SDK supports full theme customization via enrollTheme. Colors work on both Android and iOS. Icons are Android only.
Colors
await startEnroll({
// ...required params...
enrollTheme: {
colors: {
primary: { r: 29, g: 86, b: 184, opacity: 1.0 },
secondary: { r: 87, g: 145, b: 219 },
appBackgroundColor: { r: 255, g: 255, b: 255 },
textColor: { r: 0, g: 65, b: 148 },
errorColor: { r: 219, g: 48, b: 91 },
successColor: { r: 97, g: 204, b: 61 },
warningColor: { r: 249, g: 213, b: 72 },
},
},
});Icons (Android only)
Icon assetName values correspond to Android drawable resource names in your app's res/drawable folder.
await startEnroll({
// ...required params...
enrollTheme: {
icons: {
logo: { mode: 'custom', assetName: 'my_company_logo', renderingMode: 'original' },
location: {
tutorial: { assetName: 'ic_location_tutorial' },
requestAccess: { assetName: 'ic_location_access' },
},
nationalId: {
tutorial: { assetName: 'ic_nid_tutorial', renderingMode: 'template' },
},
},
},
});Available icon groups: logo, location, nationalId, passport, phone, email, faceMatching, securityQuestions, password, signature, common, update, forget.
Enrollment Step Types
Used with enrollExitStep to terminate the flow after a specific step:
phoneOtp · personalConfirmation · smileLiveness · emailOtp · saveMobileDevice · deviceLocation · password · securityQuestions · amlCheck · termsAndConditions · electronicSignature · ntraCheck · csoCheck
Platform Limitations
| Feature | Android | iOS | |---------|---------|-----| | Color theming | ✅ | ✅ | | Icon customization | ✅ | ❌ (planned) | | Biometric SDK (Innovatrics) | ✅ | ✅ | | Simulator support | ✅ (emulator) | ❌ (device only) |
Security Notes
- Never hardcode
tenantSecret,levelOfTrust, or API keys in client-side code. - Use secure storage (Keychain on iOS, Keystore on Android).
- Rooted/jailbroken devices are blocked by default.
- All SDK network calls use HTTPS.
- Regularly update the plugin to the latest stable version.
License
MIT
