TipTap Games

TipTap SDK

Scores, leaderboards, achievements and audio focus — in minutes.

  • Auto-injected
  • Zero dependencies
  • Live leaderboards

Building with an AI agent? Give it this link.

A single self-contained spec written for coding agents — sandbox constraints, the complete API, a working template, and a pre-flight checklist. Paste the URL into Claude Code, Cursor, or any agent and it has everything it needs to produce an uploadable game in one pass.

https://tiptapgames.com/sdk-agents.md

No import needed

The SDK is pre-loaded into every game — window.TipTap is available the moment your script runs. No import, no CDN link needed.

Quick start

A complete minimal game using the hooks that matter. Copy, paste, and extend.

<!doctype html>
<html><head><meta charset="utf-8">
<title>My Game</title>
</head><body>
<script>
// window.TipTap is injected automatically — no import needed.

var score = 0;
var paused = false;
var music = null;

// ---- Audio: respect focus AND the global mute ----
function syncAudio() {
  if (TipTap.canPlayAudio()) {
    if (!music) music = startMusic();
  } else if (music) {
    stopMusic(music);
    music = null;
  }
}
window.addEventListener('tiptap:focus', syncAudio);
window.addEventListener('tiptap:blur', syncAudio);
window.addEventListener('tiptap:mutechange', syncAudio);

// ---- Game loop ----
window.addEventListener('tiptap:pause', function() { paused = true; });
window.addEventListener('tiptap:resume', function() { paused = false; });

// ---- Results ----
TipTap.onResult(function(result) {
  console.log('Rank #' + result.rank + ' — beat ' + result.percentile + '% of players!');
});

// The player closed the leaderboard — the game was never unloaded, so just
// carry on from exactly where it was.
TipTap.onLeaderboardClose(function() {
  paused = false;
});

function onScorePoint(points) {
  score += points;
  TipTap.updateScore(score);            // live score in the platform top bar
}

// A run ended for good — bank the score AND show the board.
function onGameOver() {
  TipTap.submitScore(score);
  TipTap.showLeaderboard();
  score = 0;
}

// A "Leaderboard" button in your own pause menu — bank progress without
// ending the run. Continue hands control straight back.
function onLeaderboardButton() {
  TipTap.submitScore(score);
  TipTap.showLeaderboard();
}
</script>
</body></html>

The API

Versions

TipTap.version is 2 — the wire version, which does not move for additive changes. TipTap.apiVersion is the surfaced minor, currently "2.3". Prefer detecting the function itself over comparing that string — it is one check and it cannot get out of step:

if (window.TipTap && typeof TipTap.saveState === 'function') { /* … */ }

Everything on this page is live on the platform right now, so a game built today needs none of this. It matters when your game may also run somewhere older, and when you are reading code written against an earlier SDK.

One breaking change, in v2: submitScore() no longer shows the leaderboard. It writes the score silently and leaves your game running, so a game with progression can bank a score without being torn down. For the old end-screen behaviour, follow it with TipTap.showLeaderboard(). Everything since has been additive.

Local development tip ↓

When testing your game outside the platform, window.TipTap is not present because the injection only happens inside the feed. You can load a stub manually during local dev:

<script src="/tiptap-sdk.js"></script>

Remove it before uploading. The platform injects the real SDK automatically — including the tag in your uploaded file will cause a duplicate script error.