@power-gaming/promotion-widget
v0.2.3
Published
The **PowerGaming Promotion Widget** is a dynamic overlay solution that seamlessly displays promotional content within gaming environments. Designed for easy integration into third-party websites, the widget can be configured to render specifically within
Readme
PowerGaming Promotion Widget Integration
The PowerGaming Promotion Widget is a dynamic overlay solution that seamlessly displays promotional content within gaming environments. Designed for easy integration into third-party websites, the widget can be configured to render specifically within predefined containers, ensuring optimal placement and user experience. A real-time socket connection maintains up-to-date promotion information, allowing for instant updates without requiring page refreshes.
Installation
npm install @power-gaming/promotion-widgetUsage
1. Add a Root Container
In your HTML, create a container element where the widget will be mounted:
<div id="power-gaming-widget"></div>This element's ID will be used as the rootContainerId.
2. Inject the Widget
import { injectWidget } from '@power-gaming/promotion-widget';
injectWidget({
rootContainerId: 'power-gaming-widget',
containerId: 'game-frame',
casino: {
accessToken: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
lobbyUrl: "https://lobby.powergaming.be/promotion"
}
});3. Eject the Widget (optionally)
Ejecting the widget is not directly necessary because it's handled by the websocket.
import { ejectWidget } from '@power-gaming/promotion-widget';
// supply it with the rootContainerId
ejectWidget('power-gaming-widget');Options: PowerGamingWidgetOptions
| Option | Type | Required | Description |
|-------------------|----------|----------|--------------------------------------------------------------------------------------------------------------------------|
| rootContainerId | string | Yes | The ID of the container where the widget will be rendered |
| containerId | string | No | Optional container boundary. Defaults to document.body if not provided |
| casino | object | Yes | The casino object contains the accessToken and lobby to connect to the promotion lobby |
| accessToken | string | Yes | The generated accessToken that is coming from the integration-api-client in order to authenticate the third-party player |
| lobbyUrl | string | Yes | The access url to the promotion lobby returned by the integration-api-client |
Support
Need help reach out to the PowerGaming team or open an issue.
