Skip to content

Getting started ​

Install the audited SDK version. Open a session and load its state before adding player controls.

What you need ​

  • A published game configuration and its approved rules and assets.
  • A frontend URL configured for that game in Hizi.
  • An authorized test launch from the Hizi Backoffice or operator integration.
  • The player currency, language, mode, jurisdiction, and effective limits.
  • The selected Operator Interface protocol and its test environment.

See the Studio Quickstart for game creation and frontend registration. Never embed a backoffice credential in the frontend.

Install ​

bash
npm install --save-exact @hizi.io/[email protected]

The package contains TypeScript declarations. Use a browser build tool such as the tool already selected for your game. Keep the resolved SDK version in your lockfile.

Install Operator Interface with the supplied registry access. Its package is @hoelle/operator-interface.

Connect once ​

Use SDK login(). It returns the session token, the URLs, gameSettings, operatorProtocol and tokenData. tokenData holds the player, game, language, currency, currency multiplier, mode and any open round. The launch guide explains the single-use token and the complete loading sequence.

Use the SDK error helper to retain operator error data.

This function loads data only. Call it from your loader and handle errors in that loader.

typescript
import { loadConfig, login } from '@hizi.io/engine-sdk';
import { launchParams } from './launch';
import { SdkRequestError } from './sdk-error';

export async function loadSession(search: string) {
  const connected = await login(launchParams(search));
  if (!connected.success) {
    throw new SdkRequestError(connected.error);
  }
  const connection = connected.result;
  const session = { backendURL: connection.backendURL, token: connection.token };
  const loaded = await loadConfig(session);
  if (!loaded.success) {
    throw new SdkRequestError(loaded.error);
  }
  return { connection, session, loaded: loaded.result };
}

Do not call login again after this exchange. SDK loadConfig decompresses gameResult and previousResults with the returned config.

login() copies eleven top-level keys and discards the rest of the raw connect reply. Most of it returns on the next call, because no other SDK operation narrows its reply. Two fields do not: gameVariables.rcElapsed and the singular freePlayInfo. Do not write your own connect call to recover them. See what login() does not return.

Before the first bet ​

  1. Check config.gameType against the frontend's supported game type. Use the deployment contract for older configs without this field.
  2. Apply the settings and effective stake limits.
  3. Set up Operator Interface and register incoming events.
  4. Load the assets and rules for every possible feature.
  5. Restore gameResult, gameRoundInfo, and amountToCollect. See recovery.
  6. Finish required loading messages.
  7. Enable only the actions allowed by the restored state.

A positive win does not mean that collect is available. An open round does not mean that a continuation can run automatically.

For slots, use the checked game flow example. For other games, implement the decisions in the vertical guide.

First verification ​

Launch in demo mode through the real wrapper. Confirm the currency, stakes, rules, mute state, and loading handshake. Place one player-requested bet. Disconnect during the next response, then reload the page.

The frontend must restore that round without placing another opening bet. Continue with the release checklist.