Game SDK
Scores and leaderboards
Submit a score when a round ends. ARCADE keeps daily, weekly, monthly, season and all-time boards and checks every score.
try {
const { personalBest } = await sdk.score.submit(4200);
showBest(personalBest);
} catch (error) {
if (error.code === 'SCORE_HELD') show('Your score is being reviewed');
else if (error.code === 'NOT_SIGNED_IN') show('Sign in to keep your scores');
}
const best = await sdk.score.best(); // null for guests and first plays
const top = await sdk.leaderboard.get({ limit: 10 }); // [{ rank, username, score, submittedAt }]What ARCADE checks
- The score belongs to a play session the server started when the game opened, and the player played for at least the game's minimum time.
- It's not above the game's highest possible score, and not an impossible jump from the player's best.
- Retries count once: the SDK gives every submission an id (
submissionId). - At most one score every few seconds per player and game.
A suspicious score is held for a moderator (SCORE_HELD) and stays off the boards until approved. Admins set each game's rules.