Module

Leaderboard

Rank your players. Submit a score, read the standings — daily through all-time.

@pithy-sh/leaderboard

Built for Games
terminal
pithy add leaderboard
Read the docs Source on GitHub

What it is for

Submit a score, read the standings — daily, weekly, monthly, all-time. The windows close on their own and the history stays queryable.

What it sits on

Your D1, in plain SQL you can join against your own tables.

Boards run in your Cloudflare account, against your data. Closed windows stay as long as you say. There is no Pithy service in the path and no Pithy bill.

  • D1

The honest bit

Game Center and Play Games already do this, for free.

If you ship on one platform and never need the standings anywhere else, use theirs. It is less work and it is free.

This exists for the case theirs cannot serve: one board across iOS, Android and the web, joinable against your own tables, with the history in a database you can query rather than a screen you can only look at.

If you build it yourself

Ranking is a query. Windows are the product.

Sorting by score is trivial until the board has to close at midnight, somewhere.

Windows that close on their own

Daily, weekly, monthly and all-time, with a boundary that is correct in the player's timezone and yours.

History that stays queryable

A closed window is evidence — of a prize, a rank, a dispute — and must not be a screen you can only look at.

Ties

Two identical scores need a deterministic order, or the same board renders differently to two players.

Cheating

Scores submitted by clients are claims. Rate limits, bounds and a server that resolves the game are what make them facts.

Scale on write

Every player submitting at once, and reads that stay fast while they do.

terminal
pithy add leaderboard

In the dashboard

Administer it from a browser, without building the screen.

Every board, its open and closed windows, and the standings inside them.

The dashboard is the admin interface for your own application: whatever this capability writes, your team can look up, check and act on from a browser. Reading is free, forever, with no time limit. Connect the project when you deploy.

Designed, not shipped

What is coming to this capability.

Written down, argued out, and not built yet. Each one links to the issue it is being designed in, so you can read the reasoning or disagree with it.

Add it, and get on with the feature.

One command installs the package, wires its bindings into every environment your project declares, and runs its migrations.