The Client Craft .NET SDK
On this page
ClientCraft.Sdk is a server-side .NET 10 client for the Client Craft API, with safe defaults for credentials, retries and workspaces.
Use the SDK in trusted server code: a background job, an integration service, or your Umbraco site's server side. It has no CMS dependency. It keeps the integration key on the server, never retries a write on its own, and leaves every authorization decision to the API.
Before you start #
- A .NET 10 application.
- A workspace id and an integration key from an approved connection, stored in a secret provider.
Install and register #
Then inject IClientCraftClient wherever you need it. The uCRM configuration section takes TenantId (or its aliases TenantIdentifier / Tenant), IntegrationKey and CrmApiBaseUrl (default https://api.client-craft.com/). The uCRM section name comes from Client Craft's earlier product name.
What the client covers #
| Member | Covers |
|---|---|
client.Crm.Leads | Leads: list, read, create, update, archive, restore, and linking a company |
client.Crm.Contacts | Contacts: list, read, create, update, archive, restore |
client.Crm.Companies | Companies: list, read, create, update, archive, restore |
client.Crm.Operations | Attention and collection summaries, duplicate suggestions, saved view preferences |
client.Tenancy | Connection discovery, current workspace, capabilities, directory, memberships |
client.WebsiteAnalytics() | Optional server-side website observation capabilities (extension method; add using ClientCraft.Sdk.Analytics;) |
client.ForWorkspace(id) | The same client aimed at another workspace. It grants nothing; the API checks access |
Not in the SDK yet #
Forms, bookings, imports and deals have no SDK client yet. Use the API directly with a workspace API key for those, or wait for a later SDK release. See Create workspace API keys and webhooks.
Rules the SDK follows #
- Credentials stay on the server. The integration key is redacted from
ToString()and JSON serialization. - Creates need an idempotency key, updates need the record version. Updates are full-record PUTs.
- No automatic retries of writes. After a timeout, retry yourself with the same idempotency key.
- Workspace selection is not permission.
ForWorkspacenever widens access. - Errors are safe to log.
ClientCraftApiExceptioncarries status, code and correlation id, never the response body.
1.0.0-preview versions). Pin the exact version you tested.