Skip to main content
Call AddSpeckleSdk once at startup before resolving IOperations or IClientFactory. For scripts: copy the bootstrap from Automate with scripts — do not customize unless you need extra assemblies. For connectors: see Dependency injection (connectors).

AddSpeckleSdk

application
Application
required
Describes your host application. Application is a record: Application(string Name, string Slug).
applicationVersion
string
required
Your application’s version string, used for telemetry and diagnostics.
speckleVersion
string?
default:"null"
Overrides the reported Speckle.Sdk version. Defaults to the assembly version.
assemblies
IEnumerable<Assembly>? / params Assembly[]
Assemblies containing custom Base-derived types (including Speckle.Objects, if used) that TypeLoader should be able to resolve during deserialization.
https://mintcdn.com/speckle/VtRPWzmN-ULoLfIv/images/developers/sdks/csharp.svg?fit=max&auto=format&n=VtRPWzmN-ULoLfIv&q=85&s=f2970e3b8bd4a2c7899b46211a42f251Example
public static IServiceCollection AddSpeckleSdk(
    this IServiceCollection serviceCollection,
    Application application,
    string applicationVersion,
    string? speckleVersion = null,
    IEnumerable<Assembly>? assemblies = null
);

// Overloads also accept assemblies as params Assembly[]

What It Registers

RegistrationRegisters
TypeLoader.Initialize(...)Type resolution for speckle_type across the provided assemblies
ISpeckleApplication (singleton)Host application metadata (name, version, Speckle version)
ISdkActivityFactory (singleton, no-op default)Tracing hook — provide your own to integrate with OpenTelemetry
ISdkMetricsFactory (singleton, no-op default)Metrics hook
Every interface-implementing class in the SDK assembly (transient)IOperations, IClientFactory, IAccountFactory, IAccountManager, IServerTransportFactory, ISendPipelineFactory, and more
AddLogging()Microsoft.Extensions.Logging integration

Application

https://mintcdn.com/speckle/VtRPWzmN-ULoLfIv/images/developers/sdks/csharp.svg?fit=max&auto=format&n=VtRPWzmN-ULoLfIv&q=85&s=f2970e3b8bd4a2c7899b46211a42f251Example
public record Application(string Name, string Slug);
Application has no required format for Slug beyond being a stable identifier for your app — it’s used for telemetry, not validation.

Registering Custom Activity or Metrics Factories

If you want tracing or metrics integration, register your own implementation before calling AddSpeckleSdk — the SDK uses TryAddSingleton, which only registers a default if one isn’t already present:
https://mintcdn.com/speckle/VtRPWzmN-ULoLfIv/images/developers/sdks/csharp.svg?fit=max&auto=format&n=VtRPWzmN-ULoLfIv&q=85&s=f2970e3b8bd4a2c7899b46211a42f251Example
services.AddSingleton<ISdkActivityFactory, MyOpenTelemetryActivityFactory>();
services.AddSpeckleSdk(new Application("My App", "my-app"), "1.0.0");

FAQ

new ServiceCollection().AddSpeckleSdk(new Application(...), "1.0.0").BuildServiceProvider() — see the canonical helper in Automate with scripts.
Yes if you send or receive geometry types from that package. Without it, those types deserialize as plain Base.

Next Steps

Dependency injection (connectors)

What AddSpeckleSdk registers

Automate with scripts

Minimal bootstrap example

Client API

Resolve IClientFactory after registration
Last modified on July 10, 2026