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
required
Describes your host application.
Application is a record: Application(string Name, string Slug).string
required
Your application’s version string, used for telemetry and diagnostics.
string?
default:"null"
Overrides the reported Speckle.Sdk version. Defaults to the assembly version.
IEnumerable<Assembly>? / params Assembly[]
Assemblies containing custom
Base-derived types (including Speckle.Objects, if used) that
TypeLoader should be able to resolve during deserialization.Example
What It Registers
Application
Example
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 callingAddSpeckleSdk — the SDK uses TryAddSingleton, which only registers a default if one isn’t already present:
Example
FAQ
What is the minimum bootstrap for a script?
What is the minimum bootstrap for a script?
new ServiceCollection().AddSpeckleSdk(new Application(...), "1.0.0").BuildServiceProvider() —
see the canonical helper in Automate with
scripts.Do I need to pass Speckle.Objects in assemblies?
Do I need to pass Speckle.Objects in assemblies?
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