Skip to content
Browse documentation

A complete publishing example

Configure a game listing, build and package browser files, verify the release, and publish an update.

View Markdown
On this page

1. Configure the listing

Choose one format for the same game listing. New kits detect spawnkit.config.ts or spawnkit.config.json at the project root and produce dist/spawnkit.config.json. TypeScript adds editor type checks; JSON needs no code. Keep one source file, because duplicate configurations stop the build.

TypeScript
import { defineConfig } from "./spawnkit/config"

export default defineConfig({
  title: "Golden Dash",
  description: "Collect gold and dodge obstacles in a fast arcade challenge.",
  genre: "Arcade",
  dimension: "2D",
  coverPath: "media/cover.webp",
  details: {
    objective: "Collect as much gold as possible.",
    controls: "Move with the arrow keys.",
    devices: "Desktop keyboard"
  }
})

Save the TypeScript example as spawnkit.config.ts, or the JSON alternative as spawnkit.config.json, beside package.json. Supply a real public/media/cover.webp file up to 1 MiB. To add video, set trailerPath to media/trailer.mp4 and supply that file under public/: at most 2 MiB and 60 seconds. Start on gameplay; the preview uses the beginning of the clip.

2. Build and inspect

From your game folder
pnpm lint
pnpm build
pnpm preview

Open the preview URL. Play through movement, scoring, restart, and any audio interaction. Check the browser console and network panel. Confirm dist/index.html, dist/spawnkit.config.json, and your referenced media exist. Stop preview before packaging.

3. Package the contents of dist

Run one of these from your game root. The Bash example needs the zip utility installed. Both examples stop if game-release.zip already exists, so an older archive cannot silently retain stale files.

PowerShell
if (Test-Path -LiteralPath "game-release.zip") {
  throw "game-release.zip already exists; choose a new filename."
}
Compress-Archive -Path "dist/*" -DestinationPath "game-release.zip"
Inspect the archive before uploading
game-release.zip
├── index.html
├── assets/
├── media/cover.webp
└── spawnkit.config.json

There must be no outer dist/ directory in the archive. Keep the expanded build below 20 MiB and fewer than 1,996 files. See Publish your game for upload limits and the dashboard steps.

4. Publish and verify the live game

Open Upload game, select the archive, review the imported details and media, and deploy. This flow creates a new project. Wait for a successful result, then open the returned game URL in a fresh browser tab.

CheckExpected result
First loadThe game starts and required requests succeed.
GameplayControls, scoring, and restart match your local preview.
MediaCover and optional trailer appear, or the deployment reports an actionable omission warning.
DiscoveryListing approval is tracked separately from successful hosting.

5. Update the same hosted project

Keep the existing project ID. Repeatedly using the new-game upload flow creates separate projects. After @spawnkit/cli is published, link your source folder to the intended project and review the deployment plan before sending an update.

Update a generated game
pnpm dlx @spawnkit/cli login --site https://spawnkit.cloud
pnpm dlx @spawnkit/cli link --project YOUR_PROJECT_ID
pnpm install
pnpm lint
pnpm build
pnpm dlx @spawnkit/cli deploy --env production --dry-run
pnpm dlx @spawnkit/cli deploy --env production

This source-deployment example is for a generated SpawnKit game with game.config.json and a pnpm lockfile. It does not adopt an arbitrary uploaded HTML game. It is a separate path from uploading a built ZIP. Use the CLI reference for logs, release promotion, and rollback. Until the package is published, use support for an existing-project publishing path rather than creating a duplicate.

Need a hand? Get support

Explore the guides

Build your first game

Download a standalone game kit, run it locally, and make your first change.

Create and build a game with @spawnkit/cli

Start in a parent folder, generate your game, then run every development command inside the new game folder.

Upload an existing browser game

Upload a self-contained browser build. Your original source, engine, and build tools can stay as they are.

Publish your game

The dashboard accepts a ZIP of your built game. You will need an account to deploy it.

Use the SpawnKit dashboard

The dashboard manages your hosted games. Your editor or AI agent remains where you change and build your game source.

Make a browser game with Codex

Use Codex with a standalone TypeScript game kit. Start with a working scene and improve it one playable change at a time.

Make a browser game with Claude Code

Use Claude Code with a standalone TypeScript game kit. Start with a working scene and improve it one playable change at a time.

Make a browser game with Cursor

Use Cursor with a standalone TypeScript game kit. Start with a working scene and improve it one playable change at a time.

Extend your game

Find the right files, make a focused change, and check it in a playable build.

A complete publishing example

Follow a small example from editable source to a ZIP with index.html at its root. Use your own game title, description, and artwork.

Add tools to an existing game

Keep a recoverable baseline, inspect the proposed changes, and verify one addition at a time.

Test and debug your game

Combine automated checks with a short playthrough of the production build. A successful build alone does not verify gameplay.

Project structure and configuration

Your downloaded kit is a standalone TypeScript project. Its files belong to you and do not depend on the SpawnKit repository.

SpawnKit CLI reference

A command-by-command reference to the implemented CLI. Local generation works without an account; hosted operations require access to a project.

Accounts and access

Building locally is account-free. Publishing requires an account with access to the target project.

Agents and API resources

Public discovery endpoints are account-free. Use the dashboard or @spawnkit/cli for publishing.

16 guides available