Install
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.
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.
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
Theauthentication 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:- Validate an address
- Batch delete transactions
- Travel Rule networks: get the networks, request access to a network, and get, save or submit the network questionnaire
- Travel Rule wallet proofs: list the screenshot wallet proofs and approve or reject one
- Google Wallet, which no 1.0.1 release has yet: start a Google Wallet verification and submit a wallet response
biometric_consent,tagsanduser_statewhen it creates a sessionbiometric_consent_modewhen it updates the webhook configurationbeneficiary_vaspwhen it updates a Travel Rule transferconfirm_delete, which deleting a finalized report needs- the 16 newer Database Validation fields that no 1.0.1 release has