Skip to main content

Didit Node SDK: Identity Verification Integration Reference

Didit's Node SDK (@didit-protocol/sdk-node) is free. Install it, configure a server-side API key, create a session, verify X-Signature-V2 webhooks and read the decision. A full ID check costs $0.33; sandbox is free.

Didit Node SDK: Identity Verification Integration Reference

Contents

In this guide

Jump to the part you need.

The Didit Node SDK is @didit-protocol/sdk-node, published on npm and free to use. It fits a Node backend that creates sessions, verifies webhooks and reads decisions. We provide typed requests and responses, verification for the webhooks we send, and Didit Authentication token checks. A full ID check costs $0.33 and sandbox testing is free. The caveat: never ship this SDK to a browser or mobile bundle, and your runtime needs fetch, so Node 18 or newer.

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

Ways to call Didit from a Node backend

Choose the Node SDK or the REST API for backend calls. MCP is a separate assistant integration for compatible OAuth clients.

Ways to integrate Didit from a Node team
RouteWhat it isCommand or endpointPrice
Node server SDKOfficial typed client for the server APIs, with webhook signature verification and Authentication token checksnpm install @didit-protocol/sdk-nodeFree
REST API directlyThe same server endpoints called with fetch or curl, no SDK layerPOST https://verification.didit.me/v3/session/$0.33 per completed full ID check in a workflow. Standalone API calls use their own published prices.
MCP connectorSeparate assistant integration for compatible OAuth clients, for exploration and assistant-driven setupdidit.me/developers/mcpFree

Coverage differs by route. Node SDK 1.0.1 lacks the two Google Wallet endpoints and the 16 Database Validation request fields added after generation. Use the documented REST calls for those cases. The REST API is the full server surface.

The Node package supports Node.js 18, Bun, Deno and edge runtimes that expose fetch.

Prerequisites: plan, client and permissions

What you need before the first Node call succeeds
RequirementDetailWhere
PlanFree includes $10 of monthly credit for the first eligible organization created with an eligible work email for a company domain, and phone verification codes are excluded. Growth is $99 a month with $115 credit and 4% off Didit prices. Scale is $299 a month with $350 credit and 10% off Didit prices. Plan discounts apply to Didit prices; carrier and Meta charges pass through at cost. Enterprise is a custom annual contract from $15,000 a year. Sandbox is free and unlimited on every plan.didit.me/pricing
ClientNode.js 18 or newer, Bun, Deno, or an edge runtime with fetch.Your runtime
Package@didit-protocol/sdk-node from npm, source at github.com/didit-protocol/sdk-nodenpm install
API keyAn Application key. Newly issued sandbox keys start with sk_test_ and live keys with sk_live_, each followed by 43 URL-safe characters. Older keys have no prefix and keep working, so use the key from your sandbox Application regardless of prefix.Business Console, Developers then API keys
WorkflowThe create call needs a stable workflow UUID. Copy the sandbox workflow from your sandbox Application. The API lists workflows at /v3/workflows/, and the create field is workflow_id.Business Console workflow or /v3/workflows/
PermissionsThe decision endpoint requires the read:sessions privilege. A scoped key without access to a resource returns 403, and a key called from an address outside its IP list returns 403 too.Console, API keys
EnvironmentDIDIT_API_KEY for every key call. DIDIT_ORGANIZATION_ID and DIDIT_APPLICATION_ID for organization-scoped routes such as cases, networks and regulatory reports. DIDIT_LOG=debug logs method, path, status, duration and request id, never bodies or headers.Your process environment

Didit Node setup: seven steps from install to decision

  1. Create or copy the API key. Sign in to the Didit Business Console, pick the Application from the dropdown at the top, open Developers then API keys, and copy the Primary key or create a scoped key for the service. Keep it server side. If you prefer to skip the console, a coding agent can register an organization programmatically: POST https://apx.didit.me/auth/v2/programmatic/register/ emails a 6-character code with a 10 minute TTL, and POST https://apx.didit.me/auth/v2/programmatic/verify-email/ returns both applications inline. Persist sandbox_application.api_key first and build against it.
  2. Install the package. In the service that holds the key:
    npm install @didit-protocol/sdk-node
  3. Set the environment. A client created with no options reads these variables and is ready to use.
    export DIDIT_API_KEY='<SANDBOX_API_KEY>'
    export DIDIT_LOG=debug
    The second line is optional. Edge runtimes have no process environment, so there you pass the API key to the Node client as an option. Share one client per process. It keeps a connection pool and supports concurrent use.
  4. Create the session. The workflow UUID decides whether this is a user verification or a business verification. There is no separate endpoint for KYB. Copy the sandbox workflow UUID from your sandbox Application and pass it as workflow_id. Use the documented REST call for the create request. vendor_data is optional and strongly recommended. A stable value binds sessions to the same user or business and drives duplicate detection. Save the session_id returned by the create call.
    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/return"}'
  5. Send the user to the hosted flow. The user completes the steps in our hosted UI, in the language you pass as an ISO 639-1 code or the one the browser reports. If an eligible callback is configured, we redirect when the flow finishes and append ?verificationSessionId={session_id}&status={status}. The workflow default can supply the URL when you omit callback, and the default callback_method is initiator. If the Application has allowed domains configured, an http or https callback must sit on one of those origins or creation fails with 400. Custom schemes such as app deep links are always accepted. If you need the hosted URL, call GET /v3/session/{session_id}/decision/ with a key that has read:sessions and redirect the user to the returned session_url. Use a verified webhook or the decision endpoint to determine the verification outcome.
  6. Verify the webhook. Point a POST endpoint at your service. Preserve the raw body. Require a valid X-Timestamp within 300 seconds of the current time. Compute HMAC-SHA256 over the sorted, Unicode-preserved canonical JSON using the current destination secret. Compare the computed signature with X-Signature-V2 in constant time. If X-Signature-V2-Previous is present and you have the replaced secret, recompute with that secret and compare with the previous header in constant time. Accept either valid signature before processing the payload. Process the event only after successful verification, return 2xx fast and update state idempotently. Avoid X-Signature-Simple: it is deprecated and authenticates the envelope only, so if you rely on it, re-fetch the decision instead of trusting the payload.
  7. Read the decision and branch. Read the result from GET https://verification.didit.me/v3/session/{session_id}/decision/. Always branch on session_kind and handle absent or null feature arrays:
    const decision = await (await fetch(url, { headers: { "x-api-key": API_KEY } })).json();
    
    switch (decision.session_kind) {
      case "user": return handleUserDecision(decision);
      case "business": return handleBusinessDecision(decision);
    }
    See the full decision schema for every nested field.

Node SDK methods and fields

Calls follow the API resources: client.<resource>.<method>(...), for example sessions.create, sessions.retrieve_decision or account.login, in each language's own case. Path ids are positional arguments and the body plus query are one set of named fields. The Node client uses the API's own field names, so workflow_id stays workflow_id.

Server routes behind the Node integration
You want toREST routeNotes
Start a verificationPOST /v3/session/Workflow type decides KYC or KYB
Read the resultGET /v3/session/{session_id}/decision/Needs read:sessions
Sign in programmaticallyPOST https://apx.didit.me/auth/v2/programmatic/login/Never sends your API key; pass the returned token as the account token
Session request fields the Node integration sets most often
FieldTypeWhat it does
workflow_idUUID, requiredStable workflow UUID from /v3/workflows/
vendor_datastring, optionalYour stable identifier for the user or business; strongly recommended because it binds sessions to the same entity and drives duplicate detection
callback and callback_methodURL, stringWhere to redirect; method is initiator, completer or both
metadataobjectEchoed back in responses and webhooks, never shown to the user
tagsarray of stringsUp to 10 tags, 50 characters each, filterable in the Console
session_expiration_timeintegerSeconds, 3600 to 2419200, overrides the workflow setting for this session
expected_detailsobjectPerson fields for KYC, or company_name, registry_country and registration_number for KYB
sandbox_scenariostringSandbox applications only; rejected with 400 on live ones

Webhook destinations subscribe by exact event type, and there is no wildcard, so list every family you need. For the verification flow, register status.updated for session status changes and data.updated when verification data is edited. Entity events such as business.status.updated and business.data.updated, transaction events such as transaction.created and transaction.status.updated, and travel_rule.status.updated are options for integrations that use those features. Session payloads carry session_id, status, webhook_type, application_id, environment, sandbox_scenario, workflow_id, vendor_data and, only when the status is Approved, Declined, In Review or Abandoned, the full decision object. KYB payloads add business_session_id and session_kind.

Status strings are case sensitive and include spaces. Treat this list as the enum: Not Started, In Progress, Approved, Declined, In Review, Awaiting User, Resubmitted, Expired, Abandoned and Kyc Expired, where the last one uses a single capital K. Compare with strict equality and never with a case-insensitive match.

A verification session overview in the Didit Business Console showing its status and warnings
The same session your Node code reads through the decision endpoint, with the warnings that produced an In Review status.

Test with sandbox data: one reproducible case

Use your sandbox Application's API key. Sandbox testing is free and unlimited, and every check is mocked.

  1. List the available scenarios with GET /v1/sandbox/scenarios/. Each entry has a slug.
  2. Use the documented slug decline_aml_hit for this case.
  3. Pass that slug as sandbox_scenario on create. The scenario expands its bundled magic values onto contact_details and expected_details so the session reproduces the outcome.
  4. To change the outcome after create, call POST /v3/session/{session_id}/sandbox/arm/ while the session is still Not Started.

Expected result for decline_aml_hit. The session should reach Declined. The webhook should show environment as sandbox and sandbox_scenario as decline_aml_hit. Check the webhook's top-level status, then inspect decision_trace inside the decision object, or retrieve the decision directly. Use the exact status expected by the armed scenario as your sandbox assertion, not a generic terminal status.

Use the request ID from DIDIT_LOG=debug to trace API calls. In the decision response, status_override records whether a reviewer overrode the automatic status, and decision_trace shows how the current status was reached.

Walkthrough of the verification screens an end user sees from start to finish
What the person on the other side of your session sees, screen by screen, before your callback fires.

Error cases and fixes

Common failures when calling Didit from Node, and the fix
SymptomStatus and bodyFix
Key rejected401 on verification.didit.meThe x-api-key header is wrong, malformed, revoked or expired. Re-fetch the key, or issue a new one under Developers then API keys
No header or no scope403A missing x-api-key header, a scoped key without access to this resource, or a call from an address outside the key's IP list. Send the header, use a key with the required privilege, or call from an allowed address
Application was deleted403 with code application_deletedDo not retry. After a few minutes the key is refused like any invalid key. Use a key of an existing application
Decision missing404 with detail Not foundA 404 can mean the session does not exist, belongs to a different application, or falls outside the key's allowed workflows or statuses. Use a key whose limits include that session
Callback rejected400 naming the allowed domainsAdd the origin to allowed_domains with PATCH /v3/webhook/, or use a custom scheme deep link
Scenario refused400 on sandbox_scenarioYou armed a scenario on a live application. Use the key from your sandbox Application
Too many requests429 with a wait field in secondsBack off for that many seconds, then retry. Do not hot loop
Signature mismatchYour own 4xx after HMAC checkPreserve the raw body. Require a valid X-Timestamp within 300 seconds of the current time. Compute HMAC-SHA256 over the sorted, Unicode-preserved canonical JSON using the current destination secret. Compare the computed signature with X-Signature-V2 in constant time. If X-Signature-V2-Previous is present and you have the replaced secret, recompute with that secret and compare with the previous header in constant time. Accept either valid signature before processing the payload

Disconnect and clean up

Stop making Didit API calls from the Node service and remove its DIDIT_API_KEY. Remove any organization and application IDs configured solely for this integration. Didit sends webhook events to a separately configured destination. Rotation guidance still applies while you change secrets: previous-signature headers are sent for 24 hours after a destination's signing secret is rotated, so deploy verification for both the current and replaced secrets together.

Cost of both ends

What Didit charges and what stays on your side
SideItemPrice
DiditNode server SDKFree
DiditWorkflow Orchestrator and MCP serverFree
DiditSandbox testingFree and unlimited
DiditFull ID check: ID document $0.15, passive liveness $0.10, face match $0.05, device and IP $0.03$0.33 per completed check
DiditAML screening, added to a check$0.20 per check
DiditBusiness verification, priced by country and data tierFrom $2.00 per company for registry retrieval, plus $0.20 company AML, $0.20 per person AML and $0.33 per linked KYC, each billed separately when run
YouNode runtime and hostingYour existing infrastructure, no Didit fee

Billing is per completed check from prepaid credit. Some no-match database lookups and retries are billable; the docs pricing page lists them. Plan credit is added every month and does not roll over. New top-ups are added at face value and last 12 months from the day you add them; balances bought before November 1, 2026 do not expire. Usage draws from the month's plan credit first, then from top-ups.

Explainer on Didit credits, auto-recharge and volume discounts
How credits, plan discounts and top-ups interact, which is what makes the arithmetic below predictable.

Worked cost example: 10,000 KYC checks a month

Assume a workflow that runs the full ID check at $0.33 per completed check, 10,000 completed checks in the month, and no other modules.

  • List price: 10,000 x $0.33 = $3,300.00. On Free, assume an eligible organization with the full $10.00 monthly credit available. $10.00 of credit applies, so top-ups cover $3,300.00 - $10.00 = $3,290.00.
  • Growth at 4% off: $0.33 x 0.96 = $0.3168 per check. 10,000 x $0.3168 = $3,168.00. Plan credit $115.00 leaves $3,053.00 of top-ups, plus the $99.00 monthly fee, for $3,152.00.
  • Scale at 10% off: $0.33 x 0.90 = $0.2970 per check. 10,000 x $0.2970 = $2,970.00. Plan credit $350.00 leaves $2,620.00 of top-ups, plus the $299.00 monthly fee, for $2,919.00.

Add AML screening to the same 10,000 checks and the list-price line becomes 10,000 x ($0.33 + $0.20) = 10,000 x $0.53 = $5,300.00.

Sources

Open the Didit Business Console, copy your sandbox Application key and run one scenario. The sandbox is free, and you can start without a 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

Alberto Rosas

Co-founder and CEO

Alberto Rosas

Alberto Rosas

Co-founder and CEO

About Didit

Questions

Frequently asked questions

What is the npm package name for the Didit Node SDK?

The package is @didit-protocol/sdk-node, installed with npm install @didit-protocol/sdk-node. The source lives at github.com/didit-protocol/sdk-node. It is one of seven official server SDKs, alongside Python, Go, Java, PHP, Ruby and .NET.

How much does the Didit Node SDK cost?

The SDK itself is free, and so are the Workflow Orchestrator and the MCP server. You pay per completed check: $0.33 for a full ID check, $0.20 for AML screening, from $2.00 per company for business verification. Sandbox testing costs nothing on any plan.

Which Node versions does the SDK support?

Node.js 18 and newer. It also runs on Bun, Deno and edge runtimes that expose fetch. On an edge runtime there is no process environment, so pass the API key to the client as an option rather than relying on DIDIT_API_KEY.

Can I use the Node SDK in a browser or a React Native app?

No. The server SDKs hold your API key, so they belong on the backend only. In the browser or a mobile app, use the web and native SDKs instead. They present the verification flow to your user and never hold your API key.

How do I verify a Didit webhook signature in Node?

Preserve the raw body. Require a valid X-Timestamp within 300 seconds of the current time. Compute HMAC-SHA256 over the sorted, Unicode-preserved canonical JSON using the current destination secret. Compare the computed signature with X-Signature-V2 in constant time. If X-Signature-V2-Previous is present and you have the replaced secret, recompute with that secret and compare with the previous header in constant time. Accept either valid signature before processing the payload.

Why does my create session call return 400 on the callback field?

The Application has allowed domains configured and your callback origin is not on the list, so creation fails with an error naming the permitted domains. Add the origin with PATCH /v3/webhook/, or use a custom URL scheme such as an app deep link, which is always accepted.

Why do I get 403 from the decision endpoint with a working key?

A 403 means the request is understood but not allowed. It can be a missing x-api-key header, a key without the privilege for this resource, or a key called from an address outside its IP list. Fix the header, use a key with read:sessions, or call from an allowed address. A 404 can mean the session does not exist, belongs to a different application, or falls outside the key's allowed workflows or statuses.

How do I test identity verification in Node without paying?

Use the key from your sandbox Application regardless of prefix. Newly issued sandbox keys start with sk_test_, every check is mocked, and testing is free and unlimited. List slugs with GET /v1/sandbox/scenarios/ and pass one as sandbox_scenario on create, or re-arm it later with POST /v3/session/{session_id}/sandbox/arm/ while the session is still Not Started.

Where do I get the sandbox workflow UUID?

In the Business Console, open your sandbox Application and copy the workflow UUID. The API also lists workflows at /v3/workflows/. Pass the value as workflow_id on create.

Does the Node SDK handle KYB as well as KYC?

Yes. There is one session endpoint and the workflow type decides the outcome: a KYC workflow creates a user verification and a KYB workflow creates a business verification. The decision response tells you which one you got through session_kind, which is why you should always branch on that field.

What is the difference between the Node SDK and the native SDKs?

The Node SDK runs on your backend and calls the server APIs with your API key. The web and native SDKs run inside your user's app, present the capture flow and never hold the key. Use the web or native SDK for in-app capture, or send the user to the hosted flow.

Can I move an existing Node integration from another provider to Didit?

Yes. Review session creation, webhook verification and decision mapping against the integration prompt. The switch guide is another starting point. Do not assume field parity: Node SDK 1.0.1 lacks the two Google Wallet endpoints and the 16 Database Validation request fields, so use the documented REST calls for those cases.

Which status strings should my Node switch statement handle?

All ten: Not Started, In Progress, Approved, Declined, In Review, Awaiting User, Resubmitted, Expired, Abandoned and Kyc Expired. They are exact, case-sensitive strings including the spaces, and Kyc Expired uses a single capital K. For In Review, a reviewer can open the session in the Business Console and approve, decline, or request resubmission. Awaiting User in KYB means parties still owe steps, and Resubmitted means the user is redoing steps, so keep listening for later status updates.

Which privilege does the decision call require?

The decision endpoint requires read:sessions. A key without it gets 403. A 404 can mean the session does not exist, belongs to a different application, or falls outside the key's allowed workflows or statuses.

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.