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', () => { ... });

# advanced-dialog

Event fires when Engagement Message arrives with a Pre-styled configuration.
Type:
  • callback
Parameters:
Name Type Description
detials object
details.actionId string ID of action in IMS.
details.actionInfo object Object that describes the dialog.
details.windowSessionId object Window Session ID.
Example
Playtech.on('advanced-dialog-nongame', ({
    actionId,
    actionInfo: {
        buttons,
        message
    },
    windowSessionId
}) => {
    const { buttons: popupButtons, onClose } = Playtech.API.popup.getButtons({ buttons, actionId, windowSessionId });

    Playtech.API.popup.showPopup('common', {
        buttons: popupButtons,
        content: message,
        onClose
    });
});

# advanced-dialog-nongame

Event fires when Engagement Message arrives with a Pre-styled configuration.
Type:
  • callback
Parameters:
Name Type Description
detials object
details.actionId string ID of action in IMS.
details.actionInfo object Object that describes the dialog.
details.windowSessionId object Window Session ID.
Example
Playtech.on('advanced-dialog-nongame', ({
    actionId,
    actionInfo: {
        buttons,
        message
    },
    windowSessionId
}) => {
    const { buttons: popupButtons, onClose } = Playtech.API.popup.getButtons({ buttons, actionId, windowSessionId });

    Playtech.API.popup.showPopup('common', {
        buttons: popupButtons,
        content: message,
        onClose
    });
});

# 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-limit-change

Event fires when deposit limit were changed.
Type:
  • callback
Parameters:
Name Type Description
details Array.<Object>
Properties
Name Type Description
currentLimits Array.<object>
waitingLimits Array.<object>
allowedLimits Array.<string>
limits Array.<object>
lastIncreaseOverDefaultDate string
Example
Playtech.on('deposit-limit-change', ({ currentLimits, waitingLimits, allowedLimits, limits }) => { ... });

# 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')
    }
});

# dynamic-form-step-changed

Event fires when Form step is changed.
Type:
  • callback
Parameters:
Name Type Description
details Object
Properties
Name Type Description
formName string Name of the form.
formStep number Form step user navigates to.
totalSteps number Total count of form steps.
Example
Playtech.on('dynamic-form-step-changed', ({ formName, formStep, totalSteps }) => { ... });

# dynamic-form-submitted

Event fires when any dynamic form successfully submitted.
Type:
  • callback
Parameters:
Name Type Description
details Object
Properties
Name Type Description
formName string contains form name that was picked in component settings
Example
Playtech.on('dynamic-form-submitted', ({ formName }) => {
   if (formName === '2fa') {
      // do something
  }
});

# FORGOT_EMAIL_FAIL

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

# FORGOT_EMAIL_SUCCESS

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

# 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

Event fires when game was launched.
Type:
  • callback
Parameters:
Name Type Attributes Description
details Array.<Object>
details[0].casinoName string IMS brand name (IMS casinoName). Corresponding BI parameter: "brand".
details[0].categoryName string <optional>
Title of the category. Corresponding BI parameter: "cat_name".
details[0].categoryPosition number <optional>
Position of the category (if present) on page (from top to the bottom). Corresponding BI parameter: "cat_pos".
details[0].container string Name of a place/component the game was launched from (Games grid, Banner, Leaderboard etc.). Corresponding BI parameter: "launch_ctx".
details[0].gameCode string Launch game code. Corresponding BI parameter: "launch_code".
details[0].gameFeed string <optional>
Feed name. Corresponding BI parameter: "feed_name".
details[0].gameName string Game name
details[0].gamePositionInCategory number <optional>
Position of the game in the category (if present). Corresponding BI parameter: "game_pos".
details[0].launchType string Game launch type (Real/Demo)
details[0].pggCategoryName string <optional>
PGG category name. Corresponding BI parameter: "pgg_cat_name".
details[0].platform string Platform (desktop/tablet/mobile). Corresponding BI parameter: "cplat".
details[0].tidPgg string <optional>
"tid" value from API PGG response (if present). Corresponding BI parameter: "tid".
details[0].userId string <optional>
IMS player userId (for logged-in users). Corresponding BI parameter: "user_id".
Example
Playtech.on('GAME_LAUNCH', ({ gameCode, container, gameName, game_pos }) => { ... });

# geofencing-error

Event fires when there is any error from within the Geofencing process.
Type:
  • callback
Parameters:
Name Type Description
detials object
details.error number Generic error object, if available.
details.errorCode number Error code as reported by the geolocation provider.
details.message number Error message as reported by the geolocation provider.
details.response number Response object as reported by PAS.
Example
Playtech.on('geofencing-error', ({ error, errorCode, message, response }) => { ... });

# geofencing-init

Event fires when geofencing process is being initialized.
Type:
  • callback
Parameters:
Name Type Description
detials object
details.geolocationType number Provider used.
Example
Playtech.on('geofencing-init', ({ geolocationType }) => { ... });

# geofencing-response

Event fires when there is a response with geopacket from within the Geofencing process.
Type:
  • callback
Parameters:
Name Type Description
detials object
details.time number time in milliseconds of how long it took to complete the trigger.
details.transactionID number transaction ID as defined by IMS.
Example
Playtech.on('geofencing-response', ({ time, transactionID }) => { ... });

# geofencing-trigger

Event fires when there is any trigger from within the Geofencing process.
Type:
  • callback
Parameters:
Name Type Description
detials object
details.reason number reason for the trigger for geolocatoin.
Example
Playtech.on('geofencing-trigger', ({ reason }) => { ... });

# 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 }) => { ... });

# pas-error

Event fires when request with PAS was rejected with error.
Type:
  • callback
Parameters:
Name Type Description
detials object
details.actionName number name of the action that was requested.
details.error number error object received from PAS (or fake one in case of timeout).
details.time number Time it took to make the request is ms.
Example
Playtech.on('pas-error', ({ actionName, error, time }) => { ... });

# pas-response

Event fires when request with PAS was completed.
Type:
  • callback
Parameters:
Name Type Description
detials object
details.actionName number name of the action that was requested.
details.time number Time it took to make the request is ms.
Example
Playtech.on('pas-response', ({ actionName, time }) => { ... });

# 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', () => { ... });

# recaptcha-error

Event fires when recaptcha failed to be shown or there is an issue with expiration.
Type:
  • callback
Parameters:
Name Type Description
detials object
details.errorCode number ID of error.
details.errorMessage number error message, if any.
Example
Playtech.on('recaptcha-error', ({ errorCode, errorMessage }) => { ... });

# 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) => { ... });

# socket-breakdown

Event fires when request with socket was not possible to send / receive.
Type:
  • callback
Parameters:
Name Type Description
detials object
details.reason number Main reason for error.
details.requestId number Request ID.
Example
Playtech.on('socket-breakdown', ({ reason, requestId }) => { ... });

# socket-error

Event fires when request with socket was failed due to any error response.
Type:
  • callback
Parameters:
Name Type Description
detials object
details.requestId number Request ID.
details.responseId number Response ID.
details.errorCode number Error code as received from socket if any.
details.error number Error code as received from socket if any.
details.time number Time it took to make the request is ms.
Example
Playtech.on('socket-error', ({ requestId, responseId, errorCode, error, time }) => { ... });

# socket-notice

Event fires when request with socket was not received within first 15 seconds.
Type:
  • callback
Parameters:
Name Type Description
detials object
details.requestId number Request ID.
Example
Playtech.on('socket-notice', ({ requestId }) => { ... });

# socket-response

Event fires when request with socket was completed.
Type:
  • callback
Parameters:
Name Type Description
detials object
details.requestId number Request ID.
details.responseId number Response ID.
details.time number Time it took to make the request is ms.
Example
Playtech.on('socket-response', ({ requestId, responseId, time }) => { ... });

# 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]) => { ... });