Skip to content

Tournaments

A tournament is a leaderboard with a start, an end, and a shared starting context. Use them for weekend events, race‑to‑the‑top bracket challenges, or viral “beat my score” flows.

const tournamentId = await FRVR.tournaments.create(
  { seed: 12345, mode: 'endless' },     // arbitrary payload — players all get the same one
  {
    title:     'Weekend Rush',
    sortOrder: 'HIGHER_IS_BETTER',       // or 'LOWER_IS_BETTER' for time trials
    endTime:   Date.now() + 48 * 3600e3, // ms since epoch
  },
);

The returned ID is what you use for every subsequent call.

await FRVR.tournaments.postScore(tournamentId, 42000, playerName, photoUrl);

playerName and photoUrl are optional overrides — pass them if your channel didn’t provide a good default, or if you want an in‑game handle shown instead.

const t = await FRVR.tournaments.getTournament(tournamentId);
// {
//   id, title, endTime, sortOrder,
//   entries: [{ playerId, score, rank, name, photo }, …]
// }
const mine = await FRVR.tournaments.getMyTournaments(20, 0); // count, offset
const scores = await FRVR.tournaments.getScores(tournamentId, [fid1, fid2, fid3]);
if (!FRVR.tournaments.platform.isSupported()) {
  hideTournamentsMenu();
}

Tournaments require a server‑backed implementation; sandboxed channels may not offer one.

Tournaments: read support + current

loading SDK…