fetch, ships ES module and CommonJS builds, and has no runtime dependencies. See the server SDKs overview for what every SDK shares.
Install
@didit-protocol/sdk-node on npm. Its source and changelog are in didit-protocol/sdk-node on GitHub.
Configure the client
new Didit() reads DIDIT_API_KEY from the environment on Node.js, Bun and Deno (with --allow-env). Edge runtimes have no process environment, so pass the key as an option there: new Didit({ apiKey: env.DIDIT_API_KEY }). Pass options to override it, or to set the organization and application ids that application-scoped calls (cases, networks, regulatory reports) need. The timeout is in milliseconds.
const { Didit } = require("@didit-protocol/sdk-node");.
Create a session
Create a verification session for a workflow and send your user to its URL. Request fields keep the API’s own names.Read the decision
When the user finishes (or when the webhook arrives), read the decision. Every feature result is a list with one entry per workflow node, and date-times areDate objects.
Verify a webhook
Pass the raw body (not parsed JSON) and the request headers: a Node.js or Expressreq.headers object, a Fetch Headers object or [name, value] pairs (the WebhookHeaders type). verify returns a promise and rejects with WebhookVerificationError for anything that is not a valid, fresh delivery.
express.raw({ type: "application/json" }) and call handleWebhook(req.body, req.headers). While you rotate the secret, pass both: [newSecret, oldSecret]. See Webhooks for the events and the signature scheme.
Screen a transaction
Submit a payment, withdrawal or crypto transfer to transaction monitoring; the response carries its status and risk score.Verify Authentication tokens
Authentication checks the access tokens your Authentication issuer signs, in your backend, without calling Didit for each request. It also exchanges codes, refreshes tokens, checks and revokes sessions, and runs step-ups.
Token verification makes the checks in Verify a token on your server, against your application’s issuer and signing keys.