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#Options
| Option | Type | Description |
|---|---|---|
sessionToken | string | Required. The session token from your backend |
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.