Ship
Hosting a Web Build on Your Own Site
Edit on GitHubPut a Hearth web export on your own domain, a static host, a subfolder, or an iframe embed: HTTPS, gamepad/audio, and the single-file build for local double-clicks.
A Hearth web export is a static, self-contained folder: no server code, no build step on the player’s machine, no external requests. That means you can host it anywhere that serves plain files: your own domain, a static host, a subfolder of an existing site, or a shared link. This page covers everything except itch.io, which has its own upload flow (see shipping-to-itch.md).
What you’re shipping
hearth export web --allow build # folder build → export/web/
export/web/ is four things and nothing else:
| File | What it is |
|---|---|
index.html | Boot page, titled from buildSettings.title |
hearth-player.js | The runtime + renderer as one script |
project.bundle.json | Scenes, scripts, and settings |
assets/ | Your sprites, sounds, music, and fonts |
Upload that folder as-is. The game boots straight into your first scene with no Hearth branding, letterbox-scaled to whatever space it’s given. There is nothing to configure on the host. Any static file server works.
One catch: don’t double-click
index.html. Because the boot pagefetchesproject.bundle.json, browsers block it when opened from afile://path. For a build you can open by double-clicking (or email, or a USB stick), use the single-file export instead:hearth export web --single-file --allow buildinlines the player and every asset into oneindex.htmlthat runs from anywhere. It’s a bigger file but needs zero requests. For a hosted site the folder build is smaller and loads faster. Thefile://limit only bites local double-clicks.
Hosting options
Any static host (Netlify, Cloudflare Pages, GitHub Pages, Vercel, S3…)
Point the host at export/web/ as the publish directory (or drag-and-drop
the folder into their dashboard). No framework preset, no build command:
it’s already built. A few host-specific notes:
- GitHub Pages: push
export/web/’s contents to agh-pagesbranch or a/docsfolder onmain. Because the game lives at a subpath (username.github.io/repo/), confirm it still boots. Hearth’s export uses only relative paths (./hearth-player.js,./project.bundle.json,./assets/…), so a subpath is fine as long as you upload the whole folder together. - Netlify / Cloudflare Pages / Vercel: set the publish/output directory
to
export/weband leave the build command empty. Drag-and-drop deploy works too. - S3 / any bucket + CDN: upload the folder, enable static website
hosting, set
index.htmlas the index document. Serve.jsonand.jswith sensible content types (most hosts infer them from the extension).
A subfolder of an existing site
Drop the whole export/web/ folder somewhere under your web root, say
yourdomain.com/games/star-catcher/, and link to it. Everything the export
references is relative, so it doesn’t care what path it lives at. Keep the
four items together; don’t split assets/ off from index.html.
Embedding in a page you control (<iframe>)
To put the game inside one of your own pages rather than linking out to it,
host the folder and point an iframe at its index.html:
<iframe
src="/games/star-catcher/index.html"
width="960" height="540"
style="border:0"
allow="fullscreen; gamepad; autoplay"
></iframe>
Match width/height to your project’s buildSettings.width/height
(hearth inspect project --json prints them) so the game isn’t scaled inside
a mismatched frame. The allow attribute matters: gamepad lets controller
input reach the game across the frame boundary, and autoplay lets music
start on the first player interaction. (Hearth’s player resumes audio
silently on the first pointer/key/touch. Browsers block sound until then, so
there’s always at least one gesture before audio.)
Custom domain & HTTPS
Serve over HTTPS. Beyond audio, Gamepad API access and some input paths are
gated to secure contexts in modern browsers, so a plain http:// host can
quietly disable controller support. Every static host above gives you HTTPS
by default; if you’re on your own box, terminate TLS (Caddy, a reverse proxy,
or your CDN) rather than serving http://.
Loading screen
While the bundle and assets download, players see only what you set in
buildSettings.loading: a background color, an optional centered image, and
an optional minimal spinner. Set them with updateSettings (or the editor’s
Game Settings → Loading section); no hand-editing of hearth.json. See
export.md for the fields.
Quick checklist before you link it out
hearth validate --jsonis clean (export already refuses on validation errors, but check first).- You uploaded the whole
export/web/folder, together. - The page is served over HTTPS.
- You opened the hosted URL yourself and it booted into your first scene: itch.io-style preview isn’t available on a bare host, so this manual boot is your smoke test.
- If you embedded it, the iframe
allowlist includesgamepadandfullscreen, and the dimensions matchbuildSettings.
For the browser-playable itch.io upload (the .zip with the “played in the
browser” checkbox), see shipping-to-itch.md. For a
downloadable native app instead of a web build, see
ship-desktop.md.