bootstrap_leaderboard
Creates a new game and leaderboard in one call, then returns ready-to-paste SDK and widget code so you can start submitting scores immediately.
Instructions
Use this when starting from scratch — creates a new game AND its first board in one call, then returns ready-to-paste integration code wired against the board. The fastest path from "I want a leaderboard" to "scores are flowing." Do NOT call this if the developer already has games — call list_games first and use bootstrap_leaderboard only when no game exists yet. The response includes snippets.sdk (framework/server code), snippets.widget (a themeable drop-in HTML embed; null for server_only), and a plain-English recommendation to relay to the developer — paste snippets.sdk (and/or snippets.widget) into their code. The optional axis args tailor the output: set hostingPattern='client_with_server' for anti-cheat (server-validated scores), playerIdentityStrategy='auth_provider' (+ authProvider) for OAuth identity, or serverLanguage for a non-TypeScript server. Omit them all for the simplest anonymous + client-only setup.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| gameName | Yes | Display name of the game (any string) | |
| gameSlug | Yes | URL-safe slug for the game, e.g. "my-racing-game" (2–42 chars, lowercase + hyphens; derive from gameName) | |
| boardName | Yes | Display name of the leaderboard | |
| boardSlug | Yes | URL-safe slug for the board, e.g. "high-scores" (2–42 chars, lowercase + hyphens) | |
| sortDir | No | "desc" for high-scores-win, "asc" for lowest-time-wins | desc |
| scoreKind | No | Score type: integer (default), duration_ms (time trials), or float | integer |
| playerIdentityStrategy | No | How players are attributed. 'anonymous' (default) mints a local UUID, no PII; 'prompted_local' asks once and saves to localStorage; 'auth_provider' uses OAuth (also set authProvider); 'server_authoritative' has the game server attach the playerId (needs hostingPattern client_with_server or server_only); 'custom_callback' for a dev-supplied function. | |
| authProvider | No | Required when playerIdentityStrategy is 'auth_provider'. supabase/clerk/auth0/firebase get a server-side JWT-verifying secure-submit endpoint (real anti-cheat); google ships a browser helper; github/apple/discord are planned; custom is the escape hatch. | |
| hostingPattern | No | Integrity model. 'client_only' (default): the browser holds the public key — simplest, but NO anti-cheat. 'client_with_server': your server validates + signs scores — use this for competitive boards where cheating matters. 'server_only': server reads/writes and renders SSR HTML (max integrity, SEO-friendly, no widget). | |
| serverLanguage | No | Language for the server-side snippet. Required for hostingPattern 'server_only'; optional for 'client_with_server' (defaults to typescript, which gets the turnkey createScoreSubmitHandler endpoint). python/go/csharp return a best-effort snippet. |