For AI coding agents
This page is written for a coding agent that was handed a game and told to make it run on ZokoGames, and for the person who supervises it. Everything an agent needs to integrate, test and package the game is public Markdown. Only the console steps (a signed-in studio account, the upload, the submit button) need a human.
What to fetch#
All of these are plain text, English only, with no JavaScript needed. Prefer the smallest file that answers the question.
| URL | What it is | Size |
|---|---|---|
https://docs.zokogames.com/llms.txt |
An index of every documentation page with a one-line description and a link to its Markdown. Start here. | A few thousand words |
https://docs.zokogames.com/<section>/<page>.md |
One page as Markdown: add .md to the page address, for example https://docs.zokogames.com/sdk/ads.md. Links inside are absolute. |
One page |
https://docs.zokogames.com/llms-full.txt |
Every English page in one file, each after a Source: line. |
About 1 MB. Too large for most context windows; use it for search, not for reading in full. |
https://sdk.zokogames.com/zokogames-sdk-v1.js |
The SDK script your game loads. Do not copy it into the build. | One script |
/sdk-engines/engines.json |
The engine plugins with version, size and SHA-256. | Small |
| Starter kits | Five runnable templates already wired to the SDK. | Zip files |
Code samples on a page may use a :::tabs block with == Label lines to group alternatives; each tab is a normal Markdown body. A > [!NOTE] or > [!IMPORTANT] quote is a callout.
Which pages to read for which task:
| Task | Fetch |
|---|---|
| Add the SDK to a plain JavaScript or Phaser game | getting-started/one-file-example.md, sdk/introduction.md, sdk/game.md, sdk/ads.md, sdk/data.md |
| Use an engine | engines/<unity, godot, construct-3, gamemaker, cocos, defold, phaser>.md, then engines/overview.md |
| Port a game that already runs on other web portals | porting/overview.md, then porting/<unity, godot, construct-3, gamemaker, defold, cocos, phaser-html5>.md for the engine, and guides/migrating.md for the call-by-call mapping |
| Make the upload pass | requirements/build-validation.md, requirements/limits.md |
| Fix an error message | guides/troubleshooting.md |
| Know what reviewers check | requirements/checklist.md, requirements/quality.md |
The minimal integration, with a check per step#
Do the steps in order. Each has a check an agent can run without a human.
- Load the SDK. Put
<script src="https://sdk.zokogames.com/zokogames-sdk-v1.js"></script>in the<head>ofindex.html, before your own code. Check:grep -c "zokogames-sdk-v1.js" index.htmlprints at least1. Keep every asset path relative (./game.js, not/game.js):grep -nE '(src|href)="/[^/]' index.htmlprints nothing. - Wrap every SDK call. The SDK can be missing, disabled or slow, and any call can reject with a plain
{ code, message }object. The game must run in all cases. Atry/catcharound eachawaitor a.catch()on each promise is enough.SDK.datais the exception: it is synchronous and throws. - Call
init()first.await window.ZokoGames.SDK.init(). It never rejects. Afterwards readSDK.environment:"zokogames"in the portal,"local"on your machine,"disabled"anywhere else. - Send the loading and gameplay signals.
loadingStart()when loading begins andloadingStop()when the first screen is playable.gameplayStart()when player input becomes live,gameplayStop()at every pause, menu, game over, and before any ad. - Add one rewarded ad with a fallback.
SDK.ad.requestAd("rewarded", { adStarted, adFinished, adError }). Pause and mute inadStarted, grant the reward only inadFinished, and carry on inadError. A request can fail withadsDisabled,unfilled,adblock,adCooldown,timeoutorother, and every one must leave the game playable. - Save with
SDK.data.getItem,setItemandremoveItemare synchronous, use strings only, and share a 1 MiB budget. - Respect the portal's settings. Read
SDK.game.settings.muteAudioat start and listen withaddSettingsChangeListener. - Run it locally. Serve the folder over HTTP on
localhost(for examplepython3 -m http.server 8080) and openhttp://localhost:8080/?sdk_debug=true. Check in the page's console:ZokoGames.SDK.environmentis"local", and the log shows[ZokoGames SDK] call game.loadingStopand, after the first interaction,call game.gameplayStart. A headless browser works; use alocalhostaddress, because the SDK is disabled on any other host unless the URL has?useLocalSdk=true. - Force the failure paths. Reload with
&ad_response=unfilled, then&ad_response=adsDisabled, then&user_response=logged_out. The game must stay playable each time. All switches are in testing. - Zip.
cd <build output folder> && zip -r ../game.zip .soindex.htmlis at the root of the archive. Zip the exported build (dist,build, the engine's web export), never the project root: source files,node_modulesand.gitwould be packed too, and files whose names start with a dot are never served. Check:unzip -l ../game.ziplistsindex.htmlwith nothing in front of it.
A complete game that does all of this is on Copy-paste example: one index.html. The same steps for an engine are on that engine's page.
Rules the validator and reviewers enforce#
A build that breaks one of these is rejected on upload or sent back in review. The numbers are all in limits at a glance.
index.htmlat the zip root, or inside exactly one top-level folder.- At most 1,500 files and 250 MB unpacked; an estimated first download of at most 50 MB (aim for 20 MB).
- No absolute paths,
.., backslashes, symbolic links, encrypted or duplicate entries. - No server-side or executable files such as
.php,.exe,.sh,.pyor.jar; the host serves static files only. - No other portal's SDK, no ad network code, no threaded WebAssembly (
SharedArrayBufferis unavailable). - Bundle fonts, libraries and assets into the zip: external hosts are warned about (
origin_*), can be blocked, and rule out offline play; ad networks are never allowed. - The first
gameplayStartwithin 20 seconds of load. - Sound starts only after a player gesture and obeys
muteAudio.
Each rejection has a code listed with its fix in build validation and by its exact message in troubleshooting.
What needs a human#
| Step | Why |
|---|---|
| Create the studio and the game draft | It needs a signed-in player account and acceptance of the developer terms. |
| Upload the zip and press Submit for review | These are console actions on a signed-in session. The developer API is read-only: it can list builds and show their state once a human has uploaded one. |
| Cover images and the description | They must be made for the game; see covers. |
An agent can do everything else, and can prepare the listing text and the covers for the human to upload. The human then follows steps 6 and 7 of Your first game live in 30 minutes.