The Platform SDK lets you build tools, workflows and services that integrate with the SpatialOS platform.
You can use its APIs to integrate SpatialOS into your continous integration process, create debugging tools as game engine plugins, or build matchmaking and inventory systems that utilize player identity. You can also manage deployments, snapshots, and other parts of a project locally or in the cloud.
More information on using the API locally is available in the introduction to the Local API.
We currently support the Platform SDK in C#. For more information, see the introduction to the Platform SDK: C#.
There are currently two services available: the Deployment Service and the Snapshot Service.
|Service||What you can do with it|
|Deployment Service||List, create, update and stop deployments|
|Snapshot Service||List, take, download and upload snapshots|
Authenticating your API calls
We require authentication to use the Platform SDK. It uses the same SpatialOS refresh token attached to a normal account or service account to authenticate your API calls. As a result, you must have either a SpatialOS user account or a service account to use the SDK.
The SDK is built to work together with the
spatial CLI’s built-in authentication mechanism. Alternatively, you can provide a refresh token string for the Platform SDK to use directly.
To use the
spatial CLI’s built-in authentication mechanism, run
spatial auth login. This obtains a copy of your refresh token and caches it locally. By default, the Platform SDK looks for the refresh token file stored locally and uses it to authenticate. Refresh tokens for normal user accounts expire relatively quickly; we’re currently working on a service account API which will let you set a longer expiry time.
We’ve created some example scenarios that demonstrate the benefits of incorporating the Platform SDK into your project.
An example of an automated script that would run on a regular cadence and reset the live deployment of your game.
Replicate local state to cloud
An example of a debugging tool that captures a snapshot in a local deployment and uploads it to the cloud in order to reproduce game behavior.
We’ll add more example scenarios in future.