NiBStudio

For game builds

Leaderboard API

Every NiB Studio game shares one leaderboard platform. This page explains how it works and what it does — and doesn't — protect against.

Player identity

Players pick a username the first time they play — no email, no password. The server returns two secrets:

  • a device token the game keeps in browser storage and sends as Authorization: Bearer …
  • a recovery code (NIB-XXXX-XXXX-XXXX-XXXX) shown once to the player

Only SHA-256 hashes of both are stored. Knowing someone's username is not enough to post as them: you also need their token or recovery code. Usernames are unique, case-insensitively and across look-alike characters (N1B_Leo collides with nib_leo).

Games on itch.io and CrazyGames run inside third-party iframes, where browsers may partition or clear storage. When that happens the recovery code restores the same player — in the same game, another game, or another device.

Calling the API

Send X-Game-Key (the public key from the admin) with every request. The API answers CORS preflight for any origin, because identity travels in a header rather than a cookie. Errors are JSON: { "error": "code", "message": "…" }.

The Godot 4 addon (godot/addons/nib_leaderboard in the website repository) wraps all of this, including offline retry and web storage fallbacks.

Anti-cheat: what's enforced

  • Hard limits per board: minimum and maximum score, required play session, cooldown between submissions
  • Soft rules: maximum score growth per second of session time and minimum session length. Suspicious scores are held for review instead of published
  • Rate limits per IP and per player on every endpoint
  • Banned players are rejected and hidden everywhere
  • Optional HMAC request signing per game

Honest limitations

Scores are calculated by the game on the player's own device, so no client-submitted leaderboard can be made cheat-proof. A determined player can read the game's code (including any signing secret) and send any request the game could send. The rules above make cheating effortful and keep impossible scores off the boards, and moderation tools cover the rest. Truly competitive boards need server-side simulation, which these games don't use.