Integrate with a website (iframe/redirect)
Create a session on your server and send the user to the hosted flow.
The hosted flow lives at the verificationUrl returned by POST /api/session/init. Your backend creates the session; the browser only ever sees the URL.
Redirect (recommended)
- Create the session on your serverCall
/api/session/initwith your API key and keepsession.sessionIdnext to your own record. - Redirect the userSend a
302(or setwindow.location) toverificationUrl. The user completes the flow on the Konnect ID domain, over HTTPS, with full camera access. - Come backKonnect ID does not navigate the user back automatically. Show a waiting page on your side and rely on the webhook (or poll
/infofrom your server) to learn the outcome.
app.post("/start-kyc", async (req, res) => {
const r = await fetch(`${process.env.KONNECT_BASE_URL}/api/session/init`, {
method: "POST",
headers: { "x-api-key": process.env.KONNECT_API_KEY, "Content-Type": "application/json" },
body: JSON.stringify({ clientId: "acme", flow: "KYC", applicationId: req.user.id }),
});
const { verificationUrl } = await r.json();
res.redirect(verificationUrl);
});Embedding in an iframe
By default the app sends X-Frame-Options: DENY and Permissions-Policy: camera=(self). With those headers a browser will refuse to render the flow inside another site's iframe, and would block the camera there anyway. Embedding only works if your deployment relaxes them (for example a Content-Security-Policy: frame-ancestors allow-list for your domain and a camera permission for it). If you cannot change the deployment, use the redirect.
If you do control the headers, embed with the camera permission delegated:
<iframe src="VERIFICATION_URL" allow="camera" style="width:100%;height:720px;border:0"></iframe>Both your page and the flow must be served over HTTPS for the camera to work (localhost is exempt for development).