This version (v0.7) has not been published to npm yet.
Skip to content

Reference / @getenginex/sdk-igaming/first-frame / FirstFrameHandlers

FirstFrameHandlers ​

Handlers for the iframe events. All optional; a handler that throws (or rejects) is ignored and does not prevent the others.

Methods ​

onBetPlaced()? ​

optional onBetPlaced(data): void

BET_WAS_PLACED: a bet was placed (a good moment to re-read the balance).

Parameters ​

data ​

unknown

Returns ​

void


onDepositClick()? ​

optional onDepositClick(data): void

depositClick: the player asked to deposit.

Parameters ​

data ​

unknown

Returns ​

void


onEvent()? ​

optional onEvent(eventType, eventData): void

Every accepted event, including those that also have a dedicated handler.

Parameters ​

eventType ​

string

eventData ​

unknown

Returns ​

void


onHeightChange()? ​

optional onHeightChange(height): void

on-page-height-change / ON_PAGE_HEIGHT_CHANGE: new content height (px, positive).

Parameters ​

height ​

number

Returns ​

void


onInsufficientFunds()? ​

optional onInsufficientFunds(data): void

INSUFFICIENT_FUNDS: insufficient balance for the bet.

Parameters ​

data ​

unknown

Returns ​

void


onLoginRequired()? ​

optional onLoginRequired(data): void

PLACE_BET_CLICKED_NOT_LOGGED_IN or OPEN_LOGIN_POPUP: the player needs to log in.

Parameters ​

data ​

unknown

Returns ​

void


onReady()? ​

optional onReady(): void

APP_READY: the sportsbook has loaded and accepts send.

Returns ​

void


onRedirect()? ​

optional onRedirect(data): void

BUTTON_REDIRECT: FIRST asks to open a link. data.link comes at the top of the message (or in eventData) and may be missing or not a valid URL. Validate before opening: accept only http(s), without credentials.

Parameters ​

data ​

FirstFrameRedirect

Returns ​

void


onScrollToTop()? ​

optional onScrollToTop(): void

SCROLL_TO_TOP: FIRST asks to scroll the page to the top.

Returns ​

void