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
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

OptionTypeDescription
sessionTokenstringThe session token from your backend. Use this or url
urlstringA session URL, a /k/… workflow link or a /p/… person link
customerRefstringWith a workflow link: your own customer ID, saved as vendor_data (SDK 2.1+)
containerstring or elementRender inline instead of in a modal
onCompletefunctionCalled when the user submits
onClosefunctionCalled when the user closes the modal
onErrorfunctionCalled on a flow error
onEventfunctionCalled for every flow event
autoClosebooleanClose the modal 2 seconds after submit. Default true
baseUrlstringOverride the host. Defaults to the host the script came from

KYC.close() closes the modal. The iframe is given camera permission automatically.