Crée des jeux pour GamePortal
Documentation développeur
Le guide du SDK, le manifeste et les règles de la plateforme : le chemin de ton jeu jusqu’au portail, étape par étape.
La documentation détaillée est en anglais ; un court résumé en français figure ci-dessous. Les tableaux de référence sont générés à partir des paquets du SDK.
Documentation
- 01
Quickstart
create:game, the dev console, validate and check, then submit: the path from nothing to a game in review.
- 02
Concepts
Portal and standalone mode, the handshake, the MessageChannel, saves and conflicts, scores, the daily challenge, the server day.
- 03
SDK reference
The bridge API and every message with schema tables, error codes, limits and examples.
- 04
Manifest reference
Every field of manifest.json: identity, save version, events, score plausibility, the daily challenge.
- 05
Online matches
Turn-based two-player games: the server referees, the portal's lobby, the mp_* flow, reconnects and tests.
- 06
Platform rules
The rules every game follows, how each is verified, and a checklist of blockers by level.
- 07
Testing
Unit tests, the fake portal, the rules runner and how to use them in CI.
- 08
Packaging and submission
Build output layout, size budgets, assets and licences, versioning, the review and the integration levels.
- 09
FAQ and troubleshooting
The rule failures people hit most, and how to fix them.
- 10
Changelog
How the SDK is versioned, what counts as a breaking change, and what changed when.
Court résumé en français
Everything you need to build a browser game for GamePortal, or to bring one you already have: the SDK that connects a game to the portal, the manifest that describes it, the rules every game follows, the tools that check them, and what happens after you hand a game in.
Who this is for #
You write HTML5 games (TypeScript or plain JavaScript, a Vite or Phaser or Pixi or Three.js build, a canvas game in a single file) and want them to run on GamePortal: inside the portal's frame with cloud saves, scores, daily challenges and badges, and outside it as an ordinary web page. You do not need to know how the portal is built. You need to know three things: a game is a folder of static files, the portal and the game talk only by messages, and the server's clock and rules decide everything that is worth cheating for.
Note
Status. The SDK, the starter template and the tools are in the GamePortal repository today and every portal game is built with them. External publishing (accounts, upload, a developer panel, metrics) opens in V2; until then games are handed to the GamePortal team and go through the same checks and review, see Packaging and submission. The contract is written so that it does not change when the programme opens.
Reading order #
Start with the Quickstart: create a game from the starter, run it in the dev console, check it against the rules, submit it. Then read Concepts once, to learn why the pieces fit together the way they do: modes, handshake, origins, saves, the server day. Look things up in the SDK reference and the Manifest reference; Online matches explains the two-player addendum. The Platform rules are the contract every game is checked against, with checklists of blockers by level. Testing covers unit tests, the fake portal, the rules runner and CI. Packaging and submission is the build layout, the budgets, the licences, the releases and the review. When a check fails, FAQ and troubleshooting has the fix. Versioning and changes are in the Changelog.
Türkçe kısa özet: overview.tr.md.
Integration levels at a glance #
A game joins at the highest level it can reach safely; the checks say which one that is.
| Level | What it is | Code change |
|---|---|---|
| 0, wrap | The game runs in the portal's frame as it is. | None |
| 1, bridge | Saves, language and pause go through the portal. | Small |
| 2, deep | Scores, the daily challenge and badge events too. | The game's rules must be understood |
See integration levels.
The model in one paragraph #
The portal page holds your game in a sandboxed frame from another origin. The game sends hello; the portal answers init with a private message channel, the player's language, a guest flag, the cloud save, the server's time and day, and today's challenge. The game says ready when it is playable, then sends saves, scores and events over the channel and gets an answer for each; the portal tells it when to pause, resume, switch language or start a new day. XP, rewards, streaks, badges and saves are written only by the server. Outside the portal the same code runs in standalone mode with its own local save.
Where the code is #
| Path | What |
|---|---|
packages/sdk-types | Message types and schemas, constants, the manifest schema, the platform rule list. The source of truth for this documentation. |
packages/game-bridge | The game side of the SDK. |
templates/game-starter | A small working game wired to everything above: copy it with pnpm create:game. |
packages/game-tools | create:game, the dev console with a fake portal, validate and check. |
packages/rules | The rule validators and the fake-portal runner. |
packages/game-kit | Optional, opinionated templates for common game kinds. |
docs/PLATFORM-RULES.md | The reasons behind each rule (Turkish). |
How these docs stay true #
The reference tables (message fields, limits, error codes, manifest fields, platform rules and their checklists) are generated from the packages above by pnpm docs:sdk. A test fails when a committed table is stale, when a link or an anchor in these pages points nowhere, and when a TypeScript sample no longer compiles against the real packages. A change to the SDK therefore cannot reach the code without reaching this page.