Add Didit Identity Verification to React (2026 Guide)
Use @didit-protocol/sdk-web in React, create the session on your server with POST /v3/session/, then take the decision from a signed webhook. A full KYC check costs $0.33 and the sandbox is free.

Contents
In this guide
Jump to the part you need.
Our JavaScript verification SDK supports React. Install @didit-protocol/sdk-web, create the session on your server with POST /v3/session/, then read the final decision from a signed webhook or the authenticated decision endpoint. A completed full KYC check costs $0.33 at list price, and the sandbox is free. It fits React and Next.js teams that want the flow in their own UI. The caveat: session creation and the authoritative decision stay server-side; the browser receives the session URL and can see a status.
Last updated: November 26, 2026. Prices checked against the live Didit price feed on November 26, 2026.
React identity verification with Didit at a glance
| Item | Detail |
|---|---|
| Browser package | @didit-protocol/sdk-web, with modal and inline modes |
| Frameworks covered | React, Next.js, Vue, Angular, Nuxt, Svelte and vanilla JavaScript |
| Setup time | About 3 minutes for the SDK, before your own wiring |
| Backend | Optional for the SDK. UniLink is the documented option without an app backend. Creating API sessions and receiving webhook decisions in this walkthrough needs a server. |
| Create a session | POST https://verification.didit.me/v3/session/ |
| Read the decision | GET https://verification.didit.me/v3/session/{session_id}/decision/ |
| Price per completed full KYC | $0.33 list, $0.3168 on Growth, $0.297 on Scale |
| Sandbox | Free on every plan, 500 session creates per 24 hours per sandbox application |
| Coverage on record | 4,000+ companies, 220+ countries and territories, 14,000+ document types |
The SDK handles the browser flow only. A verification session is a server object: your key creates it, Didit runs the checks and the final status arrives on a signed webhook and in the authenticated decision endpoint. Treat the browser callback as a user-experience signal and the webhook as the record.
Prerequisites before you write code
| Requirement | Why it matters | Where it lives |
|---|---|---|
| A Didit account and an organization | Holds workflows, API keys and every session | business.didit.me |
| A published workflow | POST /v3/session/ requires a workflow_id, and the workflow type decides whether the session is a user or business verification | Workflows in the Business Console |
| An API key | Sent as the x-api-key header on server calls. Keep it on the server and out of the client bundle | Your organization in the Business Console |
The read:sessions privilege | The decision endpoint returns 403 without it | Key permissions |
| A server endpoint you control | Creates the session and receives webhooks, so the key never ships in the bundle | Your app |
| A webhook destination | Signed decisions in real time | POST https://verification.didit.me/v3/webhook/destinations/ |
| A plan | Free is $0 a month. The first Free organization created with an eligible company-domain work email receives $10 of credit a month; phone codes are excluded. Growth is $99 a month, Scale is $299 a month, and Enterprise is from $15,000 a year | didit.me/pricing |
Two integration choices: JavaScript SDK or hosted redirect
Pick the JavaScript SDK for the flow inside your React app, or use the hosted redirect when you want the browser to leave your page. You can use the iframe route when you need an embedded screen. The public repository includes React examples.
- JavaScript SDK. Install
@didit-protocol/sdk-weband read the JavaScript SDK guide plus the SDK web examples. This is the route we recommend for production web apps because you get event callbacks and control over the flow. - Hosted redirect. Create the session with
curland redirect the browser to the returnedurl. The redirect guide covers it, and the embedded route is documented in InContext.
Add Didit to React in seven steps
- Create the account and the organization. Sign up at business.didit.me with SSO or email and password, then create your organization. Every workflow, key and session lives there.
- Build the workflow. Open Workflows in the sidebar, click New workflow, choose Verifying users, then either Describe it, Start from a template (KYC for standard onboarding) or Start empty. Publish it and copy the workflow UUID. A Simple workflow runs its steps in a fixed order; a node-based one branches on results.
- Register the webhook destination. Send the destination once, then store the returned
secret_shared_keyas an environment secret. Subscribe this handler tostatus.updatedfor the walkthrough.GET /v3/webhook/destinations/{destination_uuid}/returns the secret again if you lose it.
There is no wildcard, so add other event families only if you handle them.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"], "webhook_version": "v3"}' - Verify the signature and apply the status. Read the raw request body before parsing JSON, check that
X-Timestampis within 300 seconds of now, recompute HMAC-SHA256 over the sorted, Unicode-preserved canonical JSON with the destination secret, and compare it withX-Signature-V2in constant time. Accept a constant-time match on either header. CheckX-Signature-V2with the current secret and, when the previous header and secret are available, checkX-Signature-V2-Previouswith the previous secret. In the handler, checkwebhook_typeequalsstatus.updatedbefore applyingstatusto the session whosesession_idmatches. Thedecisionobject is present for Approved, Declined, In Review and Abandoned. De-duplicate onevent_id, answer 2xx within 5 seconds, and use the authenticated decision endpoint when you need the current decision. - Create the session from your backend. One call, with your key on the server and never in the browser bundle. Replace
YOUR_WORKFLOW_UUIDwith the workflow UUID from the Workflows page before you run the command:
The response containscurl -X POST https://verification.didit.me/v3/session/ -H "x-api-key: $DIDIT_API_KEY" -H "Content-Type: application/json" -d '{"workflow_id": "YOUR_WORKFLOW_UUID", "vendor_data": "user-42", "callback": "https://myapp.com/kyc/return"}'session_id,urlandsession_token. Return theurlto the browser. - Install the SDK and start the flow. Run
npm install @didit-protocol/sdk-web, then wire two things in a client component: theonCompletehandler and a call tostartVerificationwith theurlfrom step 5.import { useEffect, useRef } from 'react'; import { DiditSdk } from '@didit-protocol/sdk-web'; export function VerifyButton({ sessionUrl }) { const buttonRef = useRef(null); useEffect(() => { const button = buttonRef.current; if (!button) return; function handleClick() { 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: sessionUrl }); } button.addEventListener('click', handleClick); return () => button.removeEventListener('click', handleClick); }, [sessionUrl]); return <button ref={buttonRef}>Verify identity</button>; }The effect runs when the component mounts and again whenever
sessionUrlchanges. Clicking the button attaches theonCompletehandler with the result switch and then callsDiditSdk.shared.startVerification({ url: sessionUrl }), wheresessionUrlarrives as a prop from your server. The cleanup removes the click listener, and nothing runs at module scope. The result type is one ofcompleted,cancelledorfailed. In a Next.js App Router project, keep this component on the client side, because the SDK opens the flow in the browser. - Keep the decision call for the current decision.
GET /v3/session/{session_id}/decision/returns the current decision object. Branch onsession_kindbefore you read feature fields, because a business session returns registry arrays and a user session returns identity arrays. The webhookdecisionobject is present for Approved, Declined, In Review and Abandoned.Set
DIDIT_SESSION_IDto thesession_idreturned in step 5, then run:curl "https://verification.didit.me/v3/session/${DIDIT_SESSION_ID}/decision/" -H "x-api-key: $DIDIT_API_KEY"

Field and event mapping
| Didit field or event | Where it appears | How your app uses it |
|---|---|---|
workflow_id | Body of POST /v3/session/ | Include the workflow UUID in the server's create-session request |
vendor_data | Request body, echoed in the webhook | Pass your own user id so the decision reaches the right record |
callback | Request body | Return URL. Didit appends ?verificationSessionId={session_id}&status={status} |
url | Create-session response | Pass it as the url field in startVerification({ url: sessionUrl }) |
result.type | onComplete | Route the UI on completed, cancelled or failed |
result.session?.sessionId, result.session?.status | onComplete | Update local state, then wait for the signed webhook before you grant access |
status.updated | Webhook, webhook_type | The authoritative status: Approved, Declined, In Review, In Progress, Not Started, Expired, Abandoned, Kyc Expired, Resubmitted or Awaiting User |
event_id | Webhook envelope | Idempotency key for your handler |
environment | Webhook envelope | Check environment before writing records and route sandbox events to test records |
session_kind | Decision object | Branch between user and business before reading feature arrays |
id_verifications[], liveness_checks[], face_matches[], aml_screenings[] | Decision object | The decision uses plural fields for checks that ran. A field can be absent or null when its check did not run |
Test with sandbox data
A sandbox application is a per-application mode, the same idea as test mode on a payment processor. Every external provider is mocked, sessions are never billed, the balance check is bypassed and the per-application quota is 500 session creates per 24 hours. Liveness still runs for real, so the capture experience you test is the one your users get.
Create a session with sandbox_scenario in the body to reproduce an outcome. The scenario slugs come from GET /v1/sandbox/scenarios/, read with the same x-api-key. If the session is still Not Started, you can arm or re-arm it with POST /v3/session/{session_id}/sandbox/arm/. Webhooks from the sandbox carry "environment": "sandbox" and the armed slug in sandbox_scenario.
Use specimen documents. Outcomes never depend on the pixels, but captured media is stored for real, exactly like a live session.
| Scenario | What the signed status says | What the app should do |
|---|---|---|
| Approved | Approved | Grant access only after the signed webhook or decision call confirms Approved |
| Declined | Declined | Show the next step. Assert the Declined status; do not assume a reason field |
| In Review | In Review | Show a waiting state and do not grant access |
Expected success. For an approval scenario, assert that the signed status.updated event reports Approved. Test the SDK completion callback separately. Your app should grant access only after the signed webhook or authenticated decision endpoint confirms Approved.
Expected failure shapes. A decline scenario comes back as Declined, not as an HTTP error. A review scenario comes back as In Review and shows up in the console for a person to look at. Your React code should treat all three outcomes as normal answers, not as exceptions.

Error cases and fixes
| Symptom | Likely cause | Fix |
|---|---|---|
403 {"detail": "You do not have permission to perform this action."} on verification.didit.me | Missing API key, or the key lacks read:sessions | Send the x-api-key header and check the key's privileges |
401 | Wrong, revoked or expired key | Issue a new key and redeploy |
400 on workflow_id | The workflow id is not a valid UUID for this application | Copy the UUID from the Workflows page of the same organization |
400 on callback | The URL is not on the application's allowed domains | Add the callback origin to allowed_domains, or omit callback and use a workflow default that meets the application's allowed-domain rules |
404 {"detail": "Not found."} | The session does not exist or belongs to another application | Check that session_id and the key come from the same application |
| Webhook delivery fails | The handler answered 5xx or 404, or took longer than 5 seconds | Didit retries twice, after about 1 and 4 minutes, then drops the delivery. Resend it from the destination's delivery log |
| Signature check fails after rotation | The destination signing secret may have rotated | Compare in constant time using the current secret with X-Signature-V2 and the previous secret with X-Signature-V2-Previous when available. Didit sends the previous signature for 24 hours after rotation |
| The iframe shows no camera | The allow attribute is missing | Include allow="camera; microphone; geolocation; clipboard-write; fullscreen; autoplay; encrypted-media; digital-credentials-get" |

Disconnect Didit from your React app
On the application side, remove the SDK call from your component and remove @didit-protocol/sdk-web from your dependencies. Check whether the Didit webhook destination still points at the endpoint you plan to retire. If it returns HTTP 404, Didit retries delivery twice before dropping it.
What React identity verification costs, on both ends
The browser end is free. The SDK, Workflow Orchestrator and MCP server are free. The Didit end is paid per completed check, drawn from prepaid credit, and the sandbox never bills.
Worked example at 5,000 completed full KYC checks in a month, using only published unit prices.
- List price: 5,000 × $0.33 = $1,650.00.
- Scale unit price: 5,000 × $0.297 = $1,485.00.
- Scale credit is $350 a month for the $299 fee, so the top-up you need is $1,485.00 - $350.00 = $1,135.00.
- Monthly payment at this volume: $299.00 + $1,135.00 = $1,434.00. The Scale example assumes all $350.00 of monthly credit is available, the full volume falls in one billing month, and there is no existing top-up balance. That is $216.00 less than the $1,650.00 gross list-price usage.
- Add AML screening and the check becomes $0.53 per completed check, which is $0.33 for full KYC plus $0.20 for AML screening: 5,000 × $0.53 = $2,650.00 at list.
- A Free organization that qualifies receives $10.00 of credit each month, so the first $10.00 of usage is covered. The $10 applies to the first Free organization created with an eligible company-domain work email; phone codes are excluded.
For full KYC, Growth is $99 a month with $115 of credit and a discounted rate of $0.3168 per check; Scale is $299 a month with $350 of credit and $0.297 per check. Plan discounts have published exceptions, including transaction monitoring beyond the plan allowance. Credit resets monthly and does not roll over, while top-ups last 12 months. Enterprise starts at $15,000 a year.
Sources
- Didit docs: Web identity verification SDKs overview
- Didit docs: JavaScript SDK
- Didit docs: InContext iframe
- Didit docs: Web redirect
- Didit docs: Quick start
- Didit docs: Create session API
- Didit docs: Retrieve session decision API
- Didit docs: Webhooks and HMAC signing
- Didit docs: Sandbox test data
- Didit docs: Pricing and billing rules
- Didit pricing page and pricing as JSON, read November 26, 2026
- Didit full product facts, read November 26, 2026
- GitHub: SDK web examples and iframe example
- Didit MCP server and integration prompt
Start in the sandbox with no sales call: create your organization at business.didit.me, build a KYC workflow, create one session and watch the webhook arrive before you touch production.
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
Is there an official Didit SDK for React?
Yes. The JavaScript SDK is published as @didit-protocol/sdk-web and the documentation lists React, Next.js, Vue, Angular, Nuxt and Svelte support, with React examples in our public repository. It supports modal and inline modes plus event callbacks. It is separate from the authentication packages @didit-protocol/auth and @didit-protocol/auth-react, which handle end-user sign-in.
How do I add identity verification to a React app with Didit?
Create a workflow in the Business Console, then create a session server-side with POST https://verification.didit.me/v3/session/ using your API key and the workflow UUID. Pass the returned url into DiditSdk.shared.startVerification({ url: sessionUrl }) inside a client component, and take the final status from the signed webhook or the decision endpoint. The key stays on the server.
Do I need a backend for React KYC integration?
The SDK docs list the backend as optional, and UniLink is the documented option without an app backend. In a React app you still want a server for creating API sessions and receiving webhook decisions, because the API key must not reach the browser and the authoritative decision arrives by webhook. A pattern that works: the client asks your server for a session URL, your server calls Didit, and your server receives the webhook.
How much does a React KYC check cost with Didit?
A full KYC check is $0.33 at list price, made 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 same check is $0.3168 on Growth and $0.297 on Scale. The SDK and the Workflow Orchestrator are free and the sandbox never bills.
How do I test a React Didit integration without real identity documents?
Create a sandbox application, then pass sandbox_scenario when you create a session, using a slug from GET /v1/sandbox/scenarios/. Every external provider is mocked, sessions are never billed and webhooks carry "environment": "sandbox". Liveness capture runs for real, so you test the actual screens. Use specimen documents because captured media is stored even though outcomes are simulated.
What is the difference between onComplete and the webhook in React?
onComplete fires in the browser and reports completed, cancelled or failed, which is enough to move the user to a waiting screen. Signed status.updated webhook events report status changes to your server, and the authenticated decision endpoint returns the current decision. Grant access only when the signed webhook or the authenticated decision endpoint reports Approved.
What should my React app do when the browser callback fires?
Use the callback to move the user to a waiting or result screen, then wait for the signed webhook. Didit appends ?verificationSessionId={session_id}&status={status}. The webhook decision object is present for Approved, Declined, In Review and Abandoned; use the authenticated decision endpoint when you need the current decision.
Which session statuses should my React UI handle?
The exact case-sensitive values are Approved, Declined, In Review, In Progress, Not Started, Expired, Abandoned, Kyc Expired, Resubmitted and Awaiting User. Note the single capital K in Kyc Expired. In Review and Awaiting User mean a person or the user still has to act, so show a waiting state rather than a failure.
How do I verify the Didit webhook signature in a React or Next.js app?
Read the raw body before parsing JSON, confirm X-Timestamp is within 300 seconds, then recompute HMAC-SHA256 over the sorted, Unicode-preserved canonical JSON with the destination's secret_shared_key and compare it to X-Signature-V2 in constant time. Compare in constant time using the current secret with X-Signature-V2 and the previous secret with X-Signature-V2-Previous when available. Didit sends the previous signature for 24 hours after a secret rotation. Answer 2xx within 5 seconds and de-duplicate on event_id.
Can an AI assistant build the Didit React integration for me?
A coding assistant with MCP support can connect to the Didit MCP server at didit.me/developers/mcp and use the official integration prompt at didit.me/developers/integration-prompt. The MCP server is free and hosted at https://mcp.didit.me/mcp with OAuth sign-in. Review the output against the docs before you ship.
Why does my create-session call return 400 on the callback URL?
When an application has allowed domains, any http or https callback must match one of those origins on scheme, host and port, otherwise creation fails with a 400 on callback. Add the callback origin to allowed_domains, or omit callback and use a workflow default that meets the application's allowed-domain rules. Custom app schemes such as deep links are always accepted.
Is there a separate endpoint for business verification in React?
No. POST /v3/session/ is a unified endpoint, and the workflow type decides whether the session is a user verification or a business verification. On the way back, branch on session_kind: user sessions return identity arrays, business sessions return registry_checks and key_people_checks.
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


