Skip to content
Developer reference

Architecture and developer reference

How OpenGameHub discovers, validates, builds and sandboxes community browser games into self-contained static bundles.

Supported engines and frameworks

Detected automatically from package.json dependencies, Vite configs and entry HTML or JS files. Unity WebGL, Godot Web and native binaries are not supported in V1.

3D engines
Three.js (three), React Three Fiber (@react-three/fiber), Babylon.js (@babylonjs/core), PlayCanvas (playcanvas)
2D engines
Phaser (phaser), PixiJS (pixi.js), HTML5 Canvas 2D
App frameworks
Vanilla HTML, JS or TS, React with Vite, Vue with Vite, Svelte with Vite

Build adapters

Every supported project compiles through one of two isolated adapters, then passes a sandbox verification step.

Static HTML static
Validates index.html, excludes dev config files, rewrites root-relative asset paths to ./ and verifies that every referenced file exists.
Vite vite
Builds in an isolated temporary directory with base: "./" and writes static files to /_games/<id>/<version>/.
Sandbox verification
Runs asset checks and script sanitization, then loads the game in an iframe without allow-same-origin.

Folder and asset rules

Three rules cover almost every validation failure.

Slug naming
Folder names in /games use lowercase kebab-case (a-z0-9-, 2 to 64 characters), for example games/tumble-club/.
Relative asset paths
Games run from /_games/<slug>/<version>/index.html. Use ./assets/sprite.png, not /assets/sprite.png.
Sandboxed iframe
Games run with sandbox="allow-scripts allow-pointer-lock" and never allow-same-origin, which keeps the parent page and its storage out of reach.

Manifest schema

opengamehub.json is optional. When present it is validated against this JSON schema by pnpm game:validate. Custom shell commands are not allowed.

opengamehub.schema.json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "OpenGameHub Game Manifest",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 80
    },
    "description": {
      "type": "string",
      "minLength": 1,
      "maxLength": 500
    },
    "version": {
      "type": "string",
      "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-[0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*)?$"
    },
    "author": {
      "type": "string",
      "minLength": 1,
      "maxLength": 100
    },
    "engine": {
      "type": "string",
      "enum": [
        "threejs",
        "react-three-fiber",
        "babylonjs",
        "playcanvas",
        "phaser",
        "pixijs",
        "canvas2d",
        "none"
      ]
    },
    "framework": {
      "type": "string",
      "enum": [
        "vanilla",
        "react",
        "vue",
        "svelte"
      ]
    },
    "buildAdapter": {
      "type": "string",
      "enum": [
        "static",
        "vite"
      ]
    },
    "entry": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
    },
    "thumbnail": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200
    },
    "category": {
      "type": "string",
      "enum": [
        "action",
        "arcade",
        "puzzle",
        "racing",
        "rpg",
        "shooter",
        "simulation",
        "sports",
        "strategy",
        "adventure",
        "other"
      ]
    },
    "tags": {
      "type": "array",
      "maxItems": 12,
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 32
      }
    },
    "controls": {
      "type": "array",
      "maxItems": 15,
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 64
      }
    },
    "aspectRatio": {
      "type": "string",
      "pattern": "^\\d+:\\d+$"
    }
  }
}

Common validation errors

CI validates every pull request. These are the failures contributors hit most often.

MISSING_ENTRY_HTML
Make sure index.html exists at the root of games/<your-game>/.
MANIFEST_FORBIDDEN_COMMAND_KEY
Remove shell overrides such as buildCommand or scripts from opengamehub.json.
Missing referenced assets
Check that every <script src> and <link href> points to a relative file that exists inside your game folder.
Fix most of these with the AI migration prompt