Skip to main content
High-level overview of integrating game clients with Cardinal using the client SDKs. For the full SDK reference documentation, see:

Initializing the Client

Create a client with a configuration object that specifies the auth URL and region configs. For local development, use dev auth to bypass the normal authentication flow.

Authentication

client.AuthStatus says what the game can do: SignedOut, NeedsRefresh (a saved login needs a fresh game token), or Ready. client.Player says who is playing. client.AuthChanged fires on Unity’s main thread whenever either changes. Cardinal identifies the player by the stable player ID in the game token.
Sign out when the user logs out of your game.

Connecting to a Shard

A shard is a single instance of your game world running on the server. The shard client is your connection to that instance, allowing you to send commands and subscribe to events. To connect, specify the shard’s region and ID and call connect to get a shard client. The organization and project come from the client config.
Disconnect from the shard when you no longer need it.

Sending Commands

Build a command payload and send it to the shard. See Commands for more details.

Subscribing to Events

Subscribe to events with handler callbacks. See Events for more details.
Unsubscribe when you no longer need to receive events.