Web (React)
The Prembly React SDK provides a simple hook to integrate identity verification, KYC, and liveness checks directly into your react applications with minimal configuration.
Available React SDK Packages
| Package/SDK | Environment | Description |
|---|---|---|
| prembly-reactkyc | React (Web) | Custom React hook ( useIdentityPayKYC ) to trigger identity verification modal windows in web apps |
| prembly-reactnative | React Native | Mobile-native components supporting camera access, document capture, and biometric checks on iOS/Android |
Quick Start
The prembly-react-kyc package provides a React hook to easily launch the Prembly verification widget.
npm install prembly-react-kyc --save
or
yarn add prembly-react-kyc
Implementation
import React from 'react';
import useIdentityPayKYC from 'prembly-react-kyc';
const App = () => {
const config = {
first_name: 'John',
last_name: 'Doe',
email: '[email protected]',
phone: '+2348012345678',
widget_key: 'your_widget_key_here',
widget_id: 'your_widget_id_here',
metadata: {
transaction_id: 'txn_123'
},
callback: (response) => console.log(response)
};
const verifyWithIdentity = useIdentityPayKYC(config);
return <button onClick={verifyWithIdentity}>Click to Test</button>;
}
export default App;
Configuration (Props)
| Parameter | Type | Required | Description |
|---|---|---|---|
| widget_key | string | Yes | Your public API key from the Prembly dashboard |
| widget_id | string | Yes | The specific verification workflow ID created in your dashboard. |
| string | Yes | The user's email address | |
| first_name | string | Operational | User's first name to pre-fill the form. |
| last_name | string | Operational | User's last name to pre-fill the form. |
| phone | string | Operational | User's phone number |
| metadata | object | Operational | Custom key-value pairs (e.g., transaction_id) passed back in response callbacks. |
| callback | function | Yes | Function executed when verification completes or closes. |
Troubleshooting (Web)
- Widget not loading: Ensure your Widget ID and Key match your environment (Live vs Sandbox).
- Camera access denied: Ensure your site is being served over HTTPS. Camera APIs are blocked on insecure origins.
Updated about 16 hours ago
Did this page help you?
