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/SDKEnvironmentDescription
prembly-reactkycReact (Web)Custom React hook ( useIdentityPayKYC ) to trigger identity verification
modal windows in web apps
prembly-reactnativeReact NativeMobile-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)


ParameterTypeRequiredDescription
widget_keystringYesYour public API key from the Prembly dashboard
widget_idstringYesThe specific verification workflow ID created in your dashboard.
emailstringYesThe user's email address
first_namestringOperationalUser's first name to pre-fill the form.
last_namestringOperationalUser's last name to pre-fill the form.
phonestringOperationalUser's phone number
metadataobjectOperationalCustom key-value pairs (e.g., transaction_id) passed back in response
callbacks.
callbackfunctionYesFunction 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.


Did this page help you?