Skip to content
Docs pages

Developers · Publishing

Submitting and publishing

What goes into a submission, how games are stored on R2 and served, caching, versions, the review process, and the wsg commands for internal teams.

On this page

The process

  1. You prepare a submission and test it in standalone mode following the Testing page.
  2. You send the submission to the operations team.
  3. The operations team runs wsg validate and wsg build for the automated checks, then wsg publish to 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.
  4. 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

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 slug in game.json.
  • game.json follows the reference, with a version that has never been released. Since the operations team doesn't rebuild your game, set "build": { "command": "echo prebuilt", "outDir": "dist" }.
  • thumbnail.png is the image shown in game listings: 512×512, at most 150 KB, readable at small sizes.
  • The build folder meets the Game requirements: index.html at 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 validate checks game.json and the images: see Validating game.json.
  • wsg build runs build.command, then checks: index.html exists at the root of outDir; at most 300 files and 20 MB (warning above 3 MB); index.html at most 200 KB; absolute URLs to other origins in index.html and .js files (warnings, errors with --strict); a warning if index.html doesn't load wsg-sdk.js.
  • wsg publish repeats both steps, refuses a version that already exists on the games origin, then uploads the bundle and images, registers the game and the version with the portal, and (unless --draft is used) makes that version current.
wsg build on the example submission
$ 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:

PathContentCache-Control
/<slug>/<version>/…The bundle of each version, which never changespublic, max-age=31536000, immutable (HTML files add no-transform)
/<slug>/media/thumbnail.pngThe thumbnail (and cover.png if any), overwritten on every releasepublic, max-age=3600, s-maxage=60
/sdk/v1/wsg-sdk.jsThe SDK v1 file, patched by the portalpublic, 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-Type from 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 from https://games.leonogames.com/sdk/v1/wsg-sdk.js (see Testing).

Versions

  • Every release must increase version. An existing version is rejected (error 409); bump version and 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's game.json. Play sessions created after the release use the new limits.
  • 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.

Bash
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 (with publish and list) uses an in-memory fake API, so you can try the commands without touching the portal.
  • wsg publish --draft prints 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.js by default (the root .env.example also sets WSG_SDK_URL=/sdk/v1/wsg-sdk.js). Games created before 2026-10-10 default to an absolute localhost URL: copy the template's new vite.config.ts, or set this variable when building.