
Bet Insights is a module that provides unique, real-time (live) and pre-match insights for specific sporting events. These insights are generated based on match data supplied by Sportradar and can help users make more informed betting decisions.
Virtual Stadium Bet Insights extends the capabilities of the Sportradar Bet Insights widget, integrating seamlessly with your Virtual Stadium to display contextual betting information.
To enable Bet Insights within your Virtual Stadium widget, set the enableBetInsights property to true when initializing the widget:
enableBetInsights boolean optional
Enables the Bet Insights component.
SIR('addWidget', '#sr-vs-widget', 'virtualStadium', {
enableBetInsights: true,
...restProps
});For a channel to have Bet Insights functionality, it must have set Sportradar entity id.
Bet Insights requires adapter registration to function properly. See the appropriate adapter type based on your integration needs:
onAction (type: string, data: object) => void optional
Callback function triggered when specific events occur in the widget.
Parameters:
type string required
Action type: "BetInsightsOutcome".
data ExternalOutcome required
Action data containing outcome information (see ExternalOutcome object below).
Handling Bet Insight Actions:
function onAction(type, data) {
switch (type) {
case 'BetInsightsOutcome': {
const { externalEvent, externalOutcome, externalMarket } = data;
// IMPORTANT: Validate the Bet Insights selection before processing
// - Check if the event is still active and betting is available
// - Verify the market and outcome are still valid for betting
// - Ensure the odds haven't changed significantly since display
// Recommended: If invalid, show an error message and stop processing
// IMPORTANT: Handle ID mapping if needed
// - Map externalEvent.id to your internal event identifier
// - Map externalMarket.id to your internal market identifier
// - Map externalOutcome.id to your internal outcome identifier
// This ensures consistency with your existing betting system
// IMPORTANT: Get current odds for the selection
// - Bet Insights displays cached odds that may be outdated
// - Fetch fresh odds from your odds provider using the mapped IDs
// - Compare with displayed odds and alert user if significantly different
// - Use current odds for bet placement to ensure accuracy
// Process the Bet Insights selection
// - Add the outcome to the user's betslip with current odds
// - Handle any bet slip mode logic if applicable
// - Update user's balance and betslip state
// Show user feedback
// - Display success message with bet details
// - Update UI to reflect the new betslip state
break;
}
default: {
console.log('Unhandled action type:', type);
}
}
}
SIR('addWidget', '#sr-vs-widget', 'virtualStadium', {
enableBetInsights: true,
onAction: onAction,
// ... other configuration
});The ExternalOutcome object contains the data returned when a user selects an outcome in Flash Bet.
externalEvent Event required
Event information including teams, date, and venue. See Event object for details.
externalOutcome Outcome required
The selected outcome data. See Outcome object for details.
externalMarket Market required
The market containing the outcome. See Market object for details.
type string required
Action type: "FlashBetOutcome".
ExternalOutcome Example:
{
"externalEvent": {
"id": "sr:match:12345",
"srEventId": "sr:match:12345",
"externalId": null
},
"externalOutcome": {
"id": "4",
"name": "Player A",
"odds": "6.00",
"oddsDecimal": 6,
"status": {
"isActive": true
}
},
"externalMarket": {
"id": "202",
"status": {
"isActive": true
},
"specifier": {
"value": "setnr=2",
"displayedValue": "2"
},
"name": "2nd set - winner",
"outcomes": [
{
"id": "4",
"name": "Player A",
"odds": "6.00",
"oddsDecimal": 6,
"status": {
"isActive": true
}
},
{
"id": "5",
"name": "Player B",
"odds": "1.08",
"oddsDecimal": 1.08,
"status": {
"isActive": true
}
}
]
},
"type": "FlashBetOutcome"
}Represents a single sporting event (e.g., match, race, or stage).
id string required
Unique identifier for the event.
srEventId string | number optional
Sportradar event identifier.
externalId string | number | null optional
Your external system identifier for the event.
Event Example:
{
"id": "sr:match:12345",
"srEventId": "sr:match:12345",
"externalId": null
}The Market object represents a betting market within individual bets.
id string | number required
Unique identifier for the market.
status object optional
Current status of the market. The available statuses are: active, deactivated suspended, settled or canceled.
name string required
Display name of the market (e.g., "Match Winner", "Total Goals").
visualTypeId string | number optional
The visual type identifier for the market.
specifier object optional
Market specifier configuration with value and displayedValue properties.
outcomes Outcome[] required
Array of possible outcomes for this market. See Outcome object for details.
srMarket object optional
Sportradar market information.
odds OddsObject optional
Odds information for the market.
Market Example:
{
"id": "202",
"status": {
"status": "active"
},
"specifier": {
"value": "setnr=2",
"displayedValue": "2"
},
"name": "2nd set - winner",
"outcomes": [
{
"id": "4",
"name": "Player A",
"odds": "6.00",
"oddsDecimal": 6,
"status": {
"isActive": true
}
},
{
"id": "5",
"name": "Player B",
"odds": "1.08",
"oddsDecimal": 1.08,
"status": {
"isActive": true
}
}
]
}The Outcome object represents a possible result or selection within a market.
id string | number required
Unique identifier for the outcome.
name string required
Display name of the outcome (e.g., "Team A", "Draw", "Under 2.5").
odds string | number optional
Odds for this outcome.
oddsDecimal number optional
Decimal representation of odds.
status object optional
Current status of the outcome.
Outcome Example:
{
"id": "4",
"name": "Player A",
"odds": "6.00",
"oddsDecimal": 6,
"status": {
"isActive": true
}
}