Appearance
hizi engine SDK
The hizi engine SDK (@hizi.io/engine-sdk) provides type-safe helper functions. Your game frontend uses these functions to communicate with a running hizi engine.
How It Works
hizi already runs the hizi engine. hizi also manages the hizi engine for you. Your frontend communicates with the hizi engine through the hizi RGS platform:
plaintext
Your Game Frontend ↔ HTTP/WebSocket ↔ hizi RGS ↔ hizi engine ↔ output filesThe backend handles outcome selection, balance management, authentication, and game state. You make the API calls. You render the results.
Exports
typescript
import {
// Core game functions
login,
loadConfig,
placeBet,
collect,
pfVerify,
// Session management
refresh,
reportAnimationEnd,
updateBalance,
enableWebSockets,
// Free play helpers
getFreePlaysRemaining,
getFreePlayStake,
// Game-specific request helpers
rouletteAdditionalData,
blackjackInitialData,
blackjackActionData,
CRASH_EVENTS,
crashPlaceBetData,
crashCollectData,
minesPickData,
kenoPickData,
// Type guards
isCashChoice,
isFeatureChoice,
// Scenario compression codec
decodeScenario,
compressScenario,
expandScenario,
compressStep,
expandStep,
hasScheme,
buildSymbolToInt,
SCHEME_VERSION,
// Response types
TNetworkResponse,
TNetworkSuccess,
TNetworkError,
IErrorResponse,
// Constants
API_RETURNCODES,
recoverableErrorCodes,
defaultNetworkTimeout,
// Reply types
IConnectReply,
ILoadConfigReply,
IPlaceBetReply,
ICollectReply,
IPfVerifyReply,
// Request option types
ISessionOptions,
ILoginOptions,
IPlaceBetOptions,
ICollectOptions,
IPfVerifyOptions,
// Supporting types
IBalanceEntry,
IBalanceReply,
IGameSettings,
ITokenData,
IGameState,
IGameRoundInfo,
IFreePlayInfo,
WebSocketHandler,
} from '@hizi.io/engine-sdk';Engine Types
Game result types are also available from the SDK:
typescript
import type { IGameResult, IScenarioInfo, ISpinInfo, ILoadConfigConfig, IBuyFeatureOption, IProgressionCounterConfig, IProgressionEvent, TPlayerChoiceAward, TPlayerChoiceFeatureAward, TPlayerChoiceCashAward } from '@hizi.io/engine-sdk';Each rules-based game also exports its own scenario, payload, and event types (for example, IRouletteScenario, IBlackjackScenario, ICrashScenario / TCrashEvent, IMinesScenario, IKenoScenario). The per-game guides document these shapes.
Endpoints
| Endpoint | Description |
|---|---|
/login | Exchange the launch token for a session. Read gameSettings |
/loadConfig | Get the game configuration (stakes, RTP, buy-features) |
/placeBet | Place a bet, or continue a multi-step round |
/collect | Collect the winnings after a round completes |
/pfVerify | Replay a past round from its revealed PF seeds |
/refresh | Refresh the session token |
/reportAnimationEnd | Notify the backend when the animation finishes |
/updateBalance | Request an updated balance |
Game Guides
The endpoints above are the same for every game. Only the scenario value that placeBet returns changes per game type. These guides are part of the SDK docs. For each game type, a guide explains the scenario data structure, any additionalData the round needs, and how to integrate the round into your frontend.
| Guide | What it covers |
|---|---|
| Slot Games | Boards, wins, cascades, hold & win, sticky symbols, multiplier collection, wheel features |
| Plinko | Bucket indexes, row/risk selection via buy features, multiplier lookup, animation of a ball drop |
| Frogger | Flow of the wager stake across multiple steps, risk selection, ladder of cashout multipliers, collect-or-continue loop |
| Mines | Pick positions via additionalData, tile states of the board, selection of mine count, cashout progression |
| Hi/Lo | playerChoice-driven higher/lower/skip flow, dynamic card odds, skip re-dealing, multiplier rounding |
| Keno | Player numbers via additionalData (or auto-pick), playerNumbers/drawnNumbers, rendering of the pay table |
| Bingo | Ticket count via additionalData, board shape from rows/cols/freeCellCount, per-pattern prize table |
| Over/Under | Single-roll instant resolution, threshold/direction selection, multiplier lookup, win calculation |
| Roulette | Multi-bet rounds via additionalData, the polymorphic selection shape, per-bet settlement[] |
| Blackjack | Initial deal with side bets, hit/stand/double/split/insurance flow, the final IBlackjackScenario |
| Crash | Opening a round via crashPlaceBetData, the curve events over the websocket, manual cashouts via collect |
See the Game Guides overview for the longer summaries.
Next Steps
- Getting Started - Install the SDK. Make your first API calls.
- Game Flow - Full implementation with a class-based example.
- Response Handling - Understand
IGameResultand multi-step scenarios. - Error Handling - Handle network and game errors gracefully.
- Buy Features - Buy-features that the engine prices, wager features for gamble and cashout ladders, and free plays that the operator grants.
- Types - The reply, request-option, and engine result types that the package ships.