Skip to main content
The official Didit library for Java and Kotlin. It needs Java 11 or later and depends only on java.net.http, Jackson and the JSpecify nullness annotations. Every method has an ...Async variant that returns a CompletableFuture. See the server SDKs overview for what every SDK shares.

Install

The artifact is me.didit:didit-java on Maven Central. Its source and changelog are in didit-protocol/sdk-java on GitHub.

Configure the client

new Didit() reads DIDIT_API_KEY from the environment. Use the builder to override it, or to set the organization and application ids that application-scoped calls (cases, networks, regulatory reports) need.
Request types are builders whose build() checks the required fields. Optional response fields are Optional values; in Kotlin, read them with .getOrNull(). The snippets on this page and on each API reference page are the body of a method, with the imports they need above them.

Create a session

Create a verification session for a workflow and send your user to its URL.

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.

Verify a webhook

Pass the raw body, exactly as received, and the request headers. Webhooks.verify throws WebhookVerificationException for anything that is not a valid, fresh delivery, and returns a typed event otherwise.
In Spring Boot, take the body as @RequestBody byte[] body and the headers as @RequestHeader Map<String, String> headers. To accept two secrets while you rotate one, pass VerifyOptions. 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.

Errors

Every exception extends the unchecked DiditException.

Lists and files

Server endpoint pages of the API reference have a Java sample for their operation, except for the endpoints and fields that no 1.0.1 release has yet, named in the overview.