Skip to content

About

The SpacetimeDB SDK for C# clients

Resources

Stars

60 stars

Watchers

5 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SpacetimeDB C# SDK

Overview

This repository contains the C#, Unity and Godot client SDKs for SpacetimeDB. These SDKs contain all the tools you need to build native clients for SpacetimeDB modules using C#.

Documentation

Unity

The Unity SDK uses the same code as the C# SDK. You can find the documentation for the C# SDK in the C# SDK Reference. For a guided tutorial, see the C# SDK Quickstart.

There is also a comprehensive Unity tutorial/demo available:

Godot

The Godot SDK uses the same code as the C# SDK. You can find the documentation for the C# SDK in the C# SDK Reference. For a guided tutorial, see the C# SDK Quickstart.

There is also a comprehensive Godot tutorial/demo available:

Internal developer documentation

See DEVELOP.md.

Automatic reconnect

C#, Unity, and Godot clients can opt in with .WithAutomaticReconnect() on the connection builder, optionally passing AutomaticReconnectOptions with MinDelay and MaxDelay to tune the backoff. The SDK recovers lost connections, retains cached rows and subscription handles, and replays subscriptions in one batch. Keep calling FrameTick() during outages; Unity's SpacetimeDBNetworkManager does this automatically. Register subscriptions and row callbacks once, in OnConnect or after Build(). OnConnect runs only on the first successful connection; .OnAutomaticReconnect((conn, identity, token) => ...) runs after each successful recovery, before subscription replay. Subscription OnApplied runs again once the cache is reconciled.

For expiring credentials, supply the initial token with .WithToken(initialToken) and add .WithTokenProvider(() => RefreshTokenAsync()). The provider obtains a token for the same identity before a reconnect when needed. If you persist tokens, save them from both OnConnect and OnAutomaticReconnect. Initial connection failures do not retry, and Disconnect() stops recovery. Handle Status.UnknownResult for pending reducer calls whose outcome was lost; the SDK does not repeat them.

See the C# SDK Reference for retry callbacks, token refresh, and subscription behavior, or the reconnect test application for runnable scenarios.

About

The SpacetimeDB SDK for C# clients

Resources

Stars

60 stars

Watchers

5 watching

Forks

Releases

Packages

Used by

Contributors

Languages