Skip to content

Leaderboard API for games

Boards a designer adds without code. A board keeps the best score of each player: the highest, or the lowest for a time. It may start again every day, week or month. Scores come from the client, or only from the game server.

await rudder.leaderboards.submit({ board: 'arena', score: 1200 });

Engagement → Leaderboards.

FieldMeaning
key, nameThe board.
periodnever, day, week or month: how often the board starts again, from the day start of the project.
orderdesc, the highest score first, or asc, the lowest first, such as the time of a race.
clientWhether the game client sends its own scores. Otherwise only the game server reports them.

A board whose period or order changes starts again empty. Its old scores stay under the old rules.

FunctionKindCallerArgumentsResult
submitmutationclient{board, score}{place, score, players}
reportmutationserver{board, score}{place, score, players}
topqueryclient{board, count?}{places: [{place, player, score, nickname, avatar}], players}
mequeryclient{board}{place, score, players}
  • submit sends a score of the player of the call to a board with client; another board answers server_only. report is the game server reporting for the player it names, on any board.
  • top returns the first count places (10 by default, at most 100) with the nickname and avatar of each player, and the number of players on the board.
  • me returns the place and score of the player (place 0 when it is not on the board) and the number of players.
  • Players with equal scores share a place (1, 1, 3) and are listed by player id.
  • A place is read a moment after the scores it counts: a score another player sent a few milliseconds ago may not be in it yet. The best score itself is never lost.
CodeWhen
unknown_boardThere is no such board.
server_onlyThe client submitted to a board without client.
invalid_scoreA score below 0 or above 2^53.
invalid_countcount is not from 1 to 100.
  • Engagement → Leaderboards. The page of a board shows its standings in the current and the previous period, with a search by player id or nickname, in the environment chosen in the header.
  • Engagement → Calendar: the starts of each board’s periods.
  • The best score only: no sum and no last score.
  • No prizes for places. A module of your game reads the previous period and lets each player claim its prize.
  • Only the current and the previous period of a board can be read.