How clerk/clerk-sdk-csharp works
Project type and purpose
• This is a generated .NET (C#) client SDK for the Clerk REST Backend API.
• Purpose: provide a type-safe, idiomatic C# wrapper around Clerk’s HTTP endpoints so backend servers can easily call user-management operations (Users, Sessions, OAuth, SAML, etc.).
File structure
• Top-level:
• .github/workflows – CI/CD pipelines (codegen, test, publish)
• .speakeasy – code generation config (OpenAPI → C# models & operations)
• docs/ – static markdown API references and per-SDK README fragments
• src/Clerk/BackendAPI – C# project containing:
– ClerkBackendApi.cs (Facade client entry point)
– Operations (resource-grouped API methods)
– Models (Components & Operations request/response types)
– Helpers & Hooks (authentication, request interception)
– Utils (HTTP client wrapper, serialization, retry logic)
• tests/ – unit tests for hooks, JWT validation, request auth
• GitHub Actions (sdk_generation.yaml, sdk_publish.yaml) orchestrate generation and deployment to NuGet
README for additional insights
• Describes authentication (BearerAuth), retry configuration, server URL override
• Illustrates how applications consume the SDK: instantiate new ClerkBackendApi(...), call sdk.Users.GetAsync(...), handle models & errors