05 — the arcade around your game
Arcade events
Two small integrations make your game feel native in the arcade: a per-round report that feeds points and quests, and a postMessage bridge between your iframe and the hub UI.
POST
{HUB_API_URL}/api/internal/game-historyMoney is the bank's job, but XP points, daily quests and the season jackpot tickets are the hub's. Your backend reports once per round, win or loss, after the settle:
request — note: this endpoint is camelCase
X-API-Key: <HUB_API_KEY>
{ "userId": "tg:123456789", "gameType": "yourslot", "token": "sol",
"betAmount": "5", "payout": "12.50", "won": true }Fire and forget
A failure here must never block or roll back the money settle. But don't skip it: without this call the player wins money yet earns no points and no quest progress — and they will notice. A bonus buy is reported as one round (
betAmount = the bonus price, payout = the total win).postMessage bridge
Send to window.parent from the Unity client:
| Message | When |
|---|---|
{ type: "domin8:ready" } | your game finished loading — hides the hub loader |
{ type: "domin8:game-over", result, token?, wager?, balance? } | a round ended — the hub flashes win/lose feedback |
{ type: "domin8:exit" } | player pressed your back-to-lobby button |
{ type: "domin8:play-for-real" } | player wants to leave free play |
{ type: "domin8:ambient", on } | your ambient audio state changed |
And listen for one message from the hub:
| Message | What to do |
|---|---|
{ type: "domin8:mute", muted } | the arcade-wide sound toggle — wire it to your Unity audio mixer |
Balance display
After every settle the bank pushes the fresh balance to the hub UI over its own websocket. You don't build any balance sync — just show the balance your backend returns per spin.