Operator Games API SDK

The Operator Games API SDK is a JavaScript/TypeScript library that provides operators with a unified integration layer for multiple game suppliers, starting with Turbostars and OneTouch Originals. With this SDK, you can have:

  • A unified interface by integrating one SDK for multiple game suppliers,

  • Automatic token validation done with Hub88 backend,

  • Automatically select the correct supplier based on game code received after a successful token validation,

  • Integrate games directly without iframes (Shadow Mode),

  • Configuration management by handling provider-specific configurations seamlessly.

As the SDK runs natively, it avoids iframe limitations, reduces overhead, and provides a smoother, mobile-friendly gaming experience.


Integration Flow

The integration follows a simple two-step process:

spinner

Authorisation


Integration Steps

1

Step 1: Authorise Game Session (Backend) - Authorise API

Your backend must call the Hub88 Authorise API /game/authorize to retrieve the initialisation payload.

Authorise API Endpoint

  • Staging

  • Production:

Request Body

Response

Return this payload securely to your frontend.

2

Step 2: Initialise SDK Client (Frontend)

Use the data from the authorisation request's response to initialise the Operator Games API SDK on your frontend.

Installation via CDN

circle-check

Basic Integration Example

Advanced Configuration

This example uses two types of optional parameters for the initialisation.

  1. Optional parameters within the initialisation. These parameters help to customise the experience depending on how you wish the player to experience the gameplay.

  2. Advanced parameters defined in the meta object. These parameters are supplier-specific and allow to further update how the game is displayed, including but not limited to, changing the styles, controlling URL routing, updating currencies, and much more.

    1. See Turbostars' advanced options in the code sample below (starting from row 12).


SDK Methods and Lifecycle

Method
Description

isInitialized()

Returns true if SDK is ready.

getProvider()

Returns the detected provider (e.g., turbostars).

update(config)

Updates optional configuration (e.g., language, meta).

destroy()

Cleans up resources and terminates the session.

Instance Methods


Multi-Supplier Support

This SDK is built on a multi-supplier architecture, allowing operators to integrate with a wide range of game suppliers through a single SDK. Currently, the SDK supports two game suppliers - Turbostars and OneTouch Originals.

We're adding new suppliers gradually without any need for you to change your integration. This ensures long-term scalability and compatibility as more providers are onboarded.

Turbostars Integration

circle-check

Games with the prefix btsg_ are automatically recognised and handled by the supplier Turbostars.

  • Supported Games: CS:GO, Dota 2, LoL, and other esports titles Example: The game_code for Counter-Strike: Global Offensive would be displayed as game_code: "btsg_csgo"

  • Features: Live betting, pre-match odds, multiple bet types

OneTouch Originals Integration

circle-check

Games with the prefix orgn_ are automatically recognised and handled by the supplier OneTouch Originals.

  • Supported Games: dice, plinko, roulette, blackjack, baccarat, hilo. Example: game_code: "orgn_originalplinko"


Error Handling

Common Error Scenarios

Error Code
Message
Description
Recommended Action

INVALID_TOKEN

Token validation failed

The provided token is invalid, expired, or not recognised by Hub88.

Refresh or reissue the token and reattempt initialisation.

PROVIDER_NOT_FOUND

Game provider not supported

The SDK could not detect or match the game’s provider (e.g., unknown prefix).

Verify the game code and ensure the provider is supported by the SDK.

CONTAINER_NOT_FOUND

Game container missing

The specified DOM container for the game does not exist or cannot be found.

Ensure the container element (e.g. #game-container) is present in the DOM before initialisation.

CONFIG_VALIDATION_FAILED

Invalid configuration

One or more configuration parameters are missing or invalid in the SDK setup.

Check all required parameters (provider_token, provider_pid, launcher_base_url).

UNKNOWN_ERROR (default)

Initialisation failed (generic error)

A non-specific error occurred during SDK setup or communication.

Review logs for details and confirm SDK configuration and network connectivity.

Validation Requirements

The SDK validates these required parameters:

  • provider_token - Required, alphanumeric string 10–100 characters. Can't be empty or null.

  • provider_pid - Required, non-empty string.

  • launch_base_url - Required, must be a valid URL

Security Considerations

  1. Follow the best practices of Server-Side Authorisation. Always call /game/authorize from your backend, never expose operator credentials to the frontend.

  2. Do not expose operator credentials.

  3. Generate fresh tokens for each new session.


Last updated

Was this helpful?