Game SDK
Store and tips
Sell items, access, and consumables in your Game, accept tips, and get paid out. MiraDock runs checkout, balances, and payouts; your Game only reads entitlements.
Turn on sales
- Complete payout onboarding in Earnings. Onboarding runs through Stripe, and your payout account must be active before a Game can sell or accept tips.
- Define SKUs with
set_game_skus. You can save definitions before onboarding finishes; nothing is for sale until the Store is enabled. - Enable the Store, tips, or both with
set_game_monetizationor the Game's dashboard page. Enabling fails until your payout account is active.
// set_game_skus (MCP). Replaces the complete list.
{
"slug": "space-miner",
"skus": [
{ "sku": "level-pack-2", "name": "Level pack 2", "kind": "access", "priceCents": 299 },
{ "sku": "gold-skin", "name": "Gold ship", "kind": "item", "priceCents": 99 },
{ "sku": "extra-life", "name": "Extra life", "kind": "consumable", "priceCents": 50, "sortOrder": 3 }
]
}
// set_game_monetization (MCP). Requires an active payout account to enable.
{ "slug": "space-miner", "shop": true, "donations": true }A Game can be free, free with tips, paid SKUs only, or paid SKUs plus tips. When the Store or tips are unavailable, MiraDock.capabilities.shop and MiraDock.capabilities.donate are false and the play page shows nothing for sale.
SKU kinds
| Kind | Use it for | Entitlement |
|---|---|---|
item | Something the Player owns, such as a skin | Granted once and kept. Buying again rejects with already_owned. |
access | Unlocks part of the Game, such as a level pack | Granted once and kept. Buying again rejects with already_owned. |
consumable | Something used up, such as lives | Quantity rises by 1 per purchase and falls with shop.consume. |
supporter (tip) | Created by the platform when tips are on | Quantity counts the Player's tips. Never paywall core content behind it. |
| Field | Rule |
|---|---|
sku | 1–64 lowercase letters, digits, underscores, or hyphens; unique per Game. supporter is reserved. |
name / description | Name 1–200 characters; optional description up to 5,000 characters |
kind | item, access, or consumable. A SKU's kind cannot change after it is created. |
priceCents | Integer USD cents, minimum 50 ($0.50) |
sortOrder | Optional integer; shop.list returns SKUs in this order |
Count | Up to 64 SKUs per Game |
Removal | Omitted SKUs become inactive. Players keep what they bought. |
Use the Store from your Game
const ctx = await MiraDock.ready();
let owned = ctx.entitlements; // [{ sku, kind, quantity, grantedAt }]
await MiraDock.on("entitlements", (list) => { owned = list; render(); });
if (MiraDock.capabilities.shop) {
const items = await MiraDock.shop.list(); // [{ sku, name, description, kind, priceCents, owned, quantity }]
const result = await MiraDock.shop.purchase("level-pack-2");
// { status: "purchased", entitlement } | { status: "cancelled" } | { status: "signin_required" }
const left = await MiraDock.shop.consume("extra-life", 1); // { ok: true, quantity }
}
if (MiraDock.capabilities.donate) {
await MiraDock.tip.open({ suggestedCents: 300 }); // { status: "donated" | "cancelled" | "signin_required" }
}| Call | Behavior |
|---|---|
shop.list() | Active SKUs with the Player's owned flag and quantity. Resolves [] when the Store is off. |
shop.entitlements() | The Player's entitlements; [] for guests. Also delivered in ctx.entitlements and the entitlements event. |
shop.purchase(sku) | Opens the host checkout sheet. Rejects with already_owned, not_found, rate_limited, timeout, or unsupported. |
shop.consume(sku, quantity) | Consumables only. Rejects with insufficient when the Player has too few, signin_required for guests. |
tip.open({ suggestedCents }) | Opens the tip sheet. suggestedCents is optional, an integer from 100 to 50,000. |
donate.open({ suggestedCents }) | The original name of tip.open; opens the same tip sheet. Kept for existing Games. |
Purchases open a checkout sheet on top of your Game. Your Game receives pause when it opens and resume when it closes. Like every SDK call, a purchase or tip times out after 10 seconds: if the Player has not confirmed by then, the sheet closes and the call rejects with timeout. A payment the Player already confirmed still completes, and the entitlements event delivers it.
What Players see
Players pay from a prepaid MiraDock balance in US dollars. They add $5, $10, or $25 by card from their balance page; the checkout sheet links there when the balance is too low. Purchases and tips require a signed-in Player, so guests get { status: "signin_required" } and a sign-in prompt. Balances are non-refundable and cannot be cashed out; only MiraDock can refund a purchase, and refunds return to the Player's balance. See the Balance terms.
When tips are on, the play page shows a Tip the creator button outside your Game, with the line “Tips are for the game you're playing.” The tip sheet names you and the Game, lets Players choose $1, $3, $5, or $10 or enter any amount from $1.00 to $500.00, and shows the split: the creator receives the tip rate on the Balance terms page and MiraDock keeps the rest. Creators cannot buy from or tip their own Games.
Fees and payouts
MiraDock keeps a platform fee on each purchase and tip, set per kind. The current rates are published on the Balance terms page and shown in your dashboard. The fee is rounded down to a whole cent and you receive the rest.
- New earnings are pending for 7 days, then become available.
- Every Monday at 14:00 UTC, available earnings of $10 or more transfer to your connected Stripe account. Stripe then pays your bank on its own schedule.
- Payouts are skipped while your payout account is inactive, on hold, or your account is suspended.
get_game_statsreports plays, Players, leaderboard sizes, and seven-day purchase and tip counts. Itsrevenuefield is currentlynull; use Earnings for money totals.
Limits
| Action | Limit |
|---|---|
| Store calls (list, entitlements, consume, opening a purchase) | 30 per minute per Player per Game |
| Opening the tip sheet | 5 per minute per Player per Game |
| Confirming a purchase / a tip | 30 / 5 per minute per Player per Game |
| Any SDK call | Times out after 10 seconds |
The full contract, including every error code, is in the Game SDK specification.