events

Playtech.API. events

Events

# auth:generic_login:error

The event fires when the user fails to login (any login method).
Type:
  • callback
Example
Playtech.on('auth:generic_login:error', (error) => { ... });

# auth:generic_login:success

Event fires when user successfully login on the portal (any login method).
Type:
  • callback
Example
Playtech.on('auth:generic_login:success', () => { ... });

# cookie-message-closed

Event fires when Cookies Regulatory Message is being closed.
Type:
  • callback
Example
Playtech.on('cookie-message-closed', () => { ... });

# cookie-settings-updated

Event fires when Cookies Settings component values is changed.
Type:
  • callback
Parameters:
Name Type Description
details Object
Properties
Name Type Description
name string Name of the cookie type.
value string Value.
Example
Playtech.on('cookie-settings-updated', ({ name, value }) => { ... });

# DEPOSIT_COMPLETED

The event fires when the deposit has been successfully completed.
Type:
  • callback
Parameters:
Name Type Description
details Array.<Object> { amount: 1, code: '40564463', method: 'Retail Deposit', status: 'waiting' }
Properties
Name Type Description
amount number
code string
method string
status string
Example
Playtech.on('DEPOSIT_COMPLETED', ([{ amount, code, method, status }]) => { ... });

# DEPOSIT_FAIL

The event is fired when the deposit was not completed successfully.
Type:
  • callback
Parameters:
Name Type Description
details Array.<Object>
Properties
Name Type Description
correlationId string
error Object
errorCode number
errorDescription string
errorMessage string
Example
Playtech.on('DEPOSIT_FAIL', ([{ correlationId, error, errorCode, errorDescription, errorMessage }]) => { ... });

# dynamic-custom-form-submit

Event fires dynamic custom form submitted.
Type:
  • callback
Parameters:
Name Type Description
details Object
Properties
Name Type Description
formValues Object contains form field values (fieldName: fieldValue)
formIMSValues Object contains form field values (fieldIMSName: fieldValue)
formName string contains form name that was picked in component settings
resolve function {function} function that should be called in case of success. Accepts text or a translation key to be shown as notification message
reject function {function} function that should be called in case of error. Accepts text or a translation key to be shown as form error
Example
Playtech.on('dynamic-custom-form-submit', ({ formValues, formIMSValues, formName, resolve, reject }) => {
    const { userName } = formValues;

    if (formName !== 'my-custom-form') {
        return;
    }

    if (userName === 'HanSolo'){
       console.log(userName)
       resolve('Login is successful!')
    } else {
       reject('This form could be submitted only by Han Solo')
    }
});

# FORGOT_PASSWORD_FAIL

Event fires when Forgot Password request is failed.
Type:
  • callback
Example
Playtech.on('FORGOT_PASSWORD_FAIL', () => { ... });

# FORGOT_PASSWORD_SUCCESS

Event fires when Forgot Password request is successful.
Type:
  • callback
Example
Playtech.on('FORGOT_PASSWORD_SUCCESS', () => { ... });

# FORGOT_USERNAME_FAIL

Event fires when Forgot Username request is failed.
Type:
  • callback
Example
Playtech.on('FORGOT_USERNAME_FAIL', () => { ... });

# FORGOT_USERNAME_SUCCESS

Event fires when Forgot Username request is successful.
Type:
  • callback
Example
Playtech.on('FORGOT_USERNAME_SUCCESS', () => { ... });

# GAME_FAVORITES_HANDLER

The event is fired when a game is added/removed from the favorites.
Type:
  • callback
Parameters:
Name Type Description
details Array.<Object>
Properties
Name Type Description
gameCode string
method string
gameFeed number
container number
Example
Playtech.on('GAME_FAVORITES_HANDLER', ([{ gameFeed, method, gameCode, container }]) => { ... });

# GAME_LAUNCH

Type:
  • callback
Parameters:
Name Type Attributes Description
details Array.<Object>
details[0].gameCode string
details[0].container string
details[0].gameName string
details[0].launchType string Values: 'Real' | 'Demo'
details[0].gameFeed string <optional>
details[0].gameName string <optional>
Example
Playtech.on('GAME_LAUNCH', ({ gameCode, container, gameName, launchType }) => { ... });

# ip-change

Event fires when IMS sends push notification that player's IP has changed. Subscription type 'ip-change' must be configured to receive this notifications. More specifically 'ip-change' event means push (code 31133) with actionIpChangedInfo in pushMessage.data.action.
Type:
  • callback
Example
Playtech.on('ip-change', () => { ... });

# LANGUAGE_CHANGED

Event fires when user change language.
Type:
  • callback
Parameters:
Name Type Description
details Array.<string> details[0] is language.
Example
Playtech.on('LANGUAGE_CHANGED', (lang) => { ... });

# leaderboard-message

Event used for Leaderboard integration Subscription type 'leaderboard-message' must be configured to receive this notifications.
Type:
  • callback
Example
Playtech.on('leaderboard-message', () => { ... });

# LOGGED_IN

Event fires when user successfully login with credentials on the portal. Event does not trigger after portal reload.
Type:
  • callback
Example
Playtech.on('LOGGED_IN', () => { ... });

# LOGGED_IN_FAIL

The event fires when the user fails to login with credentials on the portal.
Type:
  • callback
Parameters:
Name Type Description
error Array.<string> Login error.
Example
Playtech.on('LOGGED_IN_FAIL', ([error]) => { ... });

# LOGGED_OUT

The event fires when the user logout on the portal.
Type:
  • callback
Example
Playtech.on('LOGGED_OUT', () => { ... });

# navigate

Event fires when player navigates to another page.
Type:
  • callback
Parameters:
Name Type Description
details Object
Properties
Name Type Description
pathname string Path of a page.
cleanPathname string Path of a page without language code.
prevPathname string Path of a previous page.
cleanPrevPathname string Path of a previous page without language code.
Example
Playtech.on('navigate', ({ pathname, cleanPathname, prevPathname, cleanPrevPathname }) => { ... });

# player-tag-change

Event fires when IMS sends push notification that player's tag has changed or was removed. Subscription for tag changes must be configured in CMS to receive this notifications.
Type:
  • callback
Parameters:
Name Type Description
details Object
Properties
Name Type Description
tag string Name of the tag changed.
value string New value of the tag; not available for simple tags.
removed boolean If tag was removed from player.
Example
Playtech.on('player-tag-change', ({ tag, value, removed }) => { ... });

# reality-check-popup-closed

Event fires when IMS sends reality check popup is closed.
Type:
  • callback
Parameters:
Name Type Description
status string Whether popup was accepted or declined.
Example
Playtech.on('reality-check-popup-closed', (status) => { ... });

# reality-check-popup-shown

Event fires when IMS sends reality check popup is shown.
Type:
  • callback
Example
Playtech.on('reality-check-popup-shown', () => { ... });

# REGISTRATION_COMPLETED

Event fires on successful registration.
Type:
  • callback
Parameters:
Name Type Description
details Array.<Object>
Properties
Name Type Description
username string
userId string
playerCode number
Example
Playtech.on('REGISTRATION_COMPLETED', ([{ username, userId, playerCode }]) => { ... });

# REGISTRATION_FAIL

The event fires when an error occurs during registration.
Type:
  • callback
Parameters:
Name Type Description
details Array.<Object>
Properties
Name Type Description
content string
Example
Playtech.on('REGISTRATION_FAIL', ([{ content }]) => { ... });

# REGISTRATION_STEP_CHANGED

The event fires when the registration step changes.
Type:
  • callback
Parameters:
Name Type Description
details Array.<(string|number)>
Properties
Name Type Description
nextStep string | number
currentStep string | number
Example
Playtech.on('REGISTRATION_STEP_CHANGED', ([nextStep, currentStep]) => { ... });

# REGISTRATION_SUBMITTED

The event is fired when registration form is submitted.
Type:
  • callback
Example
Playtech.on('REGISTRATION_SUBMITTED', () => { ... });

# RESPONSIVE_GAME_PORTLET_CATEGORY_EXPAND

The event is fired when games category is expanded.
Type:
  • callback
Parameters:
Name Type Description
details Array.<Object>
Properties
Name Type Description
container string
gameFeed string
categoryName string
Example
Playtech.on('RESPONSIVE_GAME_PORTLET_CATEGORY_EXPAND', ([{ container, gameFeed, categoryName }]) => { ... });

# RESPONSIVE_GAME_PORTLET_CATEGORY_SCROLL

The event is fired when active slide was changed.
Type:
  • callback
Parameters:
Name Type Description
details Array.<Object>
Properties
Name Type Description
container string
gameFeed string
categoryName string
elementClicked string
Example
Playtech.on('RESPONSIVE_GAME_PORTLET_CATEGORY_SCROLL', ([{ container, gameFeed, categoryName, elementClicked }]) => { ... });

# RESPONSIVE_GAME_PORTLET_CATEGORY_SWITCH

The event is fired when game portlet category was switched.
Type:
  • callback
Parameters:
Name Type Description
details Array.<Object>
Properties
Name Type Description
container string
gameFeed string
categoryName string
Example
Playtech.on('RESPONSIVE_GAME_PORTLET_CATEGORY_SWITCH', ([{ container, gameFeed, categoryName }]) => { ... });

# RESPONSIVE_GAME_PORTLET_DISPLAY

The event is fired when games portlet is mounted.
Type:
  • callback
Parameters:
Name Type Description
details Array.<Object>
Properties
Name Type Description
container string
gameFeed string
Example
Playtech.on('RESPONSIVE_GAME_PORTLET_DISPLAY', ([{ container, gameFeed }]) => { ... });

# RESPONSIVE_GAME_PORTLET_PERSONALIZED_GRID_2

The event is fired when personalized game grid category is configured.
Type:
  • callback
Parameters:
Name Type Description
details Array.<Object>
Properties
Name Type Description
container string
gameFeed string
personalizedCategoryName string
personalizedGridFallback number
pagePath string
Example
Playtech.on('RESPONSIVE_GAME_PORTLET_PERSONALIZED_GRID_2', ([{ container, gameFeed, personalizedCategoryName, personalizedGridFallback, pagePath }]) => { ... });
The event is fired when search field input is changed.
Type:
  • callback
Parameters:
Name Type Description
details Array.<Object>
Properties
Name Type Description
gameFeed string
searchstring string
container number
Example
Playtech.on('RESPONSIVE_GAME_PORTLET_SEARCH', ([{ gameFeed, searchString, container }]) => { ... });

# SAFECHARGE_ALTERNATIVE_VERIFICATION

The event is fired after alternative verification action is received with payload as an argument.
Type:
  • callback
Parameters:
Name Type Description
details Object
Example
Playtech.on('SAFECHARGE_ALTERNATIVE_VERIFICATION', (data) => { ... });

# SAFECHARGE_ANALYTICS

The event is fired after action "analytics" is received with payload as an argument.
Type:
  • callback
Parameters:
Name Type Description
details Object
Example
Playtech.on('SAFECHARGE_ANALYTICS', (data) => { ... });

# SAFECHARGE_CONTACT_SUPPORT

The event is fired after contact support action is received with payload as an argument.
Type:
  • callback
Parameters:
Name Type Description
details Object
Example
Playtech.on('SAFECHARGE_CONTACT_SUPPORT', (data) => { ... });

# SAFECHARGE_PM_REGISTRATION_FAIL

The event is fired after payment method registration failed action is received with payload as an argument.
Type:
  • callback
Parameters:
Name Type Description
details Object
Example
Playtech.on('SAFECHARGE_PM_REGISTRATION_FAIL', (data) => { ... });

# SAFECHARGE_PM_REGISTRATION_SUCCESS

The event is fired after payment method successful registration action is received with payload as an argument.
Type:
  • callback
Parameters:
Name Type Description
details Object
Example
Playtech.on('SAFECHARGE_PM_REGISTRATION_SUCCESS', (data) => { ... });

# SAFECHARGE_WITHDRAWAL_FAIL

The event is fired after withdraw failed action is received with payload as an argument.
Type:
  • callback
Parameters:
Name Type Description
details Object
Example
Playtech.on('SAFECHARGE_WITHDRAWAL_FAIL', (data) => { ... });

# SAFECHARGE_WITHDRAWAL_SUCCESS

The event is fired after successful withdraw action is received with payload as an argument.
Type:
  • callback
Parameters:
Name Type Description
details Object
Example
Playtech.on('SAFECHARGE_WITHDRAWAL_SUCCESS', (data) => { ... });

# self-exclusion-success

The event is fired when the request Self Exclusion is successful.
Example
Playtech.on('self-exclusion-success', () => { ... });

# sharedPagesEvents

Type:
  • callback
Examples
Playtech.on('player-changes-tab', (details) => { ... });
Playtech.on('player-clicks-join-mp', (details) => { ... });
Playtech.on('player-clicks-join-lb', (details) => { ... });
Playtech.on('player-clicks-close', (details) => { ... });
Playtech.on('player-changes-game', (details) => { ... });
Playtech.on('player-clicks-leave-mp', (details) => { ... });
Playtech.on('player-clicks-leave-lb', (details) => { ... });
Playtech.on('player-scrolls-down', (details) => { ... });
Playtech.on('promotion-opened', (details) => { ... });
Playtech.on('section-expanded', (details) => { ... });
Playtech.on('section-collapsed', (details) => { ... });
Playtech.on('section-expanded', (details) => { ... });
Playtech.on('player-clicks-backbutton', (details) => { ... });

# sportsbook-analytics

Event fires when user balance is updated.
Type:
  • callback
Parameters:
Name Type Description
details Object
Properties
Name Type Description
eventName string Name of the event.
userName string Current player's userName.
currency string Player's currency.
raw Object | string {Object|string} Other metadata.
Example
Playtech.on('sportsbook-analytics', (data) => { ... });

# TWO_FA_POPUP_CLOSED

Event fires when two-factor authentication popup was closed.
Type:
  • callback
Parameters:
Name Type Description
details Array.<string> details[0] is component
Example
Playtech.on('TWO_FA_POPUP_CLOSED', ([Component]) => { ... });

# TWO_FA_POPUP_OPENED

Event fires when two-factor authentication popup was opened.
Type:
  • callback
Parameters:
Name Type Description
details Array.<string> details[0] is component.
Example
Playtech.on('TWO_FA_POPUP_OPENED', ([Component]) => { ... });

# WEB_CONTENT_RENDERED

The event is fired when the web content was rendered.
Type:
  • callback
Parameters:
Name Type Description
details Array.<Object>
Properties
Name Type Description
wc string
Example
Playtech.on('WEB_CONTENT_RENDERED', ([wc]) => { ... });

# WITHDRAWAL_COMPLETED

The event fires when the withdrawal has been successfully completed.
Type:
  • callback
Parameters:
Name Type Description
details Array.<Object>
Properties
Name Type Description
amount string
method string
status string
transactionCode string
Example
Playtech.on('WITHDRAWAL_COMPLETED', ([{ amount, method, status, transactionCode }]) => { ... });

# WITHDRAWAL_FAIL

The event is fired when the withdraw was not completed successfully.
Type:
  • callback
Parameters:
Name Type Description
details Array.<Object>
Properties
Name Type Description
correlationId string
error Object
errorCode number
errorDescription string
errorMessage string
Example
Playtech.on('WITHDRAWAL_FAIL', ([{ correlationId, error, errorCode, errorDescription, errorMessage }]) => { ... });

# header:backButton:toggle

Event fires when some component fires 'backButton:show'.
Type:
  • callback
Example
Playtech.on('header:backButton:toggle', () => { ... });

# user:balanceUpdated

Event fires when user balance is updated.
Example
Playtech.on('user:balanceUpdated', () => { ... });

# user:lowBalanceCheck

Event fires when User toggles balance visibility.
Type:
  • callback
Parameters:
Name Type Description
details Array.<Object>
Properties
Name Type Description
lowBalanceHighlight boolean
showLowBalancePopup boolean
Example
Playtech.on('user:lowBalanceCheck', ([{ lowBalanceHighlight, showLowBalancePopup }]) => { ... });

# user:toggleBalance

Event fires when User toggles balance visibility.
Type:
  • callback
Parameters:
Name Type Description
details Array.<boolean> details[0] is isShown
Example
Playtech.on('user:toggleBalance', ([isShown]) => { ... });