Using OneTouch Originals in the SDK

Operator Games API SDK

This guide walks you through the Operator Games API SDK integration with OneTouch Originals offering.

For a high-level overview, check out the full guide on the SDK. In the main guide you'll be able to learn about the full integration flow, authorisation flow, error handling and migration from iframe to the SDK.

To integrate the SDK only with OneTouch Originals, complete the following steps.

1

Get your tokens by calling the Authorise API endpoint

Follow along the first step of the Operator Games API SDK integration guide to ensure you have your provider_token, provider_pid and launcher_base_url. This step is not needed if you have already authorised the SDK.

2

Initialise the SDK with OneTouch Originals games

Initialise the SDK using your provider_token, provider_pid and launch_base_url you received from the Authorisation's response. In this example, we also specify the game_code to be 'orgn_originalplinko' . Using this, the OneTouch Originals game Plinko will be played.

Initialisation
const hub88Instance = await Hub88Games.init({
  provider_token: 'your_token',
  provider_pid: 'your_pid',
  launcher_base_url: 'https://launcher.server1.ih.testenv.io',
  game_code: 'orgn_originalplinko'
})
3

Initialise the SDK using advanced parameters

During initialisation, you can add custom values for optional parameters in order to change the game display ways. Just select the parameter which value you wish to override, and add to the meta object in the initialisation code snippet, and the SDK will override the values. See the table for available parameters.

Initialisation using advanced parameters in meta object
const hub88Instance = await Hub88Games.init({
  provider_token: 'your_token',
  provider_pid: 'your_pid',
  launcher_base_url: 'https://launcher.server1.ih.testenv.io',
  game_code: 'orgn_originalplinko',

  lang: 'en',           // Can be overridden by meta.lang
  meta: { // Highest priority
    theme: 'dark',      
    turboMode: true,
    mute: false, 
    depositUrl: 'https://example.com/deposit',
  }
})
4

Add event listening for native window events

To further improve the experience, you can implement event listening for game round start and game round ending. This allows you to, for example, know when to display a custom win/lose animation.

Events support

/**
 * Dispatched when a game play/round starts (e.g., bet is placed, balance is locked)
 */
export interface GamePlayStartedEvent extends Hub88GameEvent {
  name: 'game-play-started'
  kind: 'win' | 'loss' | 'bet' | 'unknown'
  balance: number
  currency?: string
}

/**
 * Dispatched when a game play/round ends (e.g., win/loss calculated, balance is unlocked)
 */
export interface GamePlayEndedEvent extends Hub88GameEvent {
  name: 'game-play-ended'
  kind: 'win' | 'loss' | 'bet' | 'unknown'
  balance: number
  currency?: string
  winAmount?: number
}

You can also listen directly to the window custom event:

window.addEventListener('hub88-games-sdk', (e) => {
  const event = e.detail.event
  console.log('Hub88 Event:', event)
})


Optional parameters for meta object

Parameter name
Type
Description

gameType

string

  • The identifier for the game to be loaded.

  • Possible values:

    • "dice"

    • "plinko"

    • "roulette"

    • "blackjack"

    • "baccarat"

    • "hilo"

sessionId

string

The unique session token for player authorization.

engineBaseUrl

string

The base URL of the game server (backend).

lobbyUrl

string

The URL where the player will be redirected when exiting the game.

depositUrl

string

The URL of the deposit page. A good practice would be to have the game display a button leading to this address if the player has insufficient funds.

subPartnerId

string

The sub-partner identifier for possible presets.

lang

string

The language code for game localisation (e.g., "en", "ja").

theme

string

The visual theme for the game interface. Possible values: "light" | "dark"

fiatCurrency

string

The fiat currency code.

fiatRate

string

The currency rate for converting fiat currencies.

walletCurrency

string

The wallet currency value.

skin

string

The skin (background) of the game displayed. Default value is "bitcasino", "yolo" can be used for yolo.com.

mute

boolean

Controls the game sound to be on or off.

Last updated

Was this helpful?