Before you start
You’ll need:- Access to the Widgets API to create widget sessions. Manage your access in the Enterprise Portal.
- A backend that can call the Widgets API to create sessions on behalf of your users.
- A frontend — either a web app (iframe) or a native app (WebView) — to embed the Widget.
Setup
1. Install the SDK
Install the SDK in the frontend that will host the Widget — your web app, or the JS bundle loaded by your native WebView.2. Allow the Widget domain in your CSP
The Widget loads in an iframe. If your app uses a Content Security Policy, allow the Widget host for your environment(s) underframe-src.
If your app does not use CSP, skip this step.
3. Create a session on your backend
The KYC Widget runs against a session — a short-lived, server-side authorization scoped to one flow and one user. Create it server-side using your OAuth credentials. CallPOST /widgets/kyc/sessions with the verify flow and, optionally, the processes you want the user to complete:
response.session to your frontend (e.g. as part of your page response or via your own API endpoint). The SDK takes it as a single session argument.
4. Initialize and mount the Widget
On the frontend, instantiateKycWidget with the session from Step 3, then mount it into a container element.
The container must have explicit CSS width and height — the iframe fills its bounds. Minimum recommended size is 400px × 600px.
5. Handle Widget events
The Widget emits four events during its lifecycle. Wire up handlers before callingmountIframe.
The
complete event signals that the user has submitted all required processes. Final verification outcomes (e.g. identity approved or rejected) are delivered asynchronously via KYC webhooks.6. Test in Sandbox
With your Sandbox credentials and the Sandbox Widget host configured, run through this checklist:- The Widget mounts and
readyfires. - Completing the verification flow fires
complete. - Closing or dismissing the Widget fires
cancel. - The browser console shows no CSP violations (look for “Refused to frame”).
url returned from your backend — no client-side environment switching is needed.
Native app integration
Native mobile apps embed the Widget through a WebView that loads an HTML page hosting the SDK. Events flow between native code and the WebView through a JavaScript bridge. The setup is the same as the web flow above — install the SDK in your JS bundle, create the session on your backend, and instantiateKycWidget. The only addition is the bridge that forwards events to native code.
WebView HTML template
Bundle this HTML with your app and load it in the WebView. ThesendToNativeApp helper at the bottom forwards events to whichever bridge is available (iOS, Android, or React Native).
The SDK must be included in your WebView bundle (e.g. via your build pipeline). Loading it from a CDN is not supported.
Platform setup
- iOS (Swift)
- Android (Java/Kotlin)
- React Native
Configuration reference
The most common SDK options. See the SDK reference for the full schema and all event types.Troubleshooting
Widget not displaying Confirm the Widget host for your environment is in theframe-src directive of your CSP (see Step 2). Open DevTools → Console and look for Refused to frame violations.
Container is empty after mount
The iframe fills its container — the container must have explicit CSS width and height. Minimum recommended size is 400px × 600px.
Events not firing in native apps
Verify that:
- JavaScript is enabled in the WebView.
- The message bridge is registered before the HTML page loads.
- Event handler names match the platform-specific bridge contract used in
sendToNativeApp.
widget.unmount() from each terminal handler (complete, cancel, error).
Next steps
- Review the complete SDK Reference for all available methods and events.
- Follow the user onboarding guide for a step-by-step walkthrough of verifying users with the KYC Widget.