Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
To get going to with the Interactive Streaming product integration, follow the below:
Install the package using your preferred package manager:
Import the React component if you are using React:
To render the Streaming SDK you must pass these required props:
Import the SDK class if you aren't using React:
To render the product, you must pass these required props:
To get an eventId
use the Events API.
To learn more about authentication flow and fetching the token, read about the Authentication Flow.
This configuration should get you Video for any event, and Timeline and Statistics for supported events.
See Configuration options for full details of all configuration options available.
Users can switch between multiple events by using the MultiStream menu.
For MultiStream support you have to pass a MultiStream object to the multiStreamEvents prop.
Categories are labeled groups of Categories and Streams.
You can fetch events using the Events API, collect them into categories and pass to the Interactive Streaming SDK.
Here is an example function: after fetching the events from the API it gets the events and categorises them by sport. You can create multiple levels of categories, each level can contain both streams and subcategories inside a category.
The Events API exposes eventIds as numbers, while Interactive Streaming SDK is typed to accept strings.
How to get the streaming token.
The fetchToken
callback passed to the SDK must return a Promise which resolves to an object containing a token
and a timestamp
.
Please refer to the IMGA Streaming Authentication Flow documentation for full details on how to generate these.
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).
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
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
multiStreamEvents: a Rose Tree of categorised available streams, see MultiStream
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.
The SDK displays markets in groups, e.g. markets related to "Goals" or markets related to "Corners".
The operator must pass an array of MarketGroup
s and an array of Market
s to enable this functionality.
If you are using the React component, pass marketGroups
and markets
as props and update the markets by changing the props.
On an instance of the SDK, call updateMarkets
and updateMarketGroups
Markets can be updated at any time and can be suspended by including suspended: true
or by passing an array of market IDs to suspendMarkets
.
Markets can be removed at any time by passing an array of market IDs to removeMarkets
.
You can configure the odds format you are using by passing 'decimal'
, 'american'
or 'fractional'
to the oddsFormat
prop.
It is the responsibility of operator to update and suspend markets accordingly. Implementing and passing onEventChanged
callback is essential if MultiStream is also enabled.
Visual guide to the integration of main features.
Interactive Streaming comprises of 6 main features:
Video / Stream integration (Required for new streaming customers only)
Stats
Timeline
Multistream
Markets (Required)
Betslip (Required)
How to place a bet using Interactive Streaming.
To allow users to place a bet, pass onBetPlaced
onBetPlaced
callback should return a Promise
which resolves to PlaceBetSuccess
if the bet was successfully placed and should reject with an SDKError
and a message to the user if placing the bet fails or something unexpected went wrong.
The requestId
is exposed for enabling idempotence. It is changed when the market, option or value of the bet changes or if the betting interface is closed and reopened or when the bet is accepted with PlaceBetSuccess.