React JS Library
The Dojah platform has a smooth widget that enables your users to authorize access to their accounts. This widget works effortlessly across various browsers and devices of all sizes.
How to Generate Widget
This is a react.js library for implementing the dojah KYC widget.
Step 1: Start using react-dojah in your project by running
Reference : https://www.npmjs.com/package/react-dojah
Example: https://github.com/dojah-inc/React-Js-sdk
❗️Adding the async attribute can cause the inline code to return undefined because the library may not be available at that moment. So avoid the use of async and defer for now.
Step 2: Configure the Javascript Client Library
At this stage, you can now create a Dojah widget object by passing in your public key and Application Id in your preferred configuration options.
Parameter | Type | Description |
---|---|---|
type | string | Widget Type: Values are ‘custom’, ‘verification’, ‘identification’, ‘verification’, ‘liveness’ |
app_id | string | Application Id, Get it from your dojah application dashboard here |
p_key | string | Public Key, Get it from your dojah application dashboard here |
reference_id | string | Reference ID, It can be passed to keep track of the verification steps (Started, Ongoing, Successful). NB: reference_id character length must be greater than 10 |
widget_id | string | Widget ID, Get it from your Easy Onboard application dashboard here |
user_data | object | Automatically update the user data page, and thus skip the page |
gov_data | object | Automatically update the government data page, and thus skip the page |
metadata | object | Your application’s metadata to be passed back to you via webhook, onSuccess, or onError |
onSuccess | function | This is called when your user has successfully completed enrollment with their preferred institution. The sample response data below is passed to the widget |
onError | function | This is called when your user was unable to successfully complete enrollment. |
onClose | function | This is called when the widget is closed. |
Step 3: Handle a Successful Enrollment
On successful enrollment, the _onSuccess _callback function that you supplied is called by the client library. We then return the connected account code to your server.
Kindly use the overall status (response.status (Boolean, i.e true or false)) to ascertain if the request failed or succeeded.
📘
Webhook Notifications
You can receive the same data below (also passed to onSuccess and onError) via a webhook call.
Register your url for webhook calls here and ensure
kyc.widget
is theservice
you are subscribed to.In Config object Kindly set webhook object value to true (Boolean)
Example : webhook : true
The Sample response data after successful verification
📘
How to retrieve the Selfie Photo
There’s a response object that is sent to the client via the widget launcher on success or failure
selfieUrl and idUrl under selfie and id in the success response objects, which holds the final selfie capture and id capture respectively.
Was this page helpful?