Python SDK — Game Data

Game Data — client.games / client.players

games.get_data
client.games.get_data(data_cls: type | None = None) -> GameDataResponse

Retrieves global game data. Pass a dataclass as data_cls for typed data.

games.update_data
client.games.update_data(data: Any) -> SuccessResponse

Updates global game data (requires private API token).

players.get_data
client.players.get_data(player_token: str, data_cls: type | None = None) -> PlayerDataResponse

Retrieves a specific player's data using their authentication token.

players.update_data
client.players.update_data(player_token: str, data: Any) -> SuccessResponse

Updates a specific player's data (level, score, inventory, ...).

Two scopes of JSON storage

Game data is JSON your game owns, kept at two scopes. The game-scope blob holds live configuration — name and room rules, version policy, client config — that every SDK reads at startup, so rule tweaks reach players without shipping a client update. The player-scope record per user carries progression: stats, loadouts, unlocks and match state that must outlive sessions.

Reads need only the public API token since the game blob is world-readable. Writes are privileged: game scope requires the private token, and a player record requires that player's token or admin credentials. Player fields are also what the leaderboard sorts — keep ranked fields numeric and consistently named across builds.

  • Treat the game blob as remote config: small, versioned, read at startup — not a per-frame channel.
  • Name rules and room rules apply server-side at register, rename and room creation; SDKs validate locally for instant feedback but the server verdict is final.
  • Ranked fields live in player data — write them under the same names on every platform or the board splits.
  • Calls are synchronous functions — wrap them in asyncio.to_thread or your engine's job system when the game loop cannot block, and reuse one client across coroutines.