Skip to main content

Add Didit KYC to a Clerk App: 7 Steps (2026)

Clerk handles sign-in. With no documented native connector, use our session API and signed webhooks to gate access. A full KYC check costs $0.33 per completed check.

Add Didit KYC to a Clerk App: 7 Steps (2026)

Contents

In this guide

Jump to the part you need.

This guide is for teams whose sign-up and sign-in already run on Clerk and who need identity verification before a new account gets access. There is no documented native Clerk connector, so you connect Clerk users to Didit through the documented session API and webhooks. A full KYC check is $0.33, the sandbox is free, and the main caveat is that the Didit API key stays on your server.

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

Didit with Clerk at a glance

What the Clerk side and the Didit side each own
ItemAnswer
Native Clerk connector from DiditNone documented. Use the session API plus webhooks.
Price per full KYC check$0.33 (ID document $0.15, passive liveness $0.10, face match $0.05, device and IP analysis $0.03)
SandboxFree and unlimited on every plan. New sandbox keys start with sk_test_.
Free plan creditOn Free, the first organization created with an eligible work email for the company domain receives $10.00 in monthly credit. The credit excludes phone verification codes.
What links a Clerk user to a Didit sessionYour Clerk user id, sent as vendor_data at creation, plus the session_id you record for that verification attempt
Where the decision comes fromSigned webhooks update the status shown to the user. Access comes only from a current decision lookup for the recorded session.
When you grant accessOnly when GET /v3/session/{session_id}/decision/ for the session you recorded returns Approved
Business verification for Clerk organizationsSame API, a KYB workflow instead of a KYC workflow, from $2.00 per company

What you build

Clerk authenticates the account. We check the person's identity before your app grants access to the verified area.

Your server creates a Didit session with the Clerk user id as vendor_data, and it records the returned session_id as the session for that verification attempt. You send the person to the hosted verification URL. We run the checks and send a signed webhook to your endpoint, and your endpoint matches the event to that recorded session and updates the status shown to the user. Before you grant protected access, retrieve the current decision for the recorded session and require Approved.

We serve 4,000+ companies. We support verification across 220+ countries and territories, and the verification flow is available in 54 languages. Inference latency is sub-2-second p99. The flow itself is hosted by us, so the Clerk user leaves your page and comes back to your callback URL.

The liveness step of the hosted Didit flow, with the camera circle tracking the user's face
The hosted flow handles document capture, liveness and face match. Your server receives the verification status through the webhook.

How the Didit and Clerk integration works

The runtime path, and who runs each part
PartWho runs it
Session creation and decision lookupYour server, with the x-api-key header
Hosted verification flowDidit, at the url returned by the create call
Status deliveryWe post signed webhooks to your endpoint
Access gateYour server, on a current decision lookup for the recorded session

There is an optional build-time helper. The Didit integration prompt is the documented resource an assistant can use to write the integration, and the Didit MCP setup page covers the MCP server at https://mcp.didit.me/mcp, which signs in with OAuth. Neither changes the runtime contract: a session, a hosted URL, and a signed webhook. Signed webhooks update the status shown to the user. For each protected request, retrieve the current decision for the user's recorded session and grant access only if its status is Approved.

Academy lesson cover for using Didit with the MCP server
The MCP server and the integration prompt help you build. Runtime traffic still goes through the session API and webhooks.

Prerequisites

What you need before step one
RequirementDetail
Didit planFree works. On Free, the first organization created with an eligible work email for the company domain receives $10.00 in monthly credit. The credit excludes phone verification codes. Sandbox testing is free and unlimited. Growth is $99.00 a month with $115.00 of credit, and Scale is $299.00 a month with $350.00 of credit.
Didit account and applicationAn Organization at business.didit.me, with one Application for the project. Keys are scoped to the Application.
Didit workflowA KYC workflow built in the console from the KYC template. Keep the workflow UUID.
API keyFrom Developers, then API keys, in the console. New live keys start with sk_live_ and new sandbox keys with sk_test_, followed by 43 URL-safe characters. Older keys can have no prefix. Server side only.
Key permissionsThe key that reads decisions needs the read:sessions privilege. A scoped key without it returns 403.
Clerk sideAn app where you can run server code and expose one POST endpoint for the Didit webhook. The Clerk user id is the only identifier you need.
Callback originAn https URL on your own domain that the hosted flow can redirect to when the person finishes.

Step by step: adding Didit KYC to a Clerk app

Step 1: Create the Didit Organization and Application

Go to business.didit.me, sign up with SSO or with email and password, and create your Organization. The Organization is where your team manages workflows, API keys and verification activity. Create one Application for the Clerk project so keys and sessions stay separate from anything else you build later.

Step 2: Build the KYC workflow in the console

Open Workflows in the sidebar and click New workflow. Choose Verifying users, then Start from a template and pick KYC. A Simple workflow runs its steps in a fixed order. A Node-based workflow branches on results if you want to send a warning case down a different path.

Before you publish, confirm that the template includes ID verification, passive liveness, face match and Device and IP Analysis. Those four steps are what make a full KYC check $0.33: $0.15 for the ID document, $0.10 for passive liveness, $0.05 for face match and $0.03 for device and IP analysis. Publish, then copy the workflow UUID. It goes into every session you create.

Step 3: Copy the API key

In the console, pick your Application from the dropdown at the top, then open Developers and API keys. The Primary key is the Application's own secret. Copy it into a server-side environment variable, for example DIDIT_API_KEY. Keep DIDIT_LIVE_API_KEY for production and point DIDIT_API_KEY at the sandbox key while you build, because every check in sandbox is mocked and free.

Send the Didit API key in the x-api-key header on server-side requests to verification.didit.me. Treat it as a server-side secret and never ship it to a browser or mobile bundle.

Step 4: Create a session with the Clerk user id

Do this from your server, in the code path that runs after Clerk has told you about the new user. Send the Clerk user id as vendor_data. The create call returns the session_id; record it as the session for this verification attempt, next to the Clerk user id.

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_2c9fExampleClerkId","callback":"https://myapp.com/kyc/return","metadata":{"plan":"pro"}}'

The response contains session_id, url and session_token. Redirect the person to url, or open it in an iframe or WebView. We append ?verificationSessionId={session_id}&status={status} to your callback URL when the flow finishes, so your return page can show the right message.

Two things bite here. If your Application has allowed domains set, the callback origin must be on that list, otherwise creation fails with 400 on callback. And the callback query string is for display only. It is not a verified result, so never grant access from it.

Step 5: Register a webhook destination

Register the destination and store the signing secret before you send the first sandbox user to the hosted flow, so no early delivery arrives without a secret to verify it against. Subscribe at least status.updated. Add data.updated if your team edits verification data in the console and you want to know about it.

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

Store the returned secret_shared_key as DIDIT_WEBHOOK_SECRET. You can read it again with GET /v3/webhook/destinations/{destination_uuid}/. There is no wildcard subscription, so list every event family you want.

Step 6: Verify the signature and dedupe

One header, one algorithm. X-Signature-V2 is HMAC-SHA256 over the sorted, Unicode-preserved canonical JSON of the event, keyed with the destination secret. Verify X-Signature-V2 with the current destination secret. During rotation, verify X-Signature-V2-Previous with the previous secret while it is available; we send it for 24 hours after a destination's signing secret is rotated. Compare in constant time and accept a match on either header.

Both headers use HMAC-SHA256. They differ in what they sign: X-Signature-V2 signs sorted, Unicode-preserved canonical JSON, and X-Signature signs the original request bytes, so the raw-body signature only works if your stack hands you the body untouched. Read the raw body before you parse JSON, because parsing and re-encoding breaks that hash.

Freshness is a separate check. Reject the delivery if X-Timestamp, in Unix epoch seconds, differs from your server clock by more than 300 seconds, even if the signature matches.

Then dedupe on event_id. Apply the update idempotently and record the event_id when the update succeeds. Return 2xx within five seconds for a successfully processed event or a duplicate that was already processed. We retry twice, roughly 1 and 4 minutes after a failed delivery, then drop it, and you can resend from the destination's delivery log.

Step 7: Gate access on the status string

Statuses are exact, case-sensitive strings. Branch on them with strict equality. At session creation, take the Clerk user ID from the authenticated Clerk session and associate it with the returned Didit session_id. In the webhook handler, look up the recorded attempt by session_id and match the signed event's vendor_data, application_id and environment. Use matched status.updated events to refresh the recorded decision, and handle duplicate deliveries by event_id. When a user requests a protected route, use their authenticated Clerk user ID to read the current attempt. Before granting access, retrieve the current decision for the recorded session and require its status to be Approved, so an earlier Approved event arriving after a newer Declined event cannot reopen access. A sandbox approval must never grant production access.

What each Didit status should do in a Clerk-gated app
Didit statusMeaningApp behaviour
ApprovedAll checks passedGrant access and record the verification date
In ReviewWarnings need a humanKeep the account pending until a reviewer decides
DeclinedOne or more checks failedBlock the verified area, offer a resubmission if the failure is fixable
Not Started, In Progress, ResubmittedFlow not finishedKeep the account pending and let the person resume
Awaiting UserKYB only: waiting for one or more parties to finish their own verificationKeep the account pending
Expired, Abandoned, Kyc ExpiredLink timed out, the person never finished, or an approved document passed its expiry dateKeep access closed. A reviewer, or PATCH /v3/session/{sessionId}/update-status/, can move Abandoned or Kyc Expired to Resubmitted. Starting a fresh session instead is your app's choice.

When you need the answer without waiting for a delivery, read the decision for the session you recorded:

curl https://verification.didit.me/v3/session/SESSION_ID/decision/ \
-H "x-api-key: API_KEY"

The returned status answers the access question for that Clerk user, and session_id confirms you read the right attempt. Branch on session_kind first: user for KYC sessions and business for KYB. The V3 decision returns plural arrays: id_verifications[], liveness_checks[], face_matches[], aml_screenings[]. If a feature did not run, the field is absent or null. Never assume singular V2 fields.

A Didit session overview in the Business Console, with the status and any warnings shown at the top
Each session in the console shows its status and warnings, which is where an In Review case gets decided.

Field and event mapping

Didit fields and events, and where each one lands on the Clerk side
Didit field or eventWhat it carriesWhere it goes
vendor_dataYour stable identifier, echoed in responses and webhooksThe Clerk user id, set once at session creation
session_idUUID of this verificationYour own record, keyed by the Clerk user id, one row per attempt
status.updatedEnvelope plus a decision object on Approved, Declined, In Review and AbandonedA notification that updates the recorded status shown to the user
event_idUUID of the event. Use it to deduplicate repeat deliveries.Your dedupe key
statusOne exact string from the status listThe verification state you store and read later
application_id, environmentWhich Didit application sent the event, and live or sandboxMatch both before you change access
metadataArbitrary JSON you sent at creation, never shown to the userYour own flags, for example plan tier or signup source
decision.id_verifications[]Document data, OCR fields, barcodes, warningsServer side only. Do not copy identity payloads into anything the browser can read.
biometric_retention.deletes_atThe date live biometric data for the session is deletedYour retention record, for privacy requests

One rule covers most questions here: the client only ever learns approved, pending or blocked. Every other field stays behind your server.

Test with sandbox data

Sandbox is free and unlimited on every plan. Use the sk_test_ key, create your sessions against the same endpoints, and every check comes back mocked, so you can run the full path without a real ID document.

The sandbox catalog gives you named scenarios. List them with GET /v1/sandbox/scenarios/, then pass a slug as sandbox_scenario on session creation. The scenario expands its bundled magic values onto contact_details and expected_details so the session reproduces that outcome. You can also arm or re-arm a scenario after creation with POST /v3/session/{session_id}/sandbox/arm/, as long as the session is still Not Started. The field is rejected with 400 on a live application.

What success looks like

  • The create call returns session_id, url and session_token, and the URL opens the hosted flow.
  • Completing the flow posts status.updated to your endpoint with environment set to sandbox and the scenario slug in sandbox_scenario.
  • An approved scenario arrives with status equal to Approved and a decision object that carries the result arrays for the steps that ran, for example id_verifications[], liveness_checks[] and face_matches[].
  • Leave one sandbox session unopened and confirm its decision is Not Started. Run a declined scenario from the catalog and confirm its decision is Declined. Both must keep protected access closed.
  • The signature check passes against DIDIT_WEBHOOK_SECRET, and a replayed delivery is ignored because the event_id is already stored.
  • The Clerk user you tested with is marked verified once, not twice, and the event matches the session_id you recorded.

Error cases and fixes

Common failures when wiring Didit behind Clerk
SymptomCauseFix
401 on verification.didit.meThe x-api-key header is wrong, malformed, revoked or expiredUse a valid key, and replace a revoked or expired key with a fresh one from Developers, then API keys
403 on verification.didit.meThe x-api-key header is missing, the key's permission does not cover the requested action, or the call comes from an address outside the key's IP allowlistSend x-api-key, check the key's permission for that action, and check its IP allowlist. Decision retrieval needs read:sessions.
403 with application_deletedThe key's application was deletedDo not retry. Use a key from an application that exists.
400 on session createInvalid workflow_id, or a bad session_expiration_timeCopy the workflow UUID from Workflows, and keep expiry between 3600 and 2419200 seconds
400 saying the callback must be on one of the application's allowed domainsAllowed domains are set and your return URL is not on themAdd the exact scheme, host and port, or use a deep link scheme which is always accepted
404 on the decision routeThe session does not exist, it belongs to another application, or a scoped key does not cover its sessionsCheck that you use the key of the application that created the session, and that the key's limits include that session
429Rate limitBack off for the number of seconds in the wait field, then retry
Webhook delivery failsYour handler answered after more than 5 seconds, or it returned a 5xx or 404 responseWe retry twice, after about 1 and 4 minutes, then drop the delivery. Fix the handler, then resend from the destination's delivery log.
Signature never matchesX-Signature-V2 was computed over JSON that was parsed and re-encoded instead of canonicalized, X-Signature was computed over a parsed body instead of the original request bytes, or the signing secret does not matchCanonicalize the JSON before computing X-Signature-V2, and keep the raw bytes for X-Signature. Verify X-Signature-V2 with the destination's current secret and X-Signature-V2-Previous with its previous secret during rotation.
Timestamp rejectedX-Timestamp is more than 300 seconds from your server clockSync the server clock. A stale timestamp fails the freshness check even when the signature matches.

What Didit KYC costs in a Clerk app

We charge per completed check from prepaid credit.

Published Didit prices that matter for a Clerk sign-up flow
ItemPrice (USD)Unit
Full KYC check$0.33check
ID document only$0.15check
Passive liveness$0.10check
Face match 1:1$0.05check
Device and IP analysis$0.03check
AML screening$0.20check
Ongoing AML monitoring$0.07user per year
White label flow$0.10check
Workflow Orchestrator, MCP server, reusable KYCFreeincluded
Business verification (KYB)From $2.00company

Plans: Free is $0.00 with $10.00 of monthly credit for eligible organizations. Growth is $99.00 a month with $115.00 of credit and discounts the KYC and AML checks in this guide by 4%. Scale is $299.00 a month with $350.00 of credit and discounts them by 10%. Enterprise is a custom annual contract from $15,000 a year. Monthly credit does not roll over, and top-ups last 12 months.

Worked example: 1,000 sign-ups completing KYC and AML

Take 1,000 new Clerk users a month, each completing a full KYC check plus AML screening, on the Growth plan.

  • KYC at the Growth price: 1,000 x $0.3168 = $316.80
  • AML at the Growth price: 1,000 x $0.1920 = $192.00
  • Growth usage total: $316.80 + $192.00 = $508.80
  • Minus the $115.00 of monthly credit included in the plan: $508.80 - $115.00 = $393.80 drawn from top-ups
  • Effective monthly cost: $99.00 plan fee + $393.80 = $492.80
  • Cost per user completing both checks: $492.80 / 1,000 = $0.4928

The list-price usage total before credits is 1,000 x $0.33 = $330.00 for KYC plus 1,000 x $0.20 = $200.00 for AML, so $530.00. The $10.00 of Free plan credit covers 30 completed full KYC checks at $0.33 each, with $0.10 left.

Disconnecting Didit from your Clerk app

  1. Stop creating new Didit sessions: remove the create call from your sign-up path.
  2. Decide how to handle pending attempts before you retire the webhook endpoint.
  3. Remove the Didit credentials from this app.
  4. Follow your organization's retention and deletion requirements for stored verification records. When present, biometric_retention.deletes_at gives the deletion date for the session's live biometric data.

Sources

Start in the sandbox at business.didit.me. It is free, there is no sales call, and you can run your first session against a Clerk test user before you touch a live key.

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

Alberto Rosas

Co-founder and CEO

Alberto Rosas

Alberto Rosas

Co-founder and CEO

About Didit

Questions

Frequently asked questions

How do I add identity verification to a Clerk app?

Your server creates a session with the Clerk user id as vendor_data, then records the returned session_id as the session for that attempt. Your app redirects the person to the hosted url. When the signed status.updated webhook arrives, your server matches it to the recorded session and updates the status shown to the user. Access opens only after a fresh decision lookup for that session returns Approved.

Is there an official Didit integration for Clerk?

There is no documented native Clerk connector. The documented route is the session API plus webhooks, with the Clerk user id carried in vendor_data and the session_id recorded per attempt.

How much does Didit KYC cost per Clerk user?

A full KYC check is $0.33, 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. AML screening adds $0.20. On Growth the same check is $0.3168 and on Scale $0.297.

Where do I store the verification result for a Clerk user?

On your own side, keyed by the Clerk user id, as a small record holding the session_id, the status string and the date. Expose three UI states to the client: approved, pending and blocked. Your server enforces access to protected routes, so the browser never decides. Do not copy document data, liveness frames or AML hits into anything the browser can read.

Can I require identity verification before a user reaches the app?

Yes. Create the session right after the user exists in Clerk, send them to the hosted URL, and keep the verified area closed until the current decision for their recorded session is Approved. The person can still sign in with Clerk, but the gate decides what they see, not the sign-in itself.

Does the Didit API key go in the browser or in Clerk?

Neither. The key is a server-side secret, and the verification API does not use OAuth bearer tokens, it reads the x-api-key header. Keep it in your backend environment, never in a client bundle, a public repository or Clerk configuration that a browser can read.

What happens if a user abandons verification and comes back?

If the session is still valid, send the person back to the same url: Not Started and In Progress both let them resume, and you can check expires_at on the decision. If the session has timed out and the status is Expired or Abandoned, keep access closed and record a new attempt with a new session_id. Starting a fresh session is your app's choice, and a reviewer can also request a resubmission for Abandoned or Kyc Expired.

Which Didit statuses should block access?

Grant access only when the current decision for the recorded session is Approved. Treat In Review, Not Started, In Progress, Resubmitted and Awaiting User as pending, and note that Awaiting User applies to KYB sessions only. Treat Declined as blocked, and keep access closed on Expired, Abandoned and Kyc Expired.

How do I test without real identity documents?

Use your sk_test_ key and the sandbox catalog. List the scenarios with GET /v1/sandbox/scenarios/, pass one as sandbox_scenario when you create the session, and the outcome is reproduced without a real document. Sandbox is free and unlimited on every plan.

Do I need a webhook if the callback already returns a status?

Use signed webhooks for automatic status updates. For each protected request, fetch the current decision from Didit on your server and require Approved for the user's recorded session. Callback parameters arrive through the browser, so use the server-side decision for access and treat the parameters as display hints. Handle the case where the browser never returns.

Can I verify a Clerk organization as a business instead of a person?

Create a session with a KYB workflow. For a Clerk organization, pass its stable organization ID as vendor_data and put company_name, registry_country and registration_number inside expected_details. KYB starts at $2.00 per company for company registry retrieval, and linked KYC and person AML for owners and officers are billed separately. Branch on session_kind in every handler.

Can an AI assistant write this integration for me?

The Didit integration prompt is the documented resource an assistant can use to write the integration: it covers the account, workflow, session, hosted UI, webhook and decision steps. The MCP server at https://mcp.didit.me/mcp signs in with OAuth if your client supports it. Give the assistant your framework and say that the Clerk user id becomes vendor_data.

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.