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"  
      }  
    }  
  }  
}
RequirementsVersion/Details
React Native0.64.0 or higher
React16.8+ (for hooks support)
iOS12.0+
AndroidAPI Level 21 + (Android 5.0)
Node.js14.0+
TypeScriptOptional 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


PropTypeRequiredDefaultDescription
ConfigIdstringYes-Configuration ID from Prembly dashboard
WidgetKeystringYes-Widget key from Prembly dashboard
metadataobjectNo{}Additional user data to pass
onCompletefunctionYes-Callback when verification succeeds
onErrorfunctionYes-Callback when error occurs
onClosefunctionNo-Callback when widget closes
onLoadfunctionNo-Callback when widget loads
buttonTextstringNo"Verify Identity"Text for default button
ShowDefaultButtonbooleanNotrueShow/hide default button
customButtonfunctionNo-Custom button render function
autoOpenbooleanNofalseAutomatically open widget
loaderColorstringNo"#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
}
}