How to make a game for the GX Hub
Any browser game built with any AI can live in this hall. You bring the game; the hub gives it a game page, player accounts, friends, avatars, a leaderboard, and Grokonians — the hub's points that players earn by playing and creators earn when people play their games. This page is the whole path, step by step, with words you can copy straight to your AI.
1. What you need
- An AI that can write code. Any of them works — Muse, ChatGPT, Grok, Gemini, Claude, or another tool. The hub does not care which AI helped; the game page will say what you made it with.
- A browser to play-test your game.
- A place on the web that serves your game over https — any static host. Today the hub takes games by link: you host the game, the hub frames it and connects the points. (A zip-upload door exists in the hub's code but is switched off today; the link is the way in. The packaging rules in step 4 still make your game zip-ready.)
- A logo: square, at least 256×256 px, PNG, JPG or WebP, at most 200 KB.
- A GX Hub account (free, on the sign-in page). You can submit without one, but sign in first so the game — and what it earns — belongs to your profile.
No paid tools are required for any of this.
2. Tell your AI what to build
Copy this to your AI to start a game from nothing:
Build me a complete, self-contained HTML5 browser game in a single folder. Rules: - The entry file is index.html. No build step, no server code, no database. - Plain HTML, CSS and JavaScript (canvas is fine). No external CDNs, no remote scripts, fonts or images — every file lives in the folder and is loaded with a relative path. - The game must run inside an iframe on another site: fluid layout that resizes to its frame, and it must take keyboard focus when clicked. - No password or payment fields, no popups, no trying to navigate the parent page, no network calls, no eval of remote code, no obfuscated code. - It must play start to finish. When it works, give me the whole folder.
3. Connect Grokonians
Games earn their players Grokonians through one script the hub serves. Copy this to your AI:
Add GX Hub Grokonians to my game.
1. Load the hub SDK in index.html:
<script src="https://hub.gxhub.workers.dev/sdk/grokonians.js"></script>
2. Award points with Grokonians.earn(amount, reason) — whole numbers only,
1 to 10 per call. To award more, wait at least 1 second and call again
(the hub caps: 10 per event, 300 per session, 200 per game per day).
3. Show the player's balance: Grokonians.onBalance(function (b) { ... })
and Grokonians.isConnected() tells you the hub answered the handshake.
4. If my game has its own token currency, I can convert instead:
Grokonians.convert(tokens, reason) — the hub multiplies by the rate
I set when I submit the game.
5. The game must still run perfectly with no hub around: outside the hub
the SDK quietly does nothing. Never block gameplay on it.Optional — the leaderboard: when a run ends, your game can send its score to the hub page around it:
window.parent.postMessage(
{ type: 'scores:submit', score: Math.floor(score), waves: Math.floor(waves) },
'https://hub.gxhub.workers.dev');4. Fixing a game you already have
Make my existing game ready for the GX Hub: - Change every absolute path and URL for the game's own files to relative paths, and remove remote scripts, fonts and images (host the files in the game folder instead). - Make the layout fluid so it fits an iframe of any size, and make the game take keyboard focus on click without scrolling the parent page (preventDefault on arrow keys and space while playing). - Remove anything that opens popups, navigates the top window, asks for passwords or card details, or loads code from the network. - Keep my own site's headers from refusing the embed: do not send X-Frame-Options: DENY or SAMEORIGIN, and if I send a Content-Security- Policy, its frame-ancestors must allow https sites.
5. Test it like the hub will
Test my game the way the GX Hub will: - Open index.html from a plain static server and from the folder, and play it start to finish both ways. - Shrink the window small and stretch it wide: does it resize and stay playable? Click into it: do the keys work without scrolling the page? - Play it once with the Grokonians SDK unreachable: does everything still work? - Check the whole game folder: index.html present, every asset relative, nothing loaded from outside the folder.
6. Package it
For the link (today's door): put the game folder on your https host so the game itself is the page at one URL. The hub fetches the first 512 KB of that page once to check that it is alive and can be embedded.
Zip rules (the hub's checker enforces these on every file submission, and they are good discipline for your folder too):
- Zip at most 25 MB, at most 500 files, unzipped at most 100 MB.
index.htmlat the top of the zip (or inside one single wrapping folder).- Allowed file types only: html, htm, js, css, png, jpg, jpeg, webp, gif, svg, ogg, mp3, wav, wasm, json, txt.
logo.png,logo.jpgorlogo.webpat the top — square, 256×256 or bigger, at most 200 KB (or name it inmanifest.jsonas"logo").- Your title (3–80 characters) and description (at least 10, at most 1000 characters) go on the submit form.
7. Put it on the hub
- Sign in, then open Upload a game.
- Fill the Link form: your game's https URL, its logo, its title, its description, whether it is a game or an app, what you made it with, and — only if your game converts its own tokens — a token rate (more than 0, at most 10).
- Submit. You can submit up to 5 games a day. An automatic scan checks your page and listing first; plainly broken or rule-breaking submissions are rejected on the spot.
- A person reviews every game. Reviewers check that it runs, that it can be embedded, that it is yours to share, and that it plays by the rules below. Nothing goes live unreviewed.
- After approval, your game gets its page at
/game/…, a card on the home page, and plays inside the hub frame. Once the hub sees your SDK handshake, the game wears a “Grokonians connected” badge. - When people play, they earn Grokonians — and so do you: the creator receives a 10% share of what players earn in your game, plus 1 Grokonian for each new player each day, up to 500 a day per game. Grokonians are points, not money.
- From your game page you can add up to 6 screenshots (PNG, JPG or WebP, 5 MB each) so people can see it before they play.
- Keep your link alive: the hub re-checks linked games, and a link that fails three checks in a row leaves the hall until it is back.
8. The rules of the hall
- Keep it clean for everyone: no hate or extremist content, no threats, no adult or graphic content, no scams or “free money” tricks, nothing illegal.
- No impersonation: do not claim to be X, xAI or Grok, and do not use their logos.
- No malicious or sneaky code: no crypto miners, no packed or obfuscated code, no loading or evaluating remote code, no password, card or seed-phrase fields, no breaking out of the frame, no popups.
- Your game should stand on its own files. Code that reaches out to the network will be looked at closely by a human reviewer.
- It has to be yours to share.
Submitting through a bot instead? Create an upload token on your account page and submit the same link form to POST /api/v1/submit with it — the same scan, the same review, the same limits. This whole guide as plain text: INTEGRATE.md.
New to the coin? How Grokonians work — how you earn them, how creators are paid, and what they buy.
Building with an AI? GX Hub Studio — the free toolkit for AI builders: the contract as a machine-readable spec, an options catalog, a starter template with the bridge wired, and the hub's own validator.