Skip to main content
Drop Dojah’s hosted verification flow into any web page with the Connect widget — a single script, no framework required.
This is a widget SDK — it renders Dojah’s UI with your widget_id and public_key. The Options below are the reference for every web widget; response events and the API-client alternative are covered in Choosing an SDK.

Install

Add the widget script to your page. Don’t use async/defer — the inline code may run before the library loads.
index.html

Initialize

Create a Connect instance with your credentials and callbacks, then open it on a click:
app.js
type can be custom, vouch, register, or authenticate. Use custom for the EasyOnboard KYC widget, vouch for a Vouch flow, and register or authenticate for EasyAuthentication. That is everything a flow needs — the widget collects the user’s details itself. To skip screens for data you already hold, add the prefill options below.

Prefill known data

user_data, gov_data, and gov_id exist purely to skip screens: user_data for name and date of birth, gov_data for BVN/NIN numbers, gov_id for ID images by URL. Add a key only when you already have a real value for it.
app.js
gov_id also accepts national, dl, permit, voter, and custom. The values above are the sandbox test BVN and a placeholder host — see Sandbox & test data for the full set of test values.
Omit a key rather than sending it empty. A gov_data: { bvn: "", nin: "" } prefills the screen with blanks instead of skipping it, and the user may be unable to correct it. Every field you do send is PII travelling through the browser, so send only what you actually hold.

Options

See Handling the response for the callback model shared by every web widget.
Don’t store PII in metadata or reference_id. Both are echoed back to the client and appear in URLs — use your own opaque identifiers, never a BVN, NIN, or phone number.

Embed inline

By default the widget opens as a modal overlay. Set embed: true with a container selector to render it inside an element on your page instead:
app.js

TypeScript

Connect is attached to window at runtime, so declare it to keep TypeScript happy. Add a types/index.d.ts file and point compilerOptions.typeRoots at that folder:
types/index.d.ts
Then instantiate it from window:
app.ts

Resources

Loading the hosted flow in an iframe can fail in Chrome on Android with Camera permission denied or unavailable, even after the user allows the camera. The flow runs on identity.dojah.io, so the browser only grants the camera and location when your page delegates those permissions.Apply both changes below, deploy, then retry verification in an Android mobile browser.

Permissions-Policy header

On the server or CDN that serves your site, allow https://identity.dojah.io to use the camera and geolocation:
Nginx:
nginx.conf
Apache:
httpd.conf

Iframe allow attribute

The element that embeds the hosted flow must declare the same features:
index.html
You can still prefill the flow with query parameters such as user_data[first_name], user_data[last_name], user_data[dob], gov_data[bvn], gov_data[nin], and metadata[user_id]. Send a value only when you already have one — an empty parameter prefills the screen with a blank.