SDK Overview
The @hizi.io/engine-sdk package provides type-safe helper functions for frontend clients to communicate with the hizi engine.
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,
hasScheme,
// 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, TPlayerChoiceFeatureAward, ILoadConfigConfig, IBuyFeatureOption, IProgressionCounterConfig } from '@hizi.io/engine-sdk';Each rules-based game additionally exports its scenario, payload, and event types (e.g. IRouletteScenario, IBlackjackScenario, ICrashScenario / TCrashEvent, IMinesScenario, IKenoScenario) — the per-game guides document the shapes.
Endpoints
| Endpoint | Description |
|---|---|
/login | Exchange launch token for a session + read gameSettings |
/loadConfig | Get game configuration (stakes, RTP, buy-features) |
/placeBet | Place a bet or continue a multi-step round |
/collect | Collect winnings after a round completes |
/pfVerify | Replay a past round from its revealed PF seeds |
/refresh | Refresh the session token |
/reportAnimationEnd | Notify backend that animation has finished |
/updateBalance | Request an updated balance |