Betting events
The SPA provides an API that allows users to subscribe to various user-related events, such as login, logout, among others. Once subscribed to an event, they can implement custom logic to handle it as needed.
betting-init
Description: This event is dispatched by application once it is fully initialized on the client side.
This event acts as a signal that the global window.bettingAPI
object is now available and ready to be used.
Important
Unlike other application events, betting-event
is global DOM event emitted via document.dispatchEvent(...)
Example:
1 2 3 4 5 6 |
|
redirect
Description: Trigger at the moment of performing the actions specified in the Destination; it must be possible to set the transition via external routes.
1 2 3 4 5 6 7 8 9 |
|
Example: This event is typically used to trigger the opening of a login modal when an unauthorized user attempts to place a bet
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
|
handle-not-enough-balance
Description: Trigger when a player does not have enough funds to make a bet. The integrator can handle the case where the user needs to deposit more funds.
1 2 3 |
|
Example: This event is typically used to trigger the opening of a deposit modal
1 2 3 |
|
toggle-widget-betslip
Description: Trigger when a player opens or close the betslip widget
1 2 3 4 5 |
|
Example: The integrator can use this event to handle UI changes, such as enabling/disabling scrolling on mobile devices.
custom-widget-init
Description: Triggered when the custom widget container is mounted and ready to receive content. This event indicates that the container is ready for rendering custom React components using createPortal
.
1 2 3 4 |
|
Properties:
containerId
: Unique identifier for the containerelement
: The DOM element where custom content should be rendered
Example:
Use this event to render custom content into specific widget containers once they become available.
1 2 3 4 5 6 7 8 9 |
|