Skip to content
PEERLESSDocs

Leaderboards

Submit bounded scores and show global, friends and nearby rankings.

Create a board

In Creator studio, add a board with a title, score bounds, a direction (higher or lower is better), a unit (points, milliseconds, seconds, waves or wins) and a mode:

ModeWho submitsTrust
CasualThe browser, during confirmed playBounded but not cheat-proof.
VerifiedYour game serverAs trustworthy as your server's validation.

Rules and units lock after the first score. Create a new board for a new mode, difficulty or scoring version.

Submit and list scores

const submissionId = crypto.randomUUID(); // keep it with THIS result for retries
await Peerless.leaderboards.submit({ boardId: "BOARD_UUID", score: 1200, submissionId });

const top = await Peerless.leaderboards.list({ boardId: "BOARD_UUID" });
const friends = await Peerless.leaderboards.list({ boardId: "BOARD_UUID", scope: "friends" });
const near = await Peerless.leaderboards.list({ boardId: "BOARD_UUID", scope: "nearby" });
const week = await Peerless.leaderboards.list({ boardId: "BOARD_UUID", period: "week" });
  • Global returns the top 50 plus mine. Each player's best score counts; earlier scores win ties.
  • Nearby returns your rank with up to two neighbors on each side, even outside the top 50.
  • Friends ranks you and your accepted friends.
  • Weekly periods use UTC weeks; past weeks use their Monday date, for example 2026-10-05.

Server-verified scores

POST /api/leaderboards/server-submit
Authorization: Bearer GAME_SERVER_CREDENTIAL
Content-Type: application/json

{"board_id":"BOARD_UUID","grant_id":"CURRENT_GRANT_UUID","player_id":"GAME_SCOPED_PLAYER_UUID","score":1200,"submission_id":"UNIQUE_RESULT_UUID"}

Calculate the score on your authenticated game server; never forward a browser's claim as verified. Board owners and staff can hide suspicious results, and every such action is audited.