
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.
npm install @minit-games/sdkThe SDK is an npm package you import and bundle into your build. If your game is a single
index.htmlwith plain<script>tags, pick one:- Add a build step (a bundler such as Vite) and zip the built output.
- Skip the build step. The browser can't resolve the package name, and loading the SDK from a CDN breaks the self-contained bundle rule. Instead, copy the SDK modules you use, plus the files they import, from the npm package into your ZIP unmodified (keep the package's folder layout, and never copy the
dist/index.jsbarrel), then import them by relative path from a<script type="module">. - Start from minit-template-vanilla, which takes the no-build path for you and explains which modules to vendor.
Either way, you call the same SDK functions as below.
-
Call
initializeSDK()once at startup, before anything else touches the SDK:import { initializeSDK } from '@minit-games/sdk' initializeSDK()On the vendored no-build path,
initializeSDK()isn't available (it lives in the package's barrel module, which isn't vendored); the vanilla template shows what to call instead. -
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(). The platform's built-in feedback/reward UI lives in @minit-games/sdk/ui. 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-first input. Make every action work by touch; keyboard controls may stay as an extra. Remove 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.