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, register, or authenticate. Use custom for the EasyOnboard KYC widget; use 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