Server SDK
Didit .NET SDK for identity verification
Create sessions, read decisions and verify webhooks from your C# server. One NuGet package, with async calls and dependency injection.
dotnet add package Didit
Integrate Didit in Your App: API, SDK and Webhooks (Developer Guide) · 8 min · YouTube
Install
Install and set your key
Install the package, then set one environment variable.
Environment variables
DIDIT_API_KEYNeeded for every call.DIDIT_ORGANIZATION_IDNeeded for calls scoped to an organization, such as cases, networks and regulatory reports.DIDIT_APPLICATION_IDNeeded for the same calls, to pick the application.new DiditClient() reads DIDIT_API_KEY on its own. Pass DiditClientOptions only to override it. Create one client and reuse it. Keep the key on your server.
dotnet add package Didit# Every callexport DIDIT_API_KEY="sk_test_..."# Calls scoped to an organization and an application,# such as cases, networks and regulatory reportsexport DIDIT_ORGANIZATION_ID="..."export DIDIT_APPLICATION_ID="..."# ASP.NET Core dependency injectiondotnet add package Didit.Extensions.DependencyInjection
Create a session
Create a session
A session is one run of your checks for one person. One call returns the URL to send your user to.
What you send
workflow_idThe workflow to run. A workflow is the set of checks a session runs.vendor_dataYour own user ID. Didit returns it with every result.callbackThe page Didit sends the user to after the flow.What you get back
session.Urlhttps://verify.didit.me/session/3FaJ9wLqX2MzSend your user hereOpen the URL on the web. The response also carries a session token for the native SDKs.
using System;using Didit;using var client = new DiditClient();var session = await client.Sessions.CreateAsync(new SessionsCreateParams{ WorkflowId = "11111111-2222-3333-4444-555555555555", VendorData = "user-123", Callback = "https://example.com/verification/done",});Console.WriteLine(session.Url);
Webhook
Verify the webhook
A webhook is a message Didit sends to your server when a result is ready. One call checks that it is real.
DiditWebhooks.Verify throws WebhookVerificationException for anything that is not a valid, fresh delivery.SessionStatusUpdatedEvent.StreamReader and pass name => request.Headers[name].FirstOrDefault().new[] { newSecret, oldSecret }using System;using Didit;var secret = Environment.GetEnvironmentVariable("DIDIT_WEBHOOK_SECRET") ?? "";int HandleWebhook(string rawBody, Func<string, string?> header){ try { var evt = DiditWebhooks.Verify(rawBody, header, secret); if (evt is SessionStatusUpdatedEvent updated) { Console.WriteLine($"{updated.SessionId} {updated.Status}"); } return 200; } catch (WebhookVerificationException error) { Console.WriteLine($"rejected: {error.Reason}"); return 400; }}
Requirements
What you need
Six facts about the SDK.
Didit on NuGet. On .NET Framework, use C# 11 or later.async.Didit.Extensions.DependencyInjection and register the client with services.AddDidit().required, so a missing one fails to compile. Optional ones you leave unset are not sent.DiditWebhooks.Verify checks the signature and the age of each event.Questions
Questions about the .NET SDK
Which .NET versions does the SDK support?
Does the .NET SDK support dependency injection?
How do I verify a webhook in C#?
How do I install the Didit .NET SDK?
Does the .NET SDK retry failed requests?
How do I handle API errors in C#?
What happens if I leave out a required request field in C#?
How do I verify a webhook in ASP.NET Core?
Which calls need the organization and application ids?
How are the Didit .NET SDK versions numbered?
Compliance built in
Audited, certified and attested.
We hold the certifications and build each country's rules into your flows, so you can launch anywhere without worrying. Security and Compliance center
- Regulation encoded into your flows
Tell us what you do and where. Didit lists the rules that apply to you, with sources, and builds the checks each country needs into one workflow.
- Ready for AMLR
Every requirement of the new EU anti-money laundering rules, from checking customers to human review, is already covered by a Didit check.
- Trusted by EU regulators
After a year of supervised testing, EU financial regulators confirmed that verifying with Didit is safer than checking an ID in person.
- Audited, not self-declared
iBeta Level 1 and Level 2. Liveness tested under ISO/IEC 30107-3.
Your obligations · 3 regions
SOC 2 Type 2
ISO 27001
iBeta Level 1 and Level 2
EU regulator attestation
FSM youth protection
GDPR
EBA remote onboarding
MiCA compatible
FIDO Alliance member
- AMLREU AML Regulation ready
Integration · Didit MCP
Run Didit from your own AI agent
Connect Didit to Claude, Cursor, VS Code or ChatGPT and just ask in plain words. Your agent can do anything you can do in the console, with the same permissions you have.
- Build workflowsDescribe the checks you need. The agent creates and publishes the flow.
- Run investigationsAsk why a session was declined, review cases, search people and companies.
- Change rulesCreate payment rules, test them on past data and switch them on.
- Pull reportsAsk for numbers, exports or the audit log.
Didit Academy
Learn Didit, one short video at a time
Start
Install the SDK
Create an account, get your sandbox key and add the package.
Free sandbox. Credit applies to work-email sign-ups.