IClient to work with Speckle Server metadata — list projects and models, fetch versions, and check what the server supports. Pair it with IOperations when you need to load or publish the actual object graph (Receive2, Send2).
When to use it: after Authentication. Guides first: Build your first model analysis tool shows a full workflow; use this page for method signatures.
Example
IClientFactory
IClient Create(Account account)
Builds an authenticated
IClient for the given account. The returned client owns a
GraphQLHttpClient and should be disposed when no longer needed.IClient
Account
The account this client was created with.
Uri
The server URL, derived from
Account.serverInfo.url.GraphQLHttpClient
The underlying GraphQL HTTP client. Use resource properties below for typed access; drop down to
this only for queries not yet covered by a resource.
Task InitializeWebsocket()
Ensures the GraphQL websocket connection is established. Only needed before subscriptions; not
calling it first just means the first subscription takes slightly longer to activate.
Resources
ProjectResource
See ProjectResource.
ModelResource
See ModelResource.
VersionResource
See VersionResource.
ActiveUserResource
OtherUserResource
WorkspaceResource
See WorkspaceResource. Workspace
features require a workspace-enabled server, such as app.speckle.systems.
ServerResource
See ServerResource.
ModelIngestionResource
Connector-scale model ingestion lifecycle. See
ModelIngestionResource.
ProjectInviteResource
Create, look up, and cancel project invitations.
SubscriptionResource
GraphQL subscriptions for real-time updates.
Disposal
IClient implements IDisposable and owns network resources (the GraphQL HTTP client and, if used, a websocket connection). Always dispose it, typically with a using statement:
Example
Error Handling
GraphQL calls automatically retry transient failures. Unrecoverable errors surface as exceptions — see Exceptions.FAQ
How do I know if a server supports workspaces?
How do I know if a server supports workspaces?
Call
client.Server.IsWorkspaceEnabled(). See Handling server
capabilities.Do I need to call InitializeWebsocket before using Subscription?
Do I need to call InitializeWebsocket before using Subscription?
No — it’s called automatically the first time you subscribe. Call it explicitly only if you want
to avoid the ~100ms delay on your first subscription.
Next Steps
Build your first model analysis tool
End-to-end workflow with IClient and Receive2
Operations
Load and publish object graphs
Core concepts
Projects, models, versions