Getting started

By the end of this page you will have a game folder that the portal lists, launches, saves and ranks.

1. Copy the template

cp -r games/_template games/my-game

The folder name is the game's slug: lowercase letters, digits and dashes. It becomes the URL (/games/my-game, /play/my-game) and the key for every API call.

2. Edit game.json

{
  "name": "My Game",
  "tagline": "One sentence that sells it.",
  "category": "puzzle",
  "entry": "index.html",
  "cover": "cover.png",
  "leaderboard": { "enabled": true, "order": "desc", "unit": "points" },
  "save_slots": 3,
  "status": "beta"
}

Keep status at hidden or beta while you work. See the manifest reference for all fields.

3. Include the SDK

In your entry file, load the SDK from the portal (not a copy inside your folder, so you always get the current version):

<script src="/sdk/allgame.js"></script>
<script>
AllGame.init().then(async (ag) => {
  console.log('Playing as', ag.player.display_name);

  const save = await ag.state.load(0);          // null on first play
  startGame(save || { level: 1 });

  ag.on('pause',  () => pauseGame());            // tab hidden or daily limit reached
  ag.on('resume', () => resumeGame());
  ag.on('limit',  () => showGoodbyeScreen());    // shell shows the upgrade overlay on top
});

async function onLevelComplete(state, points) {
  await ag.state.save(0, state);
  const r = await ag.scores.submit(points);
  console.log('Rank', r.rank && r.rank.rank);
}
</script>

4. Register the folder

php bin/console.php games:sync

or press Sync game folders in the admin area. The manifest is validated; problems are listed in the output.

5. Play it

Log in, open /games/my-game, press Play. The shell starts a play session, loads index.html into an iframe and begins the heartbeat. Open the browser console to watch SDK calls.

6. Publish

Set "status": "published" in game.json, sync again. Add "featured": true to put it on the home page. Administrators can override the status at any time without touching your files.

Local development without the portal

The SDK also works outside the play shell: pass a player token and the slug explicitly.

const ag = await AllGame.init({ game: 'my-game', token: 'agp_…' });

Create a token under Account → Security → API tokens. Requests then go to the same /api/v1 endpoints with Authorization: Bearer agp_…. No play session is started in this mode, so no play time is counted.

Last updated October 11, 2026.