Splash jackpot SDK is a library that contains two widgets:
The SDK provides a way to launch and interact with the widgets from your application.
The widgets are injected into the DOM automatically and rendered as a fixed-position iframe.
Install the Splash Jackpot SDK in your application using the following command
npm install @splash-tech/jackpot-sdk
The Jackpot Footer Widget displays current jackpot information to players.
To initialize the widget, your application must first fetch the widget data from your backend and then pass that data to the SDK launcher.
The Splash backend provides all necessary widget data. Your application should retrieve this data and pass it to the footer widget without modification.
import { splashJackpot } from '@splash-tech/jackpot-sdk';
// home.component.ts
initializeFooterWidget() {
this.jackpotService.fetchFooterWidgetData().subscribe({
next: (data) => splashJackpot.footer.launch({ data }),
error: (err) => splashJackpot.footer.launch({ data: null })
});
}
// jackpot.service.ts
fetchFooterWidgetData(): Observable<unknown> {
let params = new HttpParams();
// gameTag provided by your app
if (this.session.gameTag) {
params = params.set('tag', this.session.gameTag);
}
// brand provided by your app
if (this.session.brand) {
params = params.set('brand', this.session.brand);
}
return this.http
.get<unknown>(
`${environment.backendUrl}/api/jackpot/widget-details`,
{ params },
)
}