Skip to Content

All Events

Every postMessage exchanged between the Sportsbook iFrame and your page, in one place. This page is the index: it gives the exact payload shape of each event and points to the page that shows how to handle it.

Direction is written from your page’s point of view:

  • iFrame → your page — the iFrame sends it. You subscribe with integration.on().
  • your page → iFrame — you send it, with integration.emit() or a helper.

You work with all of these through the integration module.

Message envelope

Messages you send are always wrapped in a value object:

{ type: "<event-type>", value: { /* payload */ } }

emit(data, type) builds this wrapper for you, so emit({ mode: 'dark' }, 'theme-mode-change') produces { type: 'theme-mode-change', value: { mode: 'dark' } }.

Important

Messages you receive are not all wrapped the same way. Most arrive with a value object, some arrive flat with the payload directly on the message, and user.multiCurrencyBalance uses data. The Payload column below shows the exact shape for each event — read it before destructuring in an on() callback.

This matters because a handler that reads the wrong level does not throw. It receives undefined and does nothing, which looks identical to the message never arriving.

Warning

The module’s message listener does not verify the sender’s origin, and it posts outgoing messages with a target origin of '*'. Both are worth tightening in your copy of the file — see Customising it.

iFrame → your page

Messages the iFrame sends to you. Subscribe to these.

EventPayloadFires whenHandled on
login.click—Player clicks Login, or attempts an action requiring auth while anonymousSession & Auth
register.click—Player clicks Register, or attempts an action requiring an accountSession & Auth
auth.fail—The JWT was rejected inside the iFrame, although the player is authorized on your platformSession & Auth
user.balance—Player’s balance changed inside the iFrame — a bet placed, a cashoutBalance & Currency
user.balance_transfer{ type, value: { type, amount } }Player clicks Deposit or Withdrawal inside the iFrame (transfer wallet)Transfer wallet (requires sign-in)
user.multiCurrencyBalance{ type, data: { multiCurrencyBalance, selectedCurrency } }A multi-currency player’s balances or selected currency changedBalance & Currency
deposit.click—Player clicks Deposit in the BetslipBalance & Currency
navigation{ type, path, query } — flatThe route changed inside the iFrameNavigation & Routing
openLink{ type, url, target } — flatA banner or link inside the iFrame needs the parent page to navigateNavigation & Routing
sdkInit{ type, value: { defaultThemeMode } }The iFrame finished initializing. Your cue to send client-urlTheme Mode, Embedding

Your page → iFrame

Messages you send to the iFrame.

EventPayloadSend whenHandled on
iframe{ logout: true } and other command flagsThe player’s session ended, and other commandsSession & Auth, plus the envelope below
iframe-navigation{ path }On initial page load, and whenever you drive iFrame navigation yourselfNavigation & Routing
client-url{ href, basePath? }In response to sdkInitEmbedding
theme-mode-change{ mode: 'light' | 'dark' }Your site’s theme changesTheme Mode
currency-update{ currency }The player switches currency on your siteBalance & Currency
get-user-balance— (send {})The balance changed outside the iFrame, for example after a depositBalance & Currency

The iframe command envelope

iframe is the module’s default message type. Sending a payload without an explicit type puts it in this envelope, where each key is a separate command:

KeyValueMeaning
logouttrueThe player’s session ended on your platform
balanceTransferSuccesstrue / falseThe result of a transfer you performed after user.balance_transfer — see Transfer wallet (requires sign-in)
balance, currencyvaluePush the current balance and currency (transfer wallet)
Example:
import integration from "services/integration"; integration.helpers.logout(); // → { type: 'iframe', value: { logout: true } } // No type argument, so the message lands in the `iframe` envelope integration.emit({ balanceTransferSuccess: true }); integration.emit({ balance: user.balance, currency: user.currency });

Naming conventions

Two styles are in use, and the direction tells you which:

DirectionStyleExamples
iFrame → page<area>.<action>login.click, register.click, auth.fail
iFrame → pageuser.<thing>user.balance, user.multiCurrencyBalance
page → iFramekebab-casetheme-mode-change, currency-update, get-user-balance

openLink, sdkInit and scrollParent predate this convention. They keep their camelCase names for backwards compatibility.