---
title: "Bet Insights"
canonical_url: "https://docs.sportradar.com/resources/virtual-stadium/docs/web/widgets/virtualStadium/features/betInsights"
markdown_url: "https://docs.sportradar.com/resources/virtual-stadium/docs/web/widgets/virtualStadium/features/betInsights.md"
last_updated: "2026-10-26T11:03:07Z"
---

# Bet Insights

![bet insights demo](https://docs.sportradar.com/resources/virtual-stadium/static/static/gif/bet-insights-demo.gif)

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](https://apidocs.sportradar.com/resources/widgets/docs/bet-insights/bet-insights), integrating seamlessly with your Virtual Stadium to display contextual betting information.

## Setup

### 1. Enabling Bet Insights

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.

```javascript
SIR('addWidget', '#sr-vs-widget', 'virtualStadium', {
    enableBetInsights: true,
    ...restProps
});
```

### 2. Moderation Setup

For a channel to have Bet Insights functionality, it must have set Sportradar entity id.

- [How to Add Sportradar Entity ID to Channels](https://docs.sportradar.com/resources/virtual-stadium/docs/moderationUi/uiOverview/moderation/channels.md#how-to-add-sportradar-entity-id-to-channels)
- [Create Channel API](https://docs.sportradar.com/resources/virtual-stadium/docs/api/endpoints.md#create-channel)

### 3. Adapter Registration

Bet Insights requires adapter registration to function properly. See the appropriate adapter type based on your integration needs:

- [Custom Adapter Implementation](https://docs.sportradar.com/resources/virtual-stadium/docs/web/adapter/custom/features/betInsights.md)

### 4. Handling Bet Insights Actions

When a user selects an outcome, the widget invokes your **`onAction`** callback. Virtual Stadium emits **two action types** for the same click:

| Action type              | Payload                             | Notes                                                              |
| ------------------------ | ----------------------------------- | ------------------------------------------------------------------ |
| `BetInsightsOutcome`     | `ExternalOutcome`                   | Legacy shape — same fields as before                               |
| `addSelectionsToBetSlip` | `{ selections, markets?, events? }` | V2 selection bag; `events` is a single-element array for one click |

Validate availability and re-price against your platform before adding to the bet slip — the odds in the payload are a snapshot only. See [Handling Selections and Odds](https://apidocs.sportradar.com/resources/widgets/docs/tutorials/handling-selections-and-odds) for the shared selection flow.

**`onAction`** `(type: string, data: object) => void` ***optional***

Callback function triggered when specific events occur in the widget.

**Parameters:**

**`type`** `string` ***required***

Action type: `"BetInsightsOutcome"` or `"addSelectionsToBetSlip"`.

**`data`** `ExternalOutcome` or V2 selection bag ***required***

For `BetInsightsOutcome`, see [ExternalOutcome object](#externaloutcome-object) below. For `addSelectionsToBetSlip`, `data.selections` contains adapter v2 [`SelectionOutcome`](https://apidocs.sportradar.com/resources/widgets/docs/adapter/Types#selectionoutcome) entries; optional `events` and `markets` bags carry hydrated adapter context.

***Handling Bet Insight Actions:***

```javascript
function onAction(type, data) {
    switch (type) {
        case 'BetInsightsOutcome': {
            const { type: selectionType, externalEvent, externalOutcome, externalMarket } = data;

            // Legacy shape — same integration steps as addSelectionsToBetSlip below, but read
            // event/market/outcome ids from externalEvent, externalMarket, and externalOutcome.
            // selectionType is 'uf' or 'external' (not the onAction type string).
            // With forceExternalSelections: true, selectionType is 'external' when external ids are available.

            break;
        }
        case 'addSelectionsToBetSlip': {
            const { selections, markets, events } = data;

            // Preferred V2 path — selections are adapter v2 SelectionOutcome entries

            // 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 selection/event ids to your internal identifiers
            // - Use optional events and markets bags for hydrated adapter context

            // 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 selections 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
});
```

### 5. External selection IDs (`forceExternalSelections`) {#external-selection-mapping-forceexternalselections}

Set **`forceExternalSelections: true`** on the Virtual Stadium widget when your bet slip expects **bookmaker (external) selection IDs** instead of UF ids. See [`forceExternalSelections`](https://docs.sportradar.com/resources/virtual-stadium/docs/web/widgets/virtualStadium/quickStart.md#forceExternalSelections) in the quick start for prerequisites.

Bet Insights runs inside the embedded insights widget; Virtual Stadium passes the prop through. For V2 UF selections, when `forceExternalSelections` is `true` **and** a mapper is available (adapter **`selectionUfToExternal`** or F3 via `adapterDataSource: 'f3'`), the widget emits external outcome/market/event ids in callbacks. If mapping is unavailable or fails, the payload uses UF ids (`type: 'uf'`). Selections that are already external pass through unchanged. **V1 adapter integrations keep the previous behavior.**

Payload **`type`** (on the `ExternalOutcome` object) is **`'uf'`** or **`'external'`** — not the `onAction` type string.

## Verified against

Behaviour documented here matches the widgets `production` branch and [MR 15948](https://gitlab.sportradar.ag/bets/widgets/-/merge_requests/15948) (BETS-30613):

| Source                                              | What it proves                                                 |
| --------------------------------------------------- | -------------------------------------------------------------- |
| `virtualStadium/props.ts`                           | `forceExternalSelections` prop passed to embedded Bet Insights |
| `components/betInsights/index.tsx`                  | Prop forwarded to insights widget                              |
| `betInsights/model/insightsState.ts`                | UF→external mapping gate and fallback on outcome click         |
| `utils/itemClickHelpers/mapExternalOutcomeClick.ts` | Shared mapping helpers with Flash Bet                          |
| `utils/itemClickHelpers/addSelectionsBags.ts`       | V2 `addSelectionsToBetSlip` bag shape                          |

## Data Structures

### ExternalOutcome Object

The `ExternalOutcome` object contains the data returned when a user selects an outcome in Bet Insights.

#### ExternalOutcome Properties

**`externalEvent`** `Event` *required*

Event information including teams, date, and venue. See [Event object](#event-object) for details.

**`externalOutcome`** `Outcome` *required*

The selected outcome data. See [Outcome object](#outcome-object) for details.

**`externalMarket`** `Market` *required*

The market containing the outcome. See [Market object](#market-object) for details.

**`type`** `string` *required*

Selection identifier type: **`'uf'`** or **`'external'`**. When `forceExternalSelections` is enabled and external ids are available, this is `'external'`. This is **not** the `onAction` type (`BetInsightsOutcome`).

***ExternalOutcome Example:***

```json
{
  "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": "uf"
}
```

> **Tip**
>
> When `forceExternalSelections: true` and external ids are available, `"type": "external"` and outcome/market/event `id` fields contain bookmaker identifiers. See [External selection IDs](#external-selection-mapping-forceexternalselections).

***

### Event Object

Represents a single sporting event (e.g., match, race, or stage).

#### Event Properties

**`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:***

```json
{
  "id": "sr:match:12345",
  "srEventId": "sr:match:12345",
  "externalId": null
}
```

***

### Market Object

The `Market` object represents a betting market within individual bets.

#### Market Properties

**`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](#outcome-object) for details.

**`srMarket`** `object` *optional*

Sportradar market information.

**`odds`** `OddsObject` *optional*

Odds information for the market.

***Market Example:***

```json
{
  "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
      }
    }
  ]
}
```

***

### Outcome Object

The `Outcome` object represents a possible result or selection within a market.

#### Outcome Properties

**`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:***

```json
{
  "id": "4",
  "name": "Player A",
  "odds": "6.00",
  "oddsDecimal": 6,
  "status": {
    "isActive": true
  }
}
```
