Skip to main content
The official Didit module for Go. It needs Go 1.22 or later and uses only the standard library. See the server SDKs overview for what every SDK shares.

Install

The module is github.com/didit-protocol/sdk-go on pkg.go.dev. Its source and changelog are in didit-protocol/sdk-go on GitHub. The package is named didit. Webhooks live in github.com/didit-protocol/sdk-go/webhook, Authentication in .../authentication and client options in .../option. The sample on each API reference page is the body of a function: it uses context, fmt and log from the standard library and this module.

Configure the client

didit.NewClient() reads DIDIT_API_KEY from the environment. Pass options to override it, or to set the organization and application ids that application-scoped calls (cases, networks, regulatory reports) need. Any option also works on a single call.
Optional request fields are didit.Opt values: set them with didit.String, didit.Int, didit.Bool, didit.Float or didit.Some, and leave them out to send nothing.

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 slice with one entry per workflow node.

Verify a webhook

Pass the raw body bytes and the request headers. webhook.Verify returns a *didit.WebhookVerificationError for anything that is not a valid, fresh delivery, and a typed event otherwise.
While you rotate the secret, add the old one with webhook.WithSecrets. 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

The authentication package 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

Lists and files

Endpoints not in the Go SDK yet

Go 1.0.1 was generated before these endpoints were added to the API, so it has no method for them and their pages have no Go sample: It also cannot send these newer request fields: Until a later Go release adds them, call these over HTTP as each page’s cURL request shows. Every other server endpoint page of the API reference has a Go sample for its operation.