taking longer than usual.

skip to content
sometimes/ developers

developers / games / build your game

players & private state

the server maintains the game state and returns a separate view containing the information each player is allowed to receive.

API 1 · SDK 1.0.2download reference

joins and reconnects

game.session.participants includes permitted names, avatar versions and active status. players(state, ctx) runs on roster changes. keep departed scores if useful, but remove private profile data when an ID disappears from ctx.players. presence leases last 90 seconds. sometimes ends games after ten minutes without player interaction or five minutes with every player minimized. joining is specific to one app instance; the host handles switching devices.

private and team views

view(state, viewer, ctx) runs separately for each joined player. team views use assignments in your private state. unjoined chat members receive a roster for the peek bar, with no game state.

randomness and scores

choose(items) uses cryptographic randomness. random(seed) creates a reproducible stream; keep secret seeds out of view. standings(players, 'highest' | 'lowest') sorts scores with shared ranks for ties. award points in server rules.