
How to Convert Your Game for Minit Games
Already have a browser game? Here's how to make it a Game.
Who this is for
Anyone with a working HTML5/JS browser game (any framework or a plain <canvas>). Building in an engine with its own Minit Games toolkit (Unity, Godot, Defold, PlayCanvas)? Use that engine's Get Started guide instead.
The Game model
A Game is a single load → play → result session, not a standalone app. The host owns the surrounding chrome: loading transition, menus, leaderboards, per-player persistence, the result/replay screen. Your game owns the gameplay in the middle and tells the host when it's ready and when a run is over. Converting is mostly stripping out what your game used to own itself.
Wire in the SDK
-
Add the SDK. With a build step:
npm install @minit-games/sdkWithout one (a single
index.htmlwith plain<script>tags), skip the install and callwindow.minit.*directly. The core host API (loadingDone,reportResult,getUserData,getConfigValue) has matchingwindow.minitmethods with the same names. -
If you installed the npm package, call
initializeSDK()once at startup, before anything else touches the SDK:import { initializeSDK } from '@minit-games/sdk' initializeSDK()npm-only: there's no
window.minitequivalent; skip it on the direct path. -
Call
loadingDone()once your first interactive frame is ready. See Game Ready Signal. -
Call
reportResult(score)exactly once, when the run ends. See Reporting Results. -
Persist save state through the SDK, not the browser:
getUserData()on startup,reportResult(score, { userData })at the end. See Saving User Data.
Mod-configurable values are read with getConfigValue() on either path. The platform's built-in feedback/reward UI (@minit-games/sdk/ui) is npm-SDK-only. Full API: Install the Minit SDK.
What to remove or adapt
- Portrait, instant load, 60fps. Reflow landscape-only layouts; no splash screens or asset-streaming delays.
- Touch-only input. Remove keyboard and mouse-hover dependence.
- Replace
localStorage/cookies with SDK userData. The game iframe runs in a sandboxed, opaque origin, so client-side storage doesn't persist between plays. - Remove in-game start/replay menus and result screens. The host owns these; yours will conflict with its flow.
- No external network requests. No analytics pings, CDN assets, or third-party APIs. Everything ships in your ZIP.
- Bundle your fonts. Don't rely on a Google Fonts
<link>. See Using Fonts in Your Game.
Package & upload
Package as a .zip with index.html at its root, containing your built output. A self-contained single .html file may be uploaded directly instead of a .zip — Studio packs it into a zip for you. The full bundle contract is in Platform Requirements; the upload and publish flow is in Your First Game.
Next steps
- Install the Minit SDK: the full SDK API, including
getConfigValue()and the optional UI helpers. - Using Fonts in Your Game: bundling custom fonts.