vin or bank_account_number, so the service pages that send them show cURL only.
Install
Configure
Every SDK reads the same environment variables, so a client created with no options is ready to use. Edge runtimes have no process environment: there, pass the API key to the Node.js client as an option.
Anything you can set through the environment you can also pass to the client, along with the base URL, timeout, retries, default headers and your own HTTP client. Create one client per process and share it: it keeps a connection pool and is safe to use from several threads or tasks.
The
account methods (programmatic registration: register, sign in, organizations and applications) call https://apx.didit.me/auth/v2 and never send your API key. Sign in with account.login, then pass the returned access token to the client as its account token.
What every SDK does
- Resources and methods. Calls follow the API’s resources:
client.<resource>.<method>(...), for examplesessions.create,sessions.retrieve_decisionortransactions.create, in each language’s own case. Path ids are positional arguments; the body and the query are one set of named fields. Python, Node.js, PHP and Ruby use the API’s own field names (workflow_id); Go, Java and .NET use their language’s case (WorkflowID,workflowId,WorkflowId). - Lists. List methods page through every result for you (
limitandoffsetunderneath), and also expose each page withcount,next,previousandresults. In Ruby,auto_paging_eachgoes through every page, and a page’stotal_count,next_urlandprevious_urlare the API’scount,nextandprevious. - Files. Uploads (document images, selfies, proof of address, imports) accept a path, bytes or a stream. Downloads (session PDFs, reports) return bytes or a stream, never parsed JSON.
- Forward compatibility. A response field or an enum value the SDK version does not know yet is kept and readable, never an error, so an API addition does not break a deployed integration.
- Webhooks.
webhooks.verifychecks theX-Signature-V2andX-Signatureheaders and the timestamp of a delivery with your webhook secret, and returns a typed event. It accepts a list of secrets while you rotate one. See Webhooks for the signature scheme. - Authentication. An
Authenticationhelper verifies the access and ID tokens your Authentication issuer signs, and calls its token, session and step-up endpoints. It never uses your API key.
Errors, retries and timeouts
Every error derives from
DiditError. In Go, every error implements the didit.Error interface and is a pointer type such as *didit.NotFoundError. Java, PHP and .NET name them with their usual Exception suffix and write API as Api: DiditException, ApiStatusException, NotFoundException.
The SDKs retry a failed request up to 2 times, with exponential backoff from 0.5 seconds (full jitter, at most 8 seconds) and honouring Retry-After. GET, HEAD, PUT and DELETE are retried on connection errors, timeouts, 408, 429 and 5xx. POST and PATCH are retried only on 429 or when the connection failed before the request was sent, so a retry never creates a second session or transaction. The default timeout is 60 seconds. Every response also exposes the raw HTTP status, headers and request id. See Rate limiting for the limits behind 429.
Versioning and support
- The SDKs follow semantic versioning. When an endpoint leaves the API or its method is renamed, the old method stays for at least one more minor version, marked deprecated, so your code keeps building while you move to the new one.
- They are generated from the published API contract (
openapi-25.jsonandopenapi-auth.json) and check it every day, so a new endpoint or field arrives in a regular release of all seven SDKs. - Each SDK supports the minimum runtime in the table and every newer release. Its tests run on the minimum and on each newer release, or each long-term support release for Node.js and Java.
- Each repository’s
CHANGELOG.mdlists the changes of every release. - Report a security issue privately through the SDK repository’s security advisories or to support@didit.me.