The process
- You prepare a submission and test it in standalone mode following the Testing page.
- You send the submission to the operations team.
- The operations team runs
wsg validateandwsg buildfor the automated checks, thenwsg publishto upload the bundle to Cloudflare R2 and register the version with the portal. A new version can be uploaded as a draft: it is on the games origin but not yet open to players. - The operations team reviews the running build, then makes it the current version. The game shows up on the home page, category pages and search, and players who press Play get the new version.
Updating a game follows the same process with a new version.
The submission
tap-rush/ folder name equals the slug
├─ game.json
├─ thumbnail.png 512×512, under 150 KB
├─ cover.png optional, 1200×630
└─ dist/ the build folder, equal to build.outDir
├─ index.html at the root of the build folder
├─ game.js
└─ assets/...- The root folder name must equal the
slugingame.json. game.jsonfollows the reference, with aversionthat has never been released. Since the operations team doesn't rebuild your game, set"build": { "command": "echo prebuilt", "outDir": "dist" }.thumbnail.pngis the image shown in game listings: 512×512, at most 150 KB, readable at small sizes.- The build folder meets the Game requirements:
index.htmlat its root, relative paths, the SDK loaded from/sdk/v1/wsg-sdk.js, no requests to other origins. - Zip the whole folder when you send it, together with a few lines of release notes (what changed, how to play, controls).
Automated checks
wsg validatechecksgame.jsonand the images: see Validating game.json.wsg buildrunsbuild.command, then checks:index.htmlexists at the root ofoutDir; at most 300 files and 20 MB (warning above 3 MB);index.htmlat most 200 KB; absolute URLs to other origins inindex.htmland.jsfiles (warnings, errors with--strict); a warning ifindex.htmldoesn't loadwsg-sdk.js.wsg publishrepeats both steps, refuses aversionthat already exists on the games origin, then uploads the bundle and images, registers the game and the version with the portal, and (unless--draftis used) makes that version current.
$ pnpm wsg build tap-rush
> chạy "echo prebuilt" trong tap-rush
prebuilt
OK dist/index.html 1.0 KB
OK 2 file, 6.7 KB
build: OK (0 lỗi, 0 cảnh báo)Storage and paths
Games are stored on Cloudflare R2 and served from the games origin https://games.leonogames.com:
| Path | Content | Cache-Control |
|---|---|---|
/<slug>/<version>/… | The bundle of each version, which never changes | public, max-age=31536000, immutable (HTML files add no-transform) |
/<slug>/media/thumbnail.png | The thumbnail (and cover.png if any), overwritten on every release | public, max-age=3600, s-maxage=60 |
/sdk/v1/wsg-sdk.js | The SDK v1 file, patched by the portal | public, max-age=3600, s-maxage=60 |
- Images in
/<slug>/media/keep the extension of the file you submitted (thumbnail.png,thumbnail.webp…). With a one-hour cache, a new image can take up to an hour to show everywhere. - Every response from the games origin carries
Content-Security-Policy: frame-ancestors <portal origin>: only the portal may embed games in an iframe. Opening a URL directly in the browser still works (the game runs in standalone mode), but other websites can't embed it. - Other headers:
Content-Typefrom the file extension,X-Content-Type-Options: nosniff,Cross-Origin-Resource-Policy: cross-origin. - Bundles reference the SDK with the root path
/sdk/v1/wsg-sdk.js, so they work in every environment. When testing outside the portal, get the SDK fromhttps://games.leonogames.com/sdk/v1/wsg-sdk.js(see Testing).
Versions
- Every release must increase
version. An existing version is rejected (error 409); bumpversionand submit again. - Released versions are immutable and old version URLs keep working. Players who already have the game page open keep the version they loaded until they reload the page.
- Changing
limits, the description, tags or images also means releasing a new version, since they live in each version'sgame.json. Play sessions created after the release use the newlimits. - If something goes wrong, the operations team can make an older version current again, or temporarily hide the game.
- The game page on the portal can take a minute or two to switch to the new version because of caching.
Review
Before opening a game to players, the operations team:
- Runs the automated checks above and reads the warnings (especially URLs to other origins).
- Plays it on the staging portal, on a phone and on a computer: fast loading, the loading overlay going away, scores accepted and shown on the leaderboard, ads pausing and muting correctly, the game stopping when the tab is switched.
- Goes through the checklist and looks over the game's content.
Internal teams with the repository
The commands run from the repository root and read their configuration from the root .env (WSG_API_ORIGIN, WSG_ADMIN_TOKEN, WSG_WEB_ORIGIN, WSG_GAMES_ORIGIN, WSG_SDK_URL, WSG_STORAGE_DRIVER and the S3_* variables when storing on R2). Storage credentials and the admin token come from the operations team and are never committed.
pnpm wsg validate games/my-game # check game.json, slug, taxonomy, thumbnail
pnpm wsg build games/my-game --strict # build and check bundle rules; unknown URLs are errors
pnpm wsg publish games/my-game # validate → build → upload → API
pnpm wsg publish games/my-game --draft # create the version, not open to players yet
pnpm wsg publish games/my-game --no-build # use the existing outDir, skip build.command
pnpm wsg list # list games and their status
pnpm wsg publish-sdk # upload the freshly built SDK to /sdk/v1/--mock(withpublishandlist) uses an in-memory fake API, so you can try the commands without touching the portal.wsg publish --draftprints the version's id so the operations team can make it current after review.- Games from the Phaser template build with the SDK at the root path
/sdk/v1/wsg-sdk.jsby default (the root.env.examplealso setsWSG_SDK_URL=/sdk/v1/wsg-sdk.js). Games created before 2026-10-10 default to an absolutelocalhostURL: copy the template's newvite.config.ts, or set this variable when building.
