Skip to content

Publishing your game ​

bash
npm run build

npm run build writes your game to dist/: an index.html, your code and only the assets the game uses. It prints a size report, and fails if dev-only code leaked into the build. dist/ is a static site, so it runs anywhere that serves files.

npm run build also adds what makes a link look good when it's shared: Open Graph and Twitter tags, a preview image (your first scenario baseline) and a web app manifest, so players can install the game to a home screen. Tags already in your index.html are kept. Fill in the details in debuff.config.ts; anything you leave out comes from package.json:

ts
import { defineConfig } from "@debuffjp/cli";

export default defineConfig({
  launch: {
    title: "squish",
    description: "Swap jelly blobs, chain cascades, feel the squish.",
    url: "https://you.itch.io/squish", // previews need it for an absolute image URL
    icon: "assets/icon.png",
    background: "#11140d",
    orientation: "portrait",
  },
});

Add video: "media/loop.mp4" to launch and the build adds og:video tags too, so Discord and other apps that play link previews show a clip instead of a still. Use a short, silent, looping MP4 (H.264, 1280x720 is plenty, under a few MB). Keep the image as well: X and many other sites only show the still.

Play inside an X post ​

From 0.32, add playerCard to launch and the build writes an X player card, so the game can play inside a post:

ts
launch: {
  url: "https://you.itch.io/squish",
  playerCard: { site: "@you", width: 480, height: 270 },
},

The build then writes twitter:card as player, with twitter:site, twitter:title, twitter:image (the preview image), twitter:player and the iframe's twitter:player:width and twitter:player:height. The player is launch.url; set playerCard.url when the page that can be framed lives elsewhere. X only loads https pages.

The build fails with config_invalid rather than write tags X would ignore: a site that isn't @name, a size that isn't a whole number of pixels, no launch.url, a player address that isn't https, or no preview image. It can't check whether X allows your domain, or whether your page allows framing. Test on a throwaway domain first.

Before 0.32, debuff build only wrote summary_large_image (or summary with no image), and a player card meant writing the tags into index.html by hand. Without playerCard nothing changes.

Get ready for a store with debuff ship ​

bash
npx debuff ship itch

debuff ship takes your dist/, checks what a store needs, writes the files to ship/ and tells you the upload step. It never uploads or signs in for you.

  • itch: ship/itch.zip, with index.html at the top, source maps left out, and itch.io's file count and size limits checked.
  • wavedash: checks wavedash.toml points at ./dist and that your game calls Wavedash.init(), then prints the wavedash commands.
  • press: ship/press/, a factsheet and screenshots from your scenario baselines, for press and store pages. Add author and links to launch to fill it in.

Add ship/ to .gitignore (new projects already have it).

Clips and stills for devlogs ​

From 0.26, the dev panel has rec and clip. Rec keeps the last 15 seconds of the game; clip saves them as a video in .debuff/captures/ (MP4 where the browser can record it, else WebM). capture("social") in the dev hooks letterboxes a still into 1200x675, the size X and Bluesky show, scaled by whole pixels so pixel art stays crisp.

Agents get the same through MCP: game_clip, social: true on game_capture, and a devlog-post prompt that captures a still and a clip and drafts short posts. The agent never posts; you do. debuff ship press adds what's in .debuff/captures/ to the press kit and flags WebM clips, which X and most stores don't take.

None of this goes into the game: templates and builds are unchanged. To open a drafted post yourself, postIntent({ text, url }, "x" | "bluesky") from @debuffjp/share returns a composer link with the text cut to fit.

Let players share it ​

Most players find games through a friend or a clip. @debuffjp/share adds both to your game:

ts
import { ClipRecorder, challengeLink, clipFile, readChallenge, share } from "@debuffjp/share";

const challenge = readChallenge<{ seed: number; score: number }>(); // opened from a friend's link?
const clips = new ClipRecorder(game.canvas); // the last ~12 seconds, as a video
clips.start();

// on a "share" button
const clip = await clips.clip();
await share({ text: `I scored ${score}. Beat it?`, url: challengeLink({ seed, score }), files: clip ? [clipFile(clip)] : [] });

share() opens the system share sheet, or copies the text and link where there isn't one. Challenge links carry game state in the URL, so a friend plays your exact run with a seeded game.random.

On your own site, or any static host ​

Upload dist/ to any static host: Cloudflare Pages, Netlify, GitHub Pages, Vercel or your own server. No server code is needed.

If your game uses worker threads with SharedArrayBuffer, the host must send two extra headers: see Using threads for what each host needs.

itch.io ​

Run npx debuff ship itch, or zip the contents of dist/ yourself (with index.html at the top level of the zip, not inside a folder). Create a project with Kind of project: HTML, upload the zip and tick This file will be played in the browser. Set the embed size to your game's resolution, or a multiple of it.

For a downloadable desktop version, see Desktop builds.

Game portals (Poki, CrazyGames and others) ​

Portals have rules about branding, links and ads. Read each portal's current requirements before you submit, but these are the ones that affect debuff games.

Turn off the splash for Poki

Production builds open with a short "made with debuff" card. Poki doesn't allow splash screens, so turn it off:

ts
const game = new Game({ canvas, width: 320, height: 180, splash: false });
  • Splash: Poki requires games to have no splash screens. Its rules allow your studio logo on the loading screen only. Other portals may not mind a short "made with" card, but splash: false is the safe choice for any portal.
  • No links out of the game: portals don't allow links that send players to other websites. debuff's splash has no link or URL, so it's fine where splashes are allowed. Don't add your own links or URLs in menus, credits or end screens unless the portal says they're allowed. CrazyGames, for example, allows community links (like Discord) in the main menu, as long as they aren't the main call to action and don't lead to a playable copy of the game.
  • Ads go through the portal's SDK: portals provide their own SDK for ads, and often for pausing and analytics. Don't add other ad systems.
  • Everything bundled: Poki blocks requests to outside servers unless they're approved. debuff builds bundle your code and assets into dist/, so a plain debuff game makes no outside requests. Keep it that way, and avoid loading fonts or scripts from CDNs.
  • Size matters: portals favour games that load fast. The size report from npm run build shows what players download at startup.

Requirements: Poki · CrazyGames

Before you ship ​

  • npm test and npm run build pass, and the build reports no dev leaks.
  • Play the build itself (npx vite preview), not the dev server, on a phone and a desktop.
  • For a portal: splash: false if it's Poki, no links out, and the portal's SDK wired in.