Configuration overview

Below is the typescript type needed to initialise the SDK. The default requirements are

  • Event Id

  • OperatorId

  • isOperatorEnvProd

  • Environment

  • fetchToken

All other configuration options are optional for video streaming, but may be required for other features (Markets, Betting, MultiStream).

type IMGAStreamingSDKConfig = {
  // STREAM / TIMELINE / STATS
  eventId: string;
  operatorId: string;
  isOperatorEnvProd: boolean;
  environment: 'local' | 'dev' | 'staging' | 'prod' | 'test';
  fetchToken: () => Promise<{ token: string; timestamp: number; }>;  
  disableLocalstorage?: boolean; 
  languageCode?: string;
  domTarget?: HTMLElement;
  // MARKETS
  currencyPlaceholder?: string;
  formatCurrency?: (value: string) => string;
  oddsFormat?: 'decimal' | 'american' | 'fractional';
  onEventChanged?: (newEventId: number) => Promise<void>;
  onBetPlaced?: (args: PlaceBetArgs) => Promise<PlaceBetSuccess>;
  onFullscreenChanged?: (isFullscreen: boolean) => void;
  marketGroups?:        MarketGroup[];
  markets?:             Market[];  
  // MULTISTREAM
  multiStreamEvents?: MultiStream
  // OTHER
  availableFeatures?: {
    marketsEnabled?: boolean;
    betslipEnabled?: boolean;
    statsEnabled?: boolean;
    multistreamEnabled?: boolean;
    timelineEnabled?: boolean;
  };
  theme?: {
    colorPrimary: string;
    colorTeamsHome: string;
    colorTeamsAway: string;
  };
  onVolumeChanged?: (value: string) => void;
}

STREAM INTEGRATION

eventId: See the Events API documentation for full details on how to get available events

operatorId: Use the operator ID provided to you by our integrations team

isOperatorEnvProd: To prevent the SDK from collecting analytics on your local, dev, or staging environments. Please pass isOperatorEnvProd: true only when the SDK is being used for true production traffic.

environment: To give us more granularity about when to collect analytics or error logs. Please pass local for your local dev environment , pass dev if you have a regularly changing environment where errors may be expected or pass test if you have any automated test environments which will be using the SDK. For local and dev we will not collect analytics or error logs. For staging and prod we will collect this data.

fetchToken: See Generating a token for more details

disableLocalStorage: The SDK will use localStorage to store some user preferences and analytics information. Pass disableLocalStorage: true to disable this

domTarget: If you aren't using React, this should be the HTML element inside which the product will be rendered

languageCode: A language tag as defined here

MARKETS INTEGRATION

currencyPlaceholder: This is displayed in the betslip as a placeholder before the user has entered a stake value

formatCurrency: A function used to display a currency value in the same format used on your site

oddsFormat: The format of the odds to be displayed

onEventChanged: An optional function which will be called when the user switches to another event from the MultiStream menu, essential for synchronising markets with the displayed stream

onBetPlaced: See Placing a bet for more details

markets: a list of Markets, see Markets

marketGroups: a list of Market Groups to display Markets under

MULTISTREAM INTEGRATION

multiStreamEvents: a Rose Tree of categorised available streams, see MultiStream

OTHER

availableFeatures: Use this to disable certain features of the product, all are enabled by default

theme: To customise the colours displayed to match your brand, see Customising themes

onFullscreenChanged: This is called when the app goes in or out of fullscreen mode

onVolumeChanged: This is called with the new volume level when the volume is changed.

Last updated