Skip to main content

Embed Identity Verification: iFrame Integration Guide

Embed Didit verification with one iframe tag or a session URL from your backend. Setup takes under a minute, the browser sends events by postMessage, and the signed decision arrives by webhook, or from the decision endpoint if.

Embed Identity Verification: iFrame Integration Guide

Contents

In this guide

Jump to the part you need.

The iframe method puts the Didit verification flow inside your own page, with no redirect. It fits teams that want the quickest embed: one iframe tag with a UniLink and no backend, or a session URL created from your server. Each completed full KYC check costs $0.33 from prepaid credit. The caveat: the browser is never the source of truth, so the decision arrives by webhook, or from the decision endpoint if a webhook is missed.

Last updated: November 26, 2026. Prices checked against the live Didit price feed on November 26, 2026.

At a glance

Didit InContext iframe integration in one table
ItemDetail
Setup timeUnder 1 minute, the documented setup time for the iframe route
Backend requiredOptional. Required only if you create the session yourself
Where the flow rendersInside your page, in an iframe served from verify.didit.me
Browser eventspostMessage, for UI state only
Final decisionWebhook signed with X-Signature-V2, plus GET /v3/session/{session_id}/decision/ as a fallback
Price per full KYC check$0.33 (ID $0.15 + passive liveness $0.10 + face match $0.05 + device and IP $0.03)
SandboxFree on every plan, checks are mocked
Coverage220+ countries and territories, 14,000+ document types

Start free in the sandbox at business.didit.me, no sales call. Developers connecting Didit to an AI assistant can use the Didit MCP server. Every unit price is on didit.me/pricing and in the pricing docs.

What the iframe method does, and when to use it

Didit ships seven documented web integration methods. The InContext iframe gives you the quickest setup: the verification UI is hosted by us, you frame it, and you never rebuild the document capture, liveness or face match screens. Our docs recommendation is explicit. For production web apps, use the JavaScript SDK for the best control. Use the InContext iframe for the quickest setup, and the redirect when cross-device verification is needed.

Pick the iframe when you want the flow embedded inside a signup, checkout or account page and you do not want to import a package. Pick the JavaScript SDK when you need inline and modal modes with typed callbacks in React, Vue, Angular, Next.js, Nuxt, Svelte or vanilla JavaScript. Both deliver the same final, signed result by webhook.

Prerequisites

  • A Didit account and organization at business.didit.me. Eligible organizations receive $10 of monthly credit on the Free plan when the first organization is created with an eligible work email.
  • A published workflow. Create one under Workflows in the console, then copy its identifier.
  • An API key, only if you create sessions yourself. Keys live under Developers, then API keys, inside the console. New keys start with sk_live_ or sk_test_. Keep the key server-side, never in the browser or a mobile bundle.
  • An HTTPS page. Camera and microphone capture needs a secure context.
  • For decisions: a public HTTPS endpoint that answers 2xx within 5 seconds.

Step-by-step: embed Didit identity verification in an iframe

Step 1. Publish a workflow and copy the UniLink

In the console, open Workflows, create the flow you need and publish it. The UniLink is the no-backend route: it points at the published workflow itself, so there is no session call and no server code, which is why our web SDK overview lists it as the under-a-minute path. The other route, described in step 3, creates a session from your backend, and that one does require server-side session creation because the API key must never reach the browser.

Step 2. Add the iframe with the required permissions

Use the documented markup. The allow attribute is not optional: without it the browser blocks the camera and the user cannot reach the liveness step.

<iframe
  src="https://verify.didit.me/u/YOUR_WORKFLOW_ID_BASE64"
  style="width: 100%; height: 700px; border: none;"
  allow="camera; microphone; geolocation; clipboard-write; fullscreen; autoplay; encrypted-media; digital-credentials-get"
></iframe>
A user walking through the Didit verification flow that loads inside the iframe
What your users see after the iframe loads: document capture, liveness and face match, all hosted by Didit.

Step 3. Optional: create a session from your backend

Use this route when the session must be tied to your own user record or to a callback URL. The API key stays on the server.

curl -X POST https://verification.didit.me/v3/session/ \
  -H "x-api-key: $DIDIT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"workflow_id":"<WORKFLOW_ID>","vendor_data":"user-42","callback":"https://myapp.com/kyc/return"}'

The response contains session_id, url and session_token. Send url to your frontend and load it as the iframe src. If your application has allowed domains configured, an http or https callback must sit on one of those origins or creation fails with a 400 on callback.

Step 4. Listen for browser events

The iframe reports progress through postMessage. Check the origin first, then treat what you receive as UI state only, for example to close a modal or show a waiting screen while the checks run. It is not a decision. The authoritative result is the webhook in step 5, or the decision call in step 6.

window.addEventListener('message', function (event) {
  if (event.origin !== 'https://verify.didit.me') return;
  console.log('iframe event', event.data);
});

Step 5. Register the webhook destination

This is where the real result lands. Create the destination once, then store the returned secret_shared_key as an environment variable on your server. There is no wildcard in subscribed_events, so list every family you need: status.updated for session status changes and data.updated for changes to a session's verification data, plus user.status.updated and user.data.updated if you also track Didit user entities, or business.status.updated and business.data.updated for business entities.

curl -X POST https://verification.didit.me/v3/webhook/destinations/ \
  -H "x-api-key: $DIDIT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"label":"Production","url":"https://myapp.com/api/webhooks/didit","subscribed_events":["status.updated","data.updated","user.status.updated","user.data.updated"],"webhook_version":"v3"}'

Verify X-Signature-V2, an HMAC-SHA256 over the canonical JSON, and reject any request whose X-Timestamp is more than 300 seconds old. De-duplicate on event_id and answer within 5 seconds. The full handler pattern is in the webhooks documentation.

Step 6. Read the decision as a fallback

If a webhook is missed, fetch the decision directly. Didit returns the same object the webhook carries.

curl https://verification.didit.me/v3/session/<SESSION_ID>/decision/ \
  -H "x-api-key: $DIDIT_API_KEY"

Expected output

A finished session produces a status from a fixed list: Approved, Declined, In Review, In Progress, Not Started, Expired, Abandoned, Kyc Expired, Resubmitted or Awaiting User. The values are case-sensitive. The decision object uses plural arrays, so a workflow with two liveness steps returns two entries.

{
  "session_id": "<uuid>",
  "session_kind": "user",
  "status": "Approved",
  "vendor_data": "user-42",
  "id_verifications": [ ... ],
  "liveness_checks": [ ... ],
  "face_matches": [ ... ]
}

Branch on session_kind before anything else. User sessions return identity, liveness, face match, AML and phone arrays. Business sessions return registry checks, document verifications and key people checks. Never assume singular V2 fields; the full schema is in the retrieve session reference, and the status list is documented in verification statuses.

A Didit session overview showing status and warnings in the Business Console
The same session in the Business Console, with its status, warnings and review clock.

Failure cases and recovery

What breaks in an iframe integration, and the fix
SymptomCauseRecovery
Camera or microphone never startsMissing allow attribute, or the page is not HTTPSAdd the documented permission list to the iframe and serve the page over HTTPS
401 on verification.didit.meThe x-api-key header is wrong, malformed, revoked or expiredFetch a fresh key, or recover it through the login flow in the authentication docs
403 on verification.didit.meNo x-api-key, a scoped key without access, or a call from an address outside the key IP listUse a key that holds the privilege you need
400 on session creationInvalid workflow_id, or a callback outside your allowed domainsCopy the workflow UUID again, or move the callback onto an allowed origin
No webhook arrivesYour endpoint took longer than 5 seconds, answered 5xx or 404Didit retries twice, after about 1 and 4 minutes, then drops the delivery. Resend from the destination delivery log, and fetch the decision directly meanwhile
404 on a session routeThe session sits outside the scoped key workflows or statusesUse a key whose limits include that session
429Rate limitThe response carries a wait field in seconds. Back off, then retry

One structural mistake causes most trouble: putting the API key inside the iframe URL or in frontend JavaScript. Treat it as a server-side secret. A primary key has full access, while scoped keys can limit access. The browser only ever receives a session URL.

Inputs and outputs

Session inputs and decision outputs for the iframe route
FieldDirectionWhat it does
workflow_idInput, requiredStable workflow UUID from /v3/workflows/. A KYC workflow makes a user session, a KYB workflow makes a business session
vendor_dataInput, recommendedYour stable identifier for the person or business, used for duplicate detection across sessions
callbackInput, optionalWhere the hosted flow returns the user. Didit appends the session id and status
languageInput, optionalISO 639-1 code for the flow UI, 54 languages supported
metadata, tagsInput, optionalYour own JSON and labels, echoed back in responses and webhooks
session_expiration_timeInput, optionalLink lifetime in seconds, between 3600 and 2419200
session_id, url, session_tokenOutput of createThe id you store, the URL you frame, and the token the flow uses
status, decision_trace, feature arraysOutput of decisionThe decision, how it was reached, and one array per check that ran

Billing is per completed check from prepaid credit. Loading the iframe, opening the flow and starting a session cost nothing. Credits are consumed when a check completes. Sandbox checks are mocked and free, so you can build and test the whole embed without spending.

Some outcomes leave automation. A session in In Review has a human holding it in the console, with an assignee and an SLA clock in sla_due_at. When a reviewer changes the status by hand, status_override records the automatic status that was replaced, and decision_trace.decided_by shows whether the outcome was automatic, manual or taken by the Investigator. That boundary matters for your UI: an iframe that shows a spinner until Approved will hang on In Review, so design a waiting state.

Iframe, JavaScript SDK or redirect

Documented comparison of the three web routes
FeatureJavaScript SDKInContext iframeRedirect
Setup time3 minUnder 1 min5 min
Backend requiredOptionalOptionalYes
Stays on your domainYesYesNo
Event callbacksReal-timepostMessageCallback only
Full programmatic controlYesLimitedCallback only

All three deliver the final signed result by webhook. The table describes the in-browser experience, not how you receive the decision. If you later move to the SDK, the call is short:

import { DiditSdk } from '@didit-protocol/sdk-web';

DiditSdk.shared.onComplete = (result) => {
  switch (result.type) {
    case 'completed':
      console.log('Session ID:', result.session?.sessionId);
      console.log('Status:', result.session?.status);
      break;
    case 'cancelled':
      console.log('User cancelled verification');
      break;
    case 'failed':
      console.error('Verification failed:', result.error?.message);
      break;
  }
};

DiditSdk.shared.startVerification({
  url: 'https://verify.didit.me/session/3FaJ9wLqX2Mz'
});

Runnable reference projects live at the iframe example repo and the SDK examples repo. The end-to-end recipe, including webhook signature verification and every status, is in the integration prompt.

Worked cost example

A full KYC check is three parts in one check: the ID document, biometrics and device plus IP analysis. On the public price list that is $0.15 + $0.10 + $0.05 + $0.03 = $0.33 per completed check.

Say your signup flow runs 20,000 embedded checks in a month, all on a standard KYC workflow with AML excluded.

  • List price: 20,000 x $0.33 = $6,600.00
  • Scale plan per-check price, 10% off: $0.33 x 0.90 = $0.297. So 20,000 x $0.297 = $5,940.00
  • Plus the Scale monthly fee of $299.00: $5,940.00 + $299.00 = $6,239.00
  • Difference against list price: $6,600.00 - $6,239.00 = $361.00 less, before counting the $350.00 of monthly credit the plan adds

For comparison, the Growth plan at 4% off puts the per-check price at $0.3168. That gives 20,000 x $0.3168 = $6,336.00, plus the $99.00 fee, so $6,435.00. Add AML screening at $0.20 per check and the same volume adds 20,000 x $0.20 = $4,000.00. The exact numbers, including volume estimates, are in the cost estimator.

How Didit billing works: credits, auto-recharge and volume discounts
How credit, auto-recharge and plan discounts apply to per-check billing.

Sources

Next step: open the console at business.didit.me, publish a workflow and paste the iframe tag into a test page. The sandbox costs nothing and needs no sales call.

Try it

Try this in the sandbox

Run the check this guide describes, free.

ID Verification

The product this post is about, taken from its topic. Run it free in the sandbox.

$0.15 per checkStart free

Author

Alejandro Rosas

Co-founder and CTO

Alejandro Rosas

Alejandro Rosas

Co-founder and CTO

About Didit

Questions

Frequently asked questions

How do I embed Didit identity verification in an iframe?

Publish a workflow, then place an iframe whose src points at the Didit verification URL and whose allow attribute lists camera, microphone, geolocation, clipboard-write, fullscreen, autoplay, encrypted-media and digital-credentials-get. If you need a session tied to your own user record, create it first with POST https://verification.didit.me/v3/session/ and use the returned url as the src.

Does the iframe integration need a backend?

No, the UniLink route needs no backend and sets up in under a minute. You do need a server-side endpoint if you create sessions yourself, because session creation uses the API key, and if you want to receive the decision by webhook, because the signature must be verified with your secret.

Where does the Didit API key go in an iframe integration?

Never in the browser. Treat the API key as a server-side secret: a primary key has full access, while scoped keys can limit access. Putting it in the iframe URL or frontend JavaScript exposes it to anyone who opens developer tools. Your page only receives a session URL or UniLink.

What iframe permissions does the Didit verification flow need?

Always include allow="camera; microphone; geolocation; clipboard-write; fullscreen; autoplay; encrypted-media; digital-credentials-get". Without camera and microphone the liveness and face match steps cannot run, and the page must be served over HTTPS.

How do I know when a user finishes verification inside the iframe?

The iframe emits browser events through postMessage, and those are for UI state only. The authoritative answer arrives by webhook with a status.updated event, signed with X-Signature-V2. If a webhook is missed, call GET /v3/session/{session_id}/decision/ with the key on your server.

Which webhook events do I subscribe to for session status and data updates?

Subscribe to status.updated for session status changes and data.updated when a session's verification data is edited. Add user.status.updated and user.data.updated if you track Didit user entities, or business.status.updated and business.data.updated for business entities. There is no wildcard, so every family you want must be listed on the destination.

Why does the camera not work inside the embedded flow?

Two causes cover almost every case: the allow attribute is missing or incomplete, or the hosting page is not on HTTPS. Both block media capture in modern browsers regardless of what the user does inside the iframe.

How much does an embedded KYC check cost?

It is the same $0.33 per completed full KYC check as any other integration route: ID document verification $0.15, passive liveness $0.10, face match $0.05 and device plus IP analysis $0.03. Rendering the iframe and opening the flow cost nothing, and billing starts when a check completes.

Can I test the iframe integration without paying?

Yes. The sandbox is free on every plan and every check is mocked, so you can build the embed, fire the webhook and inspect decisions without spending credit. Eligible organizations also receive $10 of monthly credit on the Free plan when the first organization is created with an eligible work email.

Which statuses can a session return?

The list is fixed and case-sensitive: Approved, Declined, In Review, In Progress, Not Started, Expired, Abandoned, Kyc Expired, Resubmitted and Awaiting User. Build a waiting state for In Review, because a human reviewer is holding the session and it can take longer than an automated decision.

Does the iframe work on mobile web browsers?

The iframe renders in mobile browsers, but in-app WebViews on iOS and Android are a different surface with their own media rules. Didit documents a dedicated WebView route for that case, and the redirect route when cross-device verification is needed.

Compliance built in

Audited, certified and attested.

We hold the certifications and build each country's rules into your flows, so you can launch anywhere without worrying. Security and Compliance center

  • Regulation encoded into your flows

    Tell us what you do and where. Didit lists the rules that apply to you, with sources, and builds the checks each country needs into one workflow.

  • Ready for AMLR

    Every requirement of the new EU anti-money laundering rules, from checking customers to human review, is already covered by a Didit check.

  • Tested in Spain's Treasury sandbox

    Spain's Treasury published its supervised sandbox report on Didit's NFC plus active liveness onboarding; SEPBLAC took part and valued the added measures positively.

  • Audited, not self-declared

    iBeta Level 1 and Level 2. Liveness tested under ISO/IEC 30107-3.

Compliance assistant

Your obligations · 3 regions

EU · AMLRCustomer due diligence, human reviewCovered
Illinois, Texas, ColoradoExplicit biometric consentCovered
Germany · Youth protectionVerified adults only (JMStV)Covered
Workflow checked. Every obligation is met
  • SOC 2 Type 2
  • ISO 27001
  • iBeta Level 1 and Level 2
  • EU regulator attestation
  • FSM youth protection
  • GDPR
  • EBA remote onboarding
  • MiCA compatible
  • FIDO Alliance member
  • AMLREU AML Regulation ready

Integration · Didit MCP

Run Didit from your own AI agent

Connect Didit to Claude, Cursor, VS Code or ChatGPT and just ask in plain words. Your agent can do anything you can do in the console, with the same permissions you have.

Add to ClaudeChatGPT
Didit Academy · Lesson 04 · Use Didit with MCP
  • Build workflowsDescribe the checks you need. The agent creates and publishes the flow.
  • Run investigationsAsk why a session was declined, review cases, search people and companies.
  • Change rulesCreate payment rules, test them on past data and switch them on.
  • Pull reportsAsk for numbers, exports or the audit log.

Verify your first user today.

Start free

Free sandbox. Credit applies to work-email sign-ups.