# itch-and-own-host-deploy

Package a browser game for itch.io (zip with index.html at the root, size and file limits, SharedArrayBuffer setting) and for our own host (Cloudflare Pages with COOP/COEP headers)

- **Space:** game-dev-web-public (https://github.com/Tech-Realm/space-game-dev-web-public/tree/main/itch-and-own-host-deploy)
- **Level:** L2 (as the registry reports it)
- **Keys it needs (names only):** none
- **Tools:** python3
- **Routes:** itch-free, cloudflare-pages; checks: 2
- **Uses:** new (no recorded use yet)
- **Install:** `logicpacks pack use game-dev-web-public/itch-and-own-host-deploy` or MCP `get_pack game-dev-web-public/itch-and-own-host-deploy`
- **Files:** CHANGELOG.md, code/prep_web_build.py, outcome/EVIDENCE.md, outcome/checks.yaml, outcome/fixtures/bad/index.html, outcome/fixtures/game/assets/level1.json, outcome/fixtures/game/index.html, outcome/fixtures/game/js/main.js, outcome/results.json, pack.yaml, spec/SPEC.md, spec/source.md

## Purpose (spec/SPEC.md)

## Goal
One build folder becomes a valid itch.io HTML5 upload and a Pages deploy, with the cross-origin isolation headers threaded/WASM games need.

## Steps
1. Build the game into one folder with `index.html` at its root and only relative paths.
2. Run `python3 code/prep_web_build.py <build-dir> --out dist/` : validates, writes `_headers` (COOP/COEP + long cache for hashed files), and makes `dist/game-itch.zip`.
3. itch.io: create an HTML game, upload the zip, tick 'SharedArrayBuffer support' if the game uses threads, set the viewport size.
4. Own host: `wrangler pages deploy <build-dir> --project-name <name>` (see the cloudflare space); `_headers` is applied by Pages.
5. Check the live page with `headless-game-qa`.

## Edge cases
- itch.io limits (check current docs): zip upload size, extracted file count, and per-file size.
- Absolute paths (`/assets/..`) break on itch.io's subfolder hosting.
- COEP require-corp blocks cross-origin assets without CORP/CORS headers: self-host fonts and scripts.

## Don'ts
- Don't upload games with third-party assets you have no rights to (keep those private, see igi-games).
- Don't put API keys in the client bundle.



---

Canonical URL: https://logicpacks.io/packs/game-dev-web-public/itch-and-own-host-deploy

Developed by TechRealm (techrealm.online), the software team. Operated by Al Jash Trading (Establishment), Abu Dhabi, since 1994, the legal entity that hosts and is responsible for the service. Economic licence CN-1030597, Abu Dhabi Registration Authority. Address: Office 5, Bani Yas West 4, Bani Yas, Abu Dhabi, UAE. Website: https://aljashtrading.com. Contact: hello@logicpacks.io, security@logicpacks.io, WhatsApp +1 713 632 2262 (https://wa.me/17136322262).

Machine-readable index: [/llms.txt](/llms.txt). Plain facts: [/about.md](/about.md). Safety: [/safety.md](/safety.md).
