Documentation menu
Web
Identity verification in the browser. Zero runtime dependencies, ESM with TypeScript types, and it works with any framework — or none.
SDK installation
npm install @blink-kyc/webThe package is not on the public npm registry; access is set up together with your credentials.
Register your origins. The Web SDK only works from origins registered on
your client, and the camera only opens on HTTPS pages (localhost is allowed for development).
See Web origins.
Verification flow
Your page asks your backend for a session token (Session API), then mounts the capture UI into an element:
import { BlinkKyc } from '@blink-kyc/web';
const { sessionToken, sessionId } = await fetch('/kyc/sessions', { method: 'POST' }).then((r) => r.json());
const outcome = await new BlinkKyc({ baseUrl: 'https://kyc-api.blink-pay.net', sessionToken })
.document({ type: 'PASSPORT' }) // PASSPORT | NATIONAL_ID | ID_CARD | DRIVING_LICENCE
.face() // liveness + face match
.mount('#blink') // the SDK renders its camera UI here
.on('progress', (p) => console.log(p.step))
.run();
// outcome: { result: 'VERIFIED' | 'REJECTED' | 'REVIEW', detail } — a page copy.
// Ask your backend for the authoritative result with sessionId.<div id="blink"></div>Headless capture
await new BlinkKyc({ baseUrl, sessionToken })
.document({ type: 'NATIONAL_ID' })
.face()
.capture({
document: async () => grabDocumentBlob(), // return a Blob
liveness: async (actions) => recordFrames(actions), // perform the actions, return Blob[]
})
.run();API
| Call | Effect |
|---|---|
new BlinkKyc(options) | { baseUrl, sessionToken, timeoutMs?, theme?, strings?, fetch? } |
.document({ type?, side? }) | Enable the document step. |
.face() | Enable liveness and face match. |
.mount(target) | Render the built-in capture UI into an element or selector. |
.capture(hooks) | Headless: { document, liveness } return the media. |
.on('progress', cb) | Progress events. |
.run() | Promise<{ result, detail }> |
UI customisation
new BlinkKyc({ baseUrl, sessionToken, theme: { accent: '#15803d', background: '#0e1e4d' } });Inside a WebView
If you load the Web SDK inside a native WebView, the WebView must grant camera access to the page and serve it over HTTPS. For native apps the Android, iOS, Flutter or React Native SDKs give better capture quality.