Skip to content
Work in progress. These docs describe Spawnite at launch, and some parts are still being built.

LeaderboardCommonOptions

What every board declares.

Property Modifier Type Description
audience? readonly "game" | "world" | "members" Who reads it: the game’s players by default; on a board whose parent is a world, world for anyone who has entered it and members for its owners and members.
keyed? readonly boolean Whether the board also takes a string key the game names, such as a track: one board for each key.
metadata? readonly ZodMiniType<unknown, unknown, $ZodTypeInternals<unknown, unknown>> A schema for a row’s detail, such as the car a lap was driven in: 256 bytes as JSON at most. None on a total.
name readonly string What players see the board called.
parent? readonly "game" | "world" What the board belongs to and goes with: the game by default, or a world, whose wipe closes its period and whose delete deletes it.
period readonly LeaderboardPeriodOption all-time, daily, weekly or monthly on UTC boundaries, world for each reset generation of the board’s world, or { windows }, competition windows a later version may add to but never change.
retired? readonly boolean Stops the board’s scores and keeps its rows readable: a published board stays declared, retired, rather than going.
subject? readonly "player" What a row ranks: a player, the one kind at launch.
update readonly "best" | "latest" | "total" How a submission meets a player’s row: the better score, the last, or the sum of whole-number deltas.
writtenBy readonly "room" | "page" Who writes it: room, in its checkpoint’s commit, which makes it trusted; or page, through the app with sendScore, which leaves it untrusted, as in a game with no rooms.