Overview

Splash jackpot SDK is a library that contains two widgets:

  1. footer widget - displays jackpot data
  2. win widget - shows on a jackpot win

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.

Installation

Install the Splash Jackpot SDK in your application using the following command npm install @splash-tech/jackpot-sdk

Usage

Footer widget

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.

Data Flow

  1. Your frontend requests widget data from your backend.
  2. Your backend calls the Splash endpoint.
  3. Splash endpoint returns the footer widget configuration and jackpot data.
  4. Your frontend passes the received data to the SDK to launch the footer widget.

Integration Example (Angular)

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 },
    )
}

Win widget