Didit Web SDK Integration Reference: JS, Iframe, Redirect
Integrate the Didit web SDK in three steps: create a session on your server, pass its url to the SDK, then act on the signed webhook. $0.33 per full KYC check, SDK free.

Contents
In this guide
Jump to the part you need.
The Didit web SDK fits product teams that run identity checks in a browser app. You add one package, pass a session URL, and receive a signed status by webhook; a decision body rides along only for some statuses. A full KYC check is $0.33; the SDKs, workflow orchestrator and MCP server are free. The caveat: the redirect callback and the SDK's onComplete event only drive UI, so your server verifies the webhook.
Last updated: November 26, 2026. Prices checked against the live Didit price feed on November 26, 2026.
| Item | Detail |
|---|---|
| Package | @didit-protocol/sdk-web |
| Server call to start | POST https://verification.didit.me/v3/session/ |
| Result transport | Signed webhook, or GET /v3/session/{session_id}/decision/ |
| Price per full KYC check | $0.33 (ID $0.15 + passive liveness $0.10 + face match $0.05 + device and IP $0.03) |
| SDK, workflow orchestrator, MCP server | Free |
| Sandbox | Free and unlimited on every plan |
| Typical setup time | Documented setup estimates: 3 minutes for the JavaScript SDK, under 1 minute for the iframe |
Which web method to choose
We document seven integration methods. Use a UniLink when you do not need to create a session on your server. Use the session API when your backend needs to create and correlate individual sessions.
| Method | Setup time | Backend | Best for |
|---|---|---|---|
| JavaScript SDK | 3 minutes | Optional | React, Vue, Angular, Next.js, Nuxt, Svelte and vanilla JS with full programmatic control |
| InContext (iframe) | Under 1 minute | Optional | Embedding the flow without a redirect and without a build step |
| Redirect | 5 minutes | Yes | Maximum browser compatibility and cross-device flows |
| WebView (iOS and Android) | 15 minutes | Yes | Mobile fallback when no native SDK is in the app |
| WordPress and WooCommerce | 5 minutes | No code | WordPress sites and WooCommerce stores |
| Shopify | 5 minutes | No code | Shopify checkout or account verification |
| Salesforce | 10 minutes | No code | Contact and Lead record verification in the CRM |
For production web apps we recommend the JavaScript SDK. Use the iframe when you want the fastest embed, Redirect when the flow has to survive across devices, and the platform plugins if you live inside WordPress, Shopify or Salesforce. All three main web methods support cross-device verification, and we recommend Redirect when it is a priority. They deliver the final signed status by webhook. The comparison above describes the in-browser experience only, not how the decision reaches your server.
Prerequisites
| Requirement | Detail | Where |
|---|---|---|
| Plan | Free at $0.00 a month, with $10.00 in monthly credit for the first organization created with an eligible work email for a company domain. Growth at $99.00, Scale at $299.00, Enterprise from $15,000 a year | Pricing page |
| Organization | Created at sign-up, holds workflows, keys and verification activity | business.didit.me |
| API key | Sent as the x-api-key header on every verification call | Console, Settings, API & Webhooks |
| Webhook secret | The secret_shared_key returned when you register the destination, used to compute the HMAC signature you compare against | POST /v3/webhook/destinations/, step 6 |
| Workflow | Defines the steps the user goes through, and its UUID is required on every session | Console, Workflows |
| Client | A browser with camera access | Your app |
| Permissions | read:sessions on the key if you call the decision endpoint, and the iframe allow list if you embed | Key settings and iframe markup |
Setup, step by step
Step 1: Create the organization and copy the API key
Go to business.didit.me, create or select your organization, then open Settings and API & Webhooks. Copy the API Key and store it as DIDIT_API_KEY. The webhook secret is not created here; you store it when you register the destination in step 6. If you would rather not use a browser, register programmatically with POST https://apx.didit.me/auth/v2/programmatic/register/ followed by POST https://apx.didit.me/auth/v2/programmatic/verify-email/ and the 6-character code. The response carries a sandbox key you can build against for free, and a live key for production.
Step 2: Build a workflow and copy its ID
In the console go to Workflows and click Create Workflow. Pick the KYC template for full identity verification with an ID document, or Adaptive Age Verification, Biometric Authentication or Address Verification. Then add the features you need: NFC Verification, Liveness Detection, Face Matching, Phone Verification, Email Verification, AML Screening, Database Validation, Device and IP Analysis. Copy the Workflow ID. It is a stable UUID used on every session you create.
Step 3: Create a session from your server
Sessions are created server side so the API key never reaches the browser. The workflow type decides whether a user or a business session is created, there is no separate endpoint for KYB.
curl -X POST https://verification.didit.me/v3/session/ \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{
"workflow_id": "your-workflow-id",
"callback": "https://yourapp.com/verification-complete",
"vendor_data": "user-123"
}'The response is 201 Created and contains session_id, session_number, session_token, url and status set to Not Started. The url is what the browser opens. If your application has allowed domains set, an http or https callback must be on one of those origins, otherwise creation fails with 400 and the message names the allowed origin. Custom schemes such as myapp:// are always accepted.
Step 4: Add the JavaScript SDK and start the flow
The package is @didit-protocol/sdk-web. Installation instructions are in the JavaScript SDK guide. Then wire the completion callback and start verification with the url from step 3. Replace the sample hosted URL below with the url that Create Session returned. The callback gives you three cases: completed, cancelled and failed.
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;
}
};
// url comes from the Create Session response
DiditSdk.shared.startVerification({
url: 'https://verify.didit.me/session/3FaJ9wLqX2Mz'
});
The in-browser callback is a user-experience signal. Treat it as a reason to show a spinner or a thank-you screen, never as the verification decision. Act on the status from a verified session webhook. A decision body can accompany Approved, Declined, In Review or Abandoned. Fetch the full record from the decision endpoint when you need it.
Step 5: Or present the session with an iframe or a redirect
The iframe route needs no backend for the flow itself. A UniLink can be built from your workflow ID in under a minute, or you can pass an API-created session URL.
<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>Include the full documented allow attribute so the embedded flow can request the permissions it needs.
Redirect is the fallback when a browser policy blocks embedded capture, or when the flow has to continue on another device. Your backend creates the session as in step 3, then sends the browser to the url it returned:
// verificationUrl is the url returned by the Create Session call
window.location.href = verificationUrl;The browser leaves your app for the Didit-hosted page. When the user finishes, Didit redirects back to the callback URL you set on the session and appends verificationSessionId and status as query parameters, so your app can route the user from there.
Step 6: Register the webhook destination
Register a destination and store its returned secret_shared_key as DIDIT_WEBHOOK_SECRET. Retain the raw request body and verify the signature before processing the event.
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://yourapp.com/api/webhooks/didit",
"subscribed_events": ["status.updated", "data.updated", "user.status.updated", "user.data.updated"],
"webhook_version": "v3"
}'Check that X-Timestamp is fresh: reject a delivery if it differs from the current time by more than 300 seconds. Decode the body only to produce sorted, Unicode-preserved canonical JSON, compute HMAC-SHA256 over that with your destination secret, and compare it with X-Signature-V2 in constant time before you process the event. X-Signature instead uses the exact raw bytes. Accept a match on X-Signature-V2-Previous too, verified with the replaced destination secret, so verification keeps working while a rotated secret is deployed. De-duplicate on event_id, and answer 2xx within 5 seconds. If your handler is slower, or answers 5xx or 404, we retry twice, after about 1 and 4 minutes, then drop the delivery. You can resend it from the destination's delivery log.
There is no wildcard. Subscribe to each event family you want. You can create multiple destinations to fan out to different URLs. The decision object is included on Approved, Declined, In Review and Abandoned.
Step 7: Read the full decision when you need it
curl https://verification.didit.me/v3/session/SESSION_ID/decision/ \
-H "x-api-key: $DIDIT_API_KEY"The response is the same shape as the webhook decision. Always branch on session_kind, which is user or business. Per-feature data lives in plural arrays, and if a feature did not run on the session the field is absent or null, never a placeholder.
- User sessions:
id_verifications[],nfc_verifications[],liveness_checks[],face_matches[],poa_verifications[],database_validations[]. - Business sessions:
registry_checksfor the company, its officers, beneficial owners and ownership structure,key_people_checksfor officers, beneficial owners, submitted parties and the UBO KYC summary, anddocument_verifications. - Shared by both kinds:
aml_screenings[],phone_verifications[],email_verifications[],ip_analyses[],questionnaire_responses,document_ai_documentsandbank_verifications[].
The endpoint needs the read:sessions privilege.

Field and event mapping
| Field or event | Where it appears | What you do with it |
|---|---|---|
session_id | Create response, webhook envelope, decision response | Use it to correlate the session, webhook and decision response |
session_token | Create response, inside the hosted URL | Identifies the flow. It is not a decision |
url | Create response | Pass to DiditSdk.shared.startVerification({ url }), or use it as the iframe src or the redirect target |
vendor_data | You send it, we echo it in webhooks | Join the event to your own user record, also used for duplicate detection |
metadata | You send it, echoed back | Internal flags such as plan or signup source, never shown to the user |
callback | You send it | We append verificationSessionId and status so you can route the user back |
status | Session, webhook, decision | Approved, Declined, In Review, In Progress, Not Started, Expired, Abandoned, Kyc Expired, Resubmitted, Awaiting User. Inspect it in the webhook, then call the decision endpoint when you need the full record |
status.updated | Webhook webhook_type | The session status changed. A decision object rides along only for Approved, Declined, In Review and Abandoned |
data.updated | Webhook webhook_type | Verification data was edited, re-read the decision |
user.status.updated | Webhook webhook_type | User entity moved to ACTIVE, FLAGGED or BLOCKED |
environment | Webhook envelope | sandbox or live, the field that separates test traffic from production |
X-Signature-V2, X-Timestamp | Webhook headers | Retain the raw body and check X-Timestamp for freshness. Decode the body only to produce sorted, Unicode-preserved canonical JSON for X-Signature-V2. Compare signatures in constant time before processing the event. During rotation, verify X-Signature-V2-Previous with the replaced destination secret. X-Signature uses the exact raw bytes. |
event_id | Webhook envelope | De-duplicate repeated deliveries |
session_kind | Decision response | Branch between the user and business handlers |
result.type | SDK onComplete | completed, cancelled or failed. UI only |
Test with sandbox data
The sandbox is free and unlimited on every plan, and sandbox applications are separate from live ones. Two things make tests repeatable: the scenario catalog and the arm endpoint.
GET /v1/sandbox/scenarios/lists the scenario slugs available to your sandbox application.sandbox_scenarioon session creation, for exampleapproveordecline_aml_hit, expands the scenario's magic values onto contact and expected details so the session reproduces that outcome.POST /v3/session/{session_id}/sandbox/arm/arms or re-arms a scenario after creation, as long as the session is stillNot Started.- The webhook's
environmentfield tellssandboxfromlive. Usesandbox_scenarioto identify an armed scenario when one is present, because an unarmed sandbox session can carry a null scenario slug.
Expected success path: create a session with sandbox_scenario set to approve, open the url, and finish the flow. For the approval test, check the signed Approved status and inspect results for the steps the workflow ran. Then confirm that GET /v3/session/{session_id}/decision/ returns the same shape. For decline_aml_hit, specify a sandbox workflow with AML screening and verify that the application takes its declined branch instead of marking the user verified.
Error cases and fixes
| Symptom | Cause | Fix |
|---|---|---|
| 403 with detail You do not have permission to perform this action | The x-api-key header is missing on a verification call | Send the header on every authenticated verification API request |
| 401 | The key is wrong, revoked or expired | Copy the current key from Settings, API & Webhooks |
| 400 on session creation | Invalid workflow_id | Use the UUID from the workflow, not its label |
| 400 naming allowed domains | The callback origin is not on the application's allowed domains | Add the origin, or use a custom scheme deep link |
400 on session_expiration_time | The value is outside 3600 to 2419200 seconds, or not a whole number | Use an integer inside the range, or omit the field |
400 on sandbox_scenario | A scenario sent to a live application | Send scenarios only with a sandbox key |
| 404 on the decision endpoint | The session does not exist or belongs to another application | Check that the session ID exists and that the API key belongs to the application that created the session |
| 403 on the decision endpoint | The key lacks read:sessions | Grant the privilege to the key |
| Camera error inside the iframe | The allow attribute is missing or incomplete, one of several possible causes | Include the full list from step 5. If the browser policy blocks embedded capture, use the Redirect method instead |
| Webhook delivery fails or retries stop | We retry twice if the handler takes longer than 5 seconds or returns a 5xx or 404 response. The retries occur about 1 and 4 minutes later. If both fail, the delivery is dropped | Open the destination's delivery log, resend, and answer 2xx within 5 seconds |
| Webhook signature mismatch | The destination secret is wrong, or the canonical JSON you signed differs from ours | Check the X-Signature-V2 secret and the canonical JSON. If you verify X-Signature instead, it needs the exact raw bytes. Validate signature and timestamp before any application processing |
Disconnect and rotate
To disconnect the web flow, stop creating sessions and remove the SDK launch, iframe or redirect from your app.
The destination signing secret can be rotated in the console. For 24 hours after a rotation, we also send X-Signature-V2-Previous, verified with the replaced destination secret, so you can deploy the new secret and accept a match on either header while both are live.
Web KYC pricing and billing
You pay per completed check from prepaid credit, and nothing for the integration itself. The SDK, the workflow orchestrator, the MCP server and reusable KYC carry no price. Sandbox testing is free and unlimited.
| Line | Price | Unit |
|---|---|---|
| Full ID check (KYC) | $0.33 | completed check |
| ID verification | $0.15 | check |
| Passive liveness | $0.10 | check |
| Face match 1:1 | $0.05 | check |
| Device and IP analysis | $0.03 | check |
| AML screening, if you add the step | $0.20 | check |
| NFC chip reading, add-on | $0.15 | check |
| Phone verification | $0.02 Didit fee + carrier charge | code |
Free plan credit does not cover phone verification codes. Only the $0.02 Didit fee takes the plan discount, and the carrier charge passes through at cost.

Worked cost example
The example is in USD. It uses the monthly plan fees, the full monthly credit and no existing top-up balance. Take a web app that completes 5,000 full KYC checks in a month, with no AML step.
- Free plan, for an eligible organization with its full monthly credit available: 5,000 multiplied by $0.33 equals $1,650.00. Monthly credit of $10.00 is applied first, so top-ups come to $1,640.00 and the plan fee is $0.00.
- Growth at $99.00 a month with 4% off every Didit price: 5,000 multiplied by $0.3168 equals $1,584.00. Credit of $115.00 is applied, so top-ups come to $1,469.00. Add the $99.00 fee and the month costs $1,568.00.
- Scale at $299.00 a month with 10% off: 5,000 multiplied by $0.297 equals $1,485.00. Credit of $350.00 is applied, so top-ups come to $1,135.00. Add the $299.00 fee and the month costs $1,434.00.
Add an AML screening step at $0.20 per check and 5,000 checks add $1,000.00 at list price, or $960.00 on Growth and $900.00 on Scale.
Sources
- Didit docs: Web Identity Verification SDKs, JS and iframe
- Didit docs: JavaScript SDK
- Didit docs: InContext iframe
- Didit docs: Web redirect
- Didit docs: WebView in iOS and Android
- Didit docs: WordPress and WooCommerce
- Didit docs: Shopify
- Didit docs: Salesforce
- Didit docs: API full flow
- Didit docs: Create Session API
- Didit docs: Retrieve Session decision
- Didit docs: Webhooks and HMAC signing
- Didit docs: Verification statuses
- Didit docs: Quick start
- Didit docs: Authentication platform guides
- Didit docs: Pricing and billing rules
- Didit pricing page and pricing feed as JSON, read November 26, 2026
- Didit MCP server and integration prompt
- SDK web examples repository, iframe example, full Next.js demo
- Didit site index for AI agents
Next step: create a free organization at business.didit.me, copy a sandbox API key and run one session end to end. The sandbox costs nothing, and no sales call is required to start.
Try it
Try this in the sandbox
Run the check this guide describes, free.
The product this post is about, taken from its topic. Run it free in the sandbox.
Author
Alberto Rosas
Co-founder and CEO

Questions
Frequently asked questions
What is the Didit web SDK?
It is the client-side package that opens a Didit verification session inside your web app. The package is @didit-protocol/sdk-web and it supports React, Vue, Angular, Next.js, Nuxt, Svelte and vanilla JavaScript, with TypeScript types and modal or inline modes. The SDK handles the browser experience. For API-created sessions, your server creates the session and acts on the status from a verified webhook. The SDK can also open a UniLink without a session-create call from your server.
How much does a Didit web verification cost?
A full KYC check is $0.33, made up of ID document verification at $0.15, passive liveness at $0.10, face match at $0.05 and device and IP analysis at $0.03. The SDK, the workflow orchestrator and the MCP server are free, and sandbox testing is free and unlimited on every plan. Billing is per completed check from prepaid credit.
Do I need a backend to use the Didit JavaScript SDK?
You can pass a UniLink directly to the JavaScript SDK's startVerification method without creating an API session. For API-created sessions, keep the API key on your server and act on the status from a verified session webhook. A decision body can accompany Approved, Declined, In Review or Abandoned. Fetch the full record from GET /v3/session/{session_id}/decision/ when needed.
Which package do I install for React or Next.js?
Install @didit-protocol/sdk-web for verification, following the JavaScript SDK guide. Sign-in is a different product with different packages: @didit-protocol/auth, @didit-protocol/auth-react and @didit-protocol/auth-nextjs. For end-user sign-in, use the separate Authentication guides.
How do I verify a Didit webhook signature?
Keep the raw body. Recompute HMAC-SHA256 over the sorted, Unicode-preserved canonical JSON using your destination secret, and compare it with X-Signature-V2 in constant time before you process the event. Reject deliveries where X-Timestamp differs from the current time by more than 300 seconds. If you verify X-Signature instead, it uses the exact raw bytes. During secret rotation, also accept a match on X-Signature-V2-Previous, which is sent for 24 hours after rotation and is verified with the replaced destination secret.
What is the difference between the callback and the webhook?
The hosted page's redirect callback sends the user's browser back to your app with verificationSessionId and status in the query string, and the SDK's onComplete event does the same job inside the page. Both are convenient for routing, and neither is proof. A verified session webhook reports the status, and its decision object is included for Approved, Declined, In Review and Abandoned.
How do I test a declined verification in the sandbox?
Create the session with sandbox_scenario set to a decline slug such as decline_aml_hit, or arm the scenario afterwards with POST /v3/session/{session_id}/sandbox/arm/ while the session is still Not Started. The webhook's environment field separates sandbox from live, and sandbox_scenario names the armed scenario when one is present. Sending a scenario to a live application returns 400.
Why does my iframe show a camera error?
A missing or incomplete allow list is one possible cause: the frame cannot reach the camera and microphone without it. Add the full list: camera, microphone, geolocation, clipboard-write, fullscreen, autoplay, encrypted-media and digital-credentials-get. If the browser policy blocks embedded capture entirely, use the Redirect method instead.
Why does session creation return 400 with a message about allowed domains?
Your application has allowed domains configured and the callback origin is not one of them. The check compares scheme, host and port, so add the exact origin or switch to a deep link scheme such as myapp://, which is always accepted. A workflow default callback that sits outside the allowed domains is not used for the redirect.
Can an AI coding assistant set up the Didit web SDK for me?
Yes. The integration prompt is written for coding agents and covers the SDK choice, webhook HMAC verification and decision parsing. We also offer a free hosted MCP server at https://mcp.didit.me/mcp with OAuth sign-in. The MCP server carries no price.
How fast is the verification decision?
Inference runs at a sub-2-second p99. End-to-end timing also depends on user capture and whether the session enters In Review. We send a webhook when the session status changes. If your handler takes longer than 5 seconds to answer, the delivery counts as failed.

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.
Your obligations · 3 regions
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.
- 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.
Didit Academy


