Integration
Web SDK
Embed the flow on your website with one script tag.
#Install
html
<script src="https://{{HOST}}/sdk/kyc.js"></script>#Open as a modal
js
// sessionToken comes from YOUR backend (POST /v3/session/ → session_token)
KYC.open({
sessionToken: 'vs_...',
onComplete: (e) => { /* user submitted — wait for the webhook for the result */ },
onClose: () => {},
onError: (e) => console.error(e),
onEvent: (e) => console.log(e.type),
});#Open inline
js
KYC.open({ sessionToken: 'vs_...', container: '#kyc' }); // fills the element, min height 680px#Embed a workflow link (no backend needed)
html
<script src="https://{{HOST}}/sdk/kyc.js"></script>
<button id="sk-verify">Verify my identity</button>
<script>
document.getElementById('sk-verify').onclick = () =>
ScreenKaptain.open({ url: 'https://.../k/WORKFLOW_LINK', customerRef: 'user-123', onComplete: (e) => console.log(e) });
</script>Copy the exact code for each workflow from the console (open the workflow → Embed in your app or website) or from GET /v3/workflows/{id}/embed/.
#Options
| Option | Type | Description |
|---|---|---|
sessionToken | string | The session token from your backend. Use this or url |
url | string | A session URL, a /k/… workflow link or a /p/… person link |
customerRef | string | With a workflow link: your own customer ID, saved as vendor_data (SDK 2.1+) |
container | string or element | Render inline instead of in a modal |
onComplete | function | Called when the user submits |
onClose | function | Called when the user closes the modal |
onError | function | Called on a flow error |
onEvent | function | Called for every flow event |
autoClose | boolean | Close the modal 2 seconds after submit. Default true |
baseUrl | string | Override the host. Defaults to the host the script came from |
KYC.close() closes the modal. The iframe is given camera permission automatically.