Skip to content

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

EndpointDescription
/loginExchange launch token for a session + read gameSettings
/loadConfigGet game configuration (stakes, RTP, buy-features)
/placeBetPlace a bet or continue a multi-step round
/collectCollect winnings after a round completes
/pfVerifyReplay a past round from its revealed PF seeds
/refreshRefresh the session token
/reportAnimationEndNotify backend that animation has finished
/updateBalanceRequest an updated balance