@authenticalls/react-native-kyc-sdk
v2.0.8
Published
`@authenticalls/react-native-kyc-sdk` is a React Native SDK that provides a secure user identity verification modal. It integrates with `react-native-vision-camera`, `react-native-reanimated`, and other dependencies to ensure a smooth scanning experience.
Downloads
13
Readme
Authenticalls App SDK
@authenticalls/react-native-kyc-sdk is a React Native SDK that provides a secure user identity verification modal. It integrates with react-native-vision-camera, react-native-reanimated, and other dependencies to ensure a smooth scanning experience.
🚀 Features
- 🔒 User Identity Verification
- 📸 Camera-based scanning
- 🌍 Supports multiple languages (
en,ro,fr) - 🔄 Timeout handling and max failure attempts
- 🎯 Customizable verification process
📦 Installation
1️⃣ Install the SDK
Run the following command in your React Native project:
npm install @authenticalls/react-native-kyc-sdkConfiguration
1. Make sure babel.config.js includes react-native-worklets-core and react-native-reanimated plugins:
module.exports = {
presets: ['module:@react-native/babel-preset'],
plugins: [
[
'react-native-reanimated/plugin',
{
processNestedWorklets: true,
},
],
['react-native-worklets-core/plugin'],
],
};2. Fonts:
module.exports = {
assets: ['./src/components/AuthenticallsModal/src/assets/fonts/']
};3. Request Camera Permissions
Ensure your app has permission to access the camera. Add the following to your AndroidManifest.xml (for Android):
<uses-permission android:name="android.permission.CAMERA"/>
<!-- For Android 13+ (API 33+) -->
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />For iOS, update Info.plist:
<key>NSCameraUsageDescription</key>
<string>AuthenticallsApp would like to access your camera.</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>AuthenticallsApp would like to access your location.</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>AuthenticallsApp would like to access your photo library to save captured photos.</string>🚀 Usage
Import and use the component in your project:
import AuthenticallsSDK from '@authenticalls/react-native-kyc-sdk';
<AuthenticallsModal
user={{
country: 'RO',
documentNumber: 'DOCUMENT NUMBER',
documentType: 'DOCUMENT TYPE',
firstName: 'FIRST NAME',
lastName: 'LAST NAME',
}}
apiKey="API_KEY"
lang="en"
maxFailures={2}
timeout={90000} // in milliseconds
visible={boolean}
onClose={handleClose}
/>📖 Component Props
🔹 <AuthenticallsSDK /> Props
| Prop | Type | Required | Description |
|-------------|------------------------------|----------|-------------|
| user | { country: string; documentNumber: string; documentType: string; firstName: string; lastName: string; } | ✅ Yes | User information for verification. |
| apiKey | string | ✅ Yes | API key for authentication. |
| lang | "en" \| "ro" \| "fr" | ✅ Yes | Language of the UI ("en" = English, "ro" = Romanian, "fr" = French). |
| maxFailures | number | ✅ Yes | Max attempts before redirecting to manual review. |
| timeout | number (milliseconds) | ✅ Yes | Request timeout duration (e.g., 90000 = 90 seconds). |
| visible | boolean | ✅ Yes | Whether the modal is visible or not. |
| onClose | (result?: { status: "PENDING" \| "REJECTED" \| "APPROVED"; validationID?: string }) => void | ✅ Yes | Callback when verification completes. May return status and validationID, or void if verification wasn't triggered. |
🏗️ Building the SDK on Android:
Installation:
npm install
cd android
./gradlew clean
./gradlew build
npm start --reset-cache // then press 'a' to start androidBuild example:
npx react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res && cd android && ./gradlew assembleReleaseExample of android versions used gradle.build:
buildscript {
ext {
buildToolsVersion = "34.0.0"
minSdkVersion = 26
compileSdkVersion = 34
targetSdkVersion = 34
ndkVersion = "26.1.10909125"
kotlinVersion = "1.9.24"
}
repositories {
google()
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle")
classpath("com.facebook.react:react-native-gradle-plugin")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin")
}
}
apply plugin: "com.facebook.react.rootproject"🛠️ Troubleshooting
Android
gradle.properties:
hermesEnabled=true
# Can be set to false to disable the build setup
VisionCamera_enableFrameProcessors=true
# Can be set to false to avoid including the full 2.4 MB MLKit dependency
VisionCamera_enableCodeScanner=truegradle-wrapper.properties:
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-all.zip- Clean all
rm -rf node_modules
rm -rf package-lock.json
rm -rf ~/Library/Developer/Xcode/DerivedData/*
rm -rf android/.cxx
rm -rf android/.gradle
rm -rf android/build
./gradlew --stop // stop gradlew daemons - can lead to build errors if there are more than 1 deamon active
watchman watch-del-all // clear all watches - sometimes can lead to build errors- Install
npm install // or npm install --legacy-peer-deps if using newer version of node
cd android
./gradlew clean
./gradlew buildiOS
- Clean all
rm -rf ~/Library/Caches/CocoaPods
cd ios
rm -rf Pods Podfile.lock
pod installMake sure that the mininum version used is 15.6 in ios/Podfile
platform :ios, '15.6'