SDK React Native
The React Native SDK provides a wrapper around the Checker SDK
The React Native SDK provides a wrapper around the Checker SDK, supporting both iOS and Android platforms with native bridge implementation.
Installation
Step 1: Install Dependencies
npm install react-native-identity-kyc react-native-webview --save
or
yarn add react-native-identity-kyc react-native-webview
Step 2: iOS Setup
cd ios && pod install && cd ..
Step 3: Configure Permissions
Android - Add to android/app/src/main/AndroidManifest.xml:
iOS - Add to ios/YourApp/Info.plist:
NSPhotoLibraryUsageDescription
App needs access to photo library for profile images
NSCameraUsageDescription
To capture profile photo please grant camera access
NSMicrophoneUsageDescription
To record audio for verification
Expo - Add to app.json:
{
"expo": {
"plugins": \[
[
"expo-camera",
{
"cameraPermission": "Allow $(PRODUCT_NAME) to access camera for verification"
}
]
],
"android": {
"permissions": [
"CAMERA",
"RECORD_AUDIO",
"INTERNET"
]
},
"ios": {
"infoPlist": {
"NSCameraUsageDescription": "Camera needed for verification",
"NSMicrophoneUsageDescription": "Microphone needed for verification"
}
}
}
}
| Requirements | Version/Details | |
|---|---|---|
| React Native | 0.64.0 or higher | |
| React | 16.8+ (for hooks support) | |
| iOS | 12.0+ | |
| Android | API Level 21 + (Android 5.0) | |
| Node.js | 14.0+ | |
| TypeScript | Optional but recommended |
Basic Implementation
import React from 'react';
import { View, StyleSheet } from 'react-native';
import IdentityKyc from 'react-native-identity-kyc';
export default function App() {
return (
<IdentityKyc
configId="your-config-id"
widgetKey="your-widget-key"
onComplete={(data) => {
console.log('Verification completed:', data);
// Handle success
}}
onError={(error) => {
console.error('Verification error:', error);
// Handle error
}}
onClose={(data) => {
console.log('Widget closed:', data);
// Handle close
}}
buttonText="Start Verification"
showDefaultButton={true}
/>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
padding: 20,
},
});
Advanced Usage Examples
Example 1: With Metadata
<IdentityKyc
configId="CONFIG ID"
widgetKey="WIDGET ID"
metadata={{
user_id: 'user_12345',
source: 'mobile_app',
registration_date: new Date().toISOString(),
custom_data: {
department: 'sales',
region: 'EMEA'
}
}}
onComplete={(data) => console.log(data)}
onError={(error) => console.error(error)}
/>**
Example 2: Programmatic Control**
import React, { useRef } from 'react';
import { View, Button, StyleSheet } from 'react-native';
import IdentityKyc from 'react-native-identity-kyc';
export default function App() {
const kycRef = useRef(null);
const handleOpenKYC = () => {
kycRef.current?.open();
};
const handleCloseKYC = () => {
kycRef.current?.close();
};
return (
<IdentityKyc
ref={kycRef}
configId="your-config-id"
widgetKey="your-widget-key"
showDefaultButton={false}
onComplete={(data) => {
console.log('Verification completed:', data);
}}
onLoad={() => {
console.log('Widget loaded successfully');
}}
/>
</View>
);
}
Example 3: Custom Button
import { TouchableOpacity, Text } from 'react-native';
<IdentityKyc
configId="your-config-id"
widgetKey="your-widget-key"
customButton={(openWidget) => (
🔐 Verify Your Identity
)}
onComplete={(data) => console.log(data)}
/>
Example 4: Auto-Open
<IdentityKyc
configId="your-config-id"
widgetKey="your-widget-key"
autoOpen={true}
showDefaultButton={false}
onComplete={(data) => console.log(data)}
/>
API Reference
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
| ConfigId | string | Yes | - | Configuration ID from Prembly dashboard |
| WidgetKey | string | Yes | - | Widget key from Prembly dashboard |
| metadata | object | No | {} | Additional user data to pass |
| onComplete | function | Yes | - | Callback when verification succeeds |
| onError | function | Yes | - | Callback when error occurs |
| onClose | function | No | - | Callback when widget closes |
| onLoad | function | No | - | Callback when widget loads |
| buttonText | string | No | "Verify Identity" | Text for default button |
| ShowDefaultButton | boolean | No | true | Show/hide default button |
| customButton | function | No | - | Custom button render function |
| autoOpen | boolean | No | false | Automatically open widget |
| loaderColor | string | No | "#0D2525" | Loading indicator color |
Return Data Structure
onComplete callback:
{
status: true,
data: {
reference: "ref_abc123",
user_data: {
first_name: "John",
last_name: "Doe",
// ... other verified data
},
verification_result: {
identity_verified: true,
document_verified: true,
face_match: 0.98
}
},
timestamp: "2026-04-27T10:00:00Z"
}
onError callback:
{
status: false,
error_code: "E01",
message: "Verification failed",
details: {
// error details
}
}
Updated about 5 hours ago
