
Install
@minit-games/sdk is the bridge between your game and the Minit Games platform: install it once, then wire up a small number of lifecycle calls.
What the SDK does
Core lifecycle (initializeSDK, reportResult), config helpers for reading this Post's settings, and optional UI components (feedback pop-ups, a header bar, flying rewards).
Installing
npm install @minit-games/sdk
Import what you need and call initializeSDK() once at startup:
import { initializeSDK, loadingDone, reportResult } from '@minit-games/sdk'
initializeSDK()
// ...load assets, then optionally signal the game is ready (see below)...
loadingDone()
// ...when the run ends...
reportResult(score)
What to set up next
The baseline lifecycle is initializeSDK() at startup and reportResult(score) when the run ends. The options and result handling are covered in Reporting Results. Two further integration points are optional:
- Game Ready Signal: call
loadingDone()when your game has finished loading, so the platform holds its reveal until the game is playable. - Saving User Data:
getUserData()andreportResult(score, { userData })remember things about a player between sessions, such as save progress or settings. - Seeded randomness:
seededRandom()returns a number in[0, 1)from a generator seeded with the Post'sseedconfig value (see Config Values); without that value it falls back to the current time. Use it instead ofMath.random()for anything that affects gameplay (layouts, spawn order, shuffles) so every player of a Post gets the same challenge;patchSeed(value)re-seeds the generator, for example per level.