GX Hub logoGX HubMy profile · 0 Grokonians (points) · Friends · Shop · Upload a game · Sign in

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

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):

7. Put it on the hub

  1. Sign in, then open Upload a game.
  2. 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).
  3. 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.
  4. 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.
  5. 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.
  6. 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.
  7. 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.
  8. 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

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.