---
title: "Highlights"
canonical_url: "https://docs.sportradar.com/resources/widgets/docs/bet-recommendation/highlights"
markdown_url: "https://docs.sportradar.com/resources/widgets/docs/bet-recommendation/highlights.md"
last_updated: "2026-05-28T09:25:24Z"
---

# Highlights

**Highlights** widget (Bet Recommendation) is a front-end widget that provides a **personalized betting experience**. It displays a list of events based on event popularity and the punters betting history via a user friendly interface. It simplifies the process of finding the right bet from the myriad of possible choices and boosts betting volume for upcoming and live events.

- Punters past activity
- General betting trends
- Overall betting volume
- Seasonal variations
- New discovery and engagement patterns

**Recommendation types**

- **Recommended**: Personalized list of recommendations based on punters betting history and preferences. Requires the user to be logged in.
- **Popular**: List of the most popular items based on the total number of bets placed (no login required).
- **Trending**: List of the currently trending items based on the number of recently placed bets (no login required).

> **Info**
>
> **Personalization requirement**
> To enable personalized recommendations (the `recommended` type), you must provide a unique `user` identifier. When no user ID is provided, the widget will fall back to `popular` recommendations.

## Key Capabilities

### Personal Touch

Smart AI-driven event recommendations tailored to each individual punter's unique betting history.

### Live & Pre-match

Full support for real-time in-play event highlights and upcoming pre-match betting opportunities.

### Discovery Engine

Simplifies the selection process by surfacing the most relevant bets from thousands of available options.

### Volume Growth

Strategically designed to boost betting turnover for both upcoming matches and live events.

### Painless Setup

Rapid client-side integration with minimal development resources required for a full deployment.

### Flexible Styling

Complete creative freedom to customize colors, shapes, and typography to fit your brand identity.

## Placement Options

### Homepage Grid

Engaging horizontal or vertical carousel of events that serves as the perfect entry point.

### Sidebar Stacks

Optimized vertical layouts for sidebar placement, keeping users engaged across every page.

### Full-Screen Focus

Expansive grid support for high-density, multi-row event showcases on desktop landing pages.

### Mobile First

Native-feeling scrolling and swiping interactions built specifically for the mobile-betting generation.

## Settings and Customization

- Recommendation type: recommended, popular, or trending
- Time span: live, upcoming, or both (default)
- Sport filter: single sport or multiple sports
- Competition/country filter

## Styling Options

- Elements (container, cards, buttons): colors and rounded corners
- Text: font styles and colors
- Recommendation selector: enable/disable or show only one recommendation type
- Sports selector: enable/disable (all sports selected if disabled)
- Events: number of rows (1-3, default 1)

## Requirements

- Access to the client API

- Required endpoints: User ID, Odds (WIP)

- Requires an adapter to be registered via `SIR('registerAdapter', '{ADAPTER_NAME}')`. See the adapter overview: <https://apidocs.sportradar.online/resources/widgets/docs/adapter/Overview>

- **widget-name**: `betRecommendation`

**Environment Requirements**

## Technical Requirements:

- JavaScript enabled
- XMLHttpRequest support for data fetching
- CSS3 support for styling and animations

**Supported Sports**

**Bet Recommendation widgets are sport-agnostic and will function with all Sportradar supported sports. Please see [Sports Reference](https://docs.sportradar.com/resources/widgets/docs/tutorials/references/sports.md).**

## Main Configurable Features

Illustrations of main layout variants and card types with relevant property values below.
See the [Highlights widget demo](https://widgets.sir.sportradar.com/bet-recommendation#).

**Default**

![Default](https://docs.sportradar.com/resources/widgets/static/img/highlights/default.png)

**Expanded Categories**

![Expanded Categories](https://docs.sportradar.com/resources/widgets/static/img/highlights/expandedCategories.png)

**Compact Event Format**

![Compact Event Format](https://docs.sportradar.com/resources/widgets/static/img/highlights/compactEventFormat.png)

**Table Event Format**

![Table Event Format](https://docs.sportradar.com/resources/widgets/static/img/highlights/tableEventFormat.png)

## API Reference

### Basic Properties

| Property              | Type             | Default        | Description                                                                       |
| --------------------- | ---------------- | -------------- | --------------------------------------------------------------------------------- |
| `user`                | `string\|number` | `0`            | User identifier for personalized recommendations.                                 |
| `count`               | `number`         | `24`           | Number of event cards to display (1-48).                                          |
| `cardsLayout`         | `string`         | `"horizontal"` | Layout direction: `"horizontal"` (grid) or `"vertical"` (single column).          |
| `categoryLayout`      | `string`         | `"tabs"`       | Display mode: `"tabs"` (one category at a time) or `"expanded"` (all categories). |
| `cardVariant`         | `string`         | `"default"`    | Card style: `"default"`, `"compact"`, or `"table"`.                               |
| `outcomeNamePosition` | `string`         | `"start"`      | Position of outcome label: `"start"`, `"end"`, `"top"`, or `"bottom"`.            |
| `onItemClick`         | `function`       | `undefined`    | Callback for user clicks on events or outcomes.                                   |

**Extended Properties**

| Property                       | Type            | Default      | Description                                                                                                                                                                                                                                                                                                                                                       |
| ------------------------------ | --------------- | ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `filters`                      | `object`        | **Required** | Configuration for all filter types including recommendation type, sports, time, country, and leagues. See below for detailed structure.                                                                                                                                                                                                                           |
| `maxRows`                      | `number`        | `1`          | Maximum number of card rows to display. Determines vertical height of widget. Combined with responsive cards-per-row calculation, this controls total visible cards. Example: 3 rows × 4 cards/row = 12 visible cards. Range: 1-3 rows.                                                                                                                           |
| `sportsMapping`                | `object`        | `undefined`  | Maps client's sport identifiers to Sportradar sport IDs. Object with keys as client sport IDs (string/number) and values as Sportradar sport IDs. Example: `{101: 1, 102: 2}` maps client sport 101 to soccer, 102 to basketball. Allows using client's sport taxonomy in filter configurations.                                                                  |
| `similarEventIds`              | `array<number>` | `undefined`  | Array of event IDs for "similar" recommendation type. **Required when `filters.recommendationType.available` includes `"similar"` and `active: "similar"`**. AI finds events similar to specified reference events based on sport, league, teams, odds patterns, and market characteristics. Example: `[12345, 67890]` finds events similar to these two matches. |
| `debug`                        | `boolean`       | `false`      | Enables debug mode with console logging for development. When `true`, logs recommendation generation, API calls, event filtering, card rendering, interaction tracking, errors with stack traces. Use for troubleshooting integration issues and understanding recommendation logic.                                                                              |
| `styling`                      | `object`        | `undefined`  | Custom styling configuration for layout adjustments.                                                                                                                                                                                                                                                                                                              |
| `styling.disablePaddingTop`    | `boolean`       | `false`      | Removes top padding from widget container. Use when widget follows other content without spacing gap.                                                                                                                                                                                                                                                             |
| `styling.disablePaddingBottom` | `boolean`       | `false`      | Removes bottom padding from widget container. Use when widget precedes other content without spacing gap.                                                                                                                                                                                                                                                         |

### Filters Object

The `filters` object controls recommendation algorithms, time windows, sports, geographic regions, and league filtering.

| Property                       | Type                    | Default                                             | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ------------------------------ | ----------------------- | --------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `recommendationType`           | `object`                | **Required**                                        | Recommendation algorithm configuration controlling which recommendation types display and initial active type.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `recommendationType.available` | `array<string>`         | `["recommended", "popular", "trending", "similar"]` | **Required.** Array of recommendation types to enable. Order determines tab sequence (when `categoryLayout: "tabs"`) or section order (when `categoryLayout: "expanded"`). Options: <ul><li>`"recommended"`: AI-powered personalized recommendations based on user betting history (requires `user` parameter). Analyzes user's favorite sports, preferred odds ranges, typical bet types, bet timing, win rates, and engagement patterns.</li><li>`"popular"`: Most popular events across all users. Shows events with highest betting volume, number of unique bettors, and consistent popularity. Social proof effect.</li><li>`"trending"`: Events experiencing momentum and increasing popularity. Captures betting volume spikes, rapid odds changes, unusual activity patterns, social media buzz. Time-sensitive opportunities.</li><li>`"similar"`: Events similar to specified reference events (requires `similarEventIds` parameter). AI finds comparable matches based on sport, league, teams, odds, market characteristics, timing.</li></ul> |
| `recommendationType.active`    | `string`                | First value from `available`                        | Initially active/selected recommendation type. Must be one value from `available` array. When `categoryLayout: "tabs"`, determines which tab displays first. When `categoryLayout: "expanded"`, determines initial scroll position/emphasis. Example: `"popular"` starts with popular recommendations visible.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `recommendationType.hidden`    | `boolean`               | `false`                                             | Controls visibility of recommendation type selector. When `true`, hides category tabs/headers entirely (widget shows events from active type only, no switching UI). When `false`, shows navigation between recommendation types. Set `true` for single-type focused displays, clean minimal layouts.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `sport`                        | `object`                | `undefined`                                         | Sport filter configuration.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `sport.available`              | `array<string\|number>` | `[]`                                                | Array of Sportradar sport IDs to include in recommendations and sport filter. Empty array or omitted shows all available sports. Example: `[1, 2, 5]` for soccer, basketball, tennis only. When provided, widget shows sport filter UI with these options. See [Sports Reference](https://docs.sportradar.com/resources/widgets/docs/tutorials/references/sports.md).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `sport.hidden`                 | `boolean`               | `false`                                             | Controls visibility of sport filter UI. When `true`, hides sport selector (events still filtered by `sport.available` if specified, but no user-facing filter controls). When `false`, shows sport filter icons/tabs for user selection. Set `true` for single-sport pages, clean minimal interfaces.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `sport.sportNames`             | `boolean`               | `false`                                             | Display mode for sport filter. When `true`, shows sport names as text labels instead of sport icons. When `false`, shows sport-specific icons (⚽ soccer, 🏀 basketball, etc.). Set `true` for accessibility, text-heavy designs, or when icons unclear to users.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `time`                         | `object`                | `undefined`                                         | Time/status filter configuration for event scheduling.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `time.available`               | `array<string>`         | `["live", "not_started"]`                           | Array of available time filter options. Options: `"live"` (only live/in-play events), `"not_started"` (only upcoming/pre-match events). Example: `["live"]` shows live-only filter, `["not_started"]` shows upcoming-only, `["live", "not_started"]` shows both with toggle.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `time.active`                  | `array<string>`         | All values from `available`                         | Initially active time filters. Can select multiple values from `available` array for combined filtering. Example: `["live"]` starts showing live events only, `["live", "not_started"]` shows both (no time filtering), `[]` shows nothing (edge case - avoid).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `time.hidden`                  | `boolean`               | `false`                                             | Controls visibility of time filter UI. When `true`, hides time selector (events still filtered by `time.active`, but no user controls). When `false`, shows time filter toggle/buttons. Set `true` for fixed time scope pages (e.g., "Live Betting Hub" always shows live).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `country`                      | `object`                | `undefined`                                         | Country/region filter configuration.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `country.available`            | `array<string\|number>` | `undefined`                                         | Array of country identifiers to filter events geographically. Accepts Sportradar country IDs or ISO country codes (A2/A3). Example: `["US", "GB", "DE"]` shows only events from USA, UK, Germany. When provided, only events from specified countries appear. See [Getting Identifiers](https://docs.sportradar.com/resources/widgets/docs/tutorials/getting-identifiers.md).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `league`                       | `object`                | `undefined`                                         | League/tournament filter configuration.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `league.available`             | `array<string\|number>` | `undefined`                                         | Array of tournament/league identifiers to filter events by competition. Accepts Sportradar unique tournament IDs. Example: `["sr:tournament:17", "sr:tournament:34"]` shows only Premier League and Bundesliga events. Powerful for league-specific pages or premium competition focus. See [Getting Identifiers](https://docs.sportradar.com/resources/widgets/docs/tutorials/getting-identifiers.md).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |

#### Filters Example

```javascript
{
  recommendationType: {
    available: ['recommended', 'popular', 'trending'],
    active: 'popular',
    hidden: false
  },
  sport: {
    available: [1, 2, 5],  // Soccer, Basketball, Tennis
    hidden: false,
    sportNames: false
  },
  time: {
    available: ['live', 'not_started'],
    active: ['live', 'not_started']  // Show both
  },
  country: {
    available: ['GB', 'DE', 'ES', 'IT']  // Top European countries
  },
  league: {
    available: [
      'sr:tournament:17',   // Premier League
      'sr:tournament:34',   // Bundesliga
      'sr:tournament:7'     // La Liga
    ]
  }
}
```

## Theming

Theming customization allows to tailor the appearance of Bet Recommendation widgets to meet specific needs and preferences. In the context of the Bet Recommendation widget, customization refers to the ability to modify the default styling of the widget by applying custom CSS properties to the various HTML elements that make up the widget.

Widget comes with pre-existing styling but can be customized by applying custom CSS properties to its different HTML elements. The widget's custom class selectors and supported CSS properties are listed below.

All custom classes must be nested within the `.sr-bb.sr-betRecommendation` selector class. This ensures that the custom styles only apply to that widget and not to other elements on the page.

### Custom Class Selectors

| CSS class                     | Supported CSS properties                     |
| ----------------------------- | -------------------------------------------- |
| `srct-br-container`           | `background-color`, `font-family`            |
| `srct-br-header`              | `background-color`, `color`                  |
| `srct-br-header__divider`     | `border-color`                               |
| `srct-br-footer`              | `color`                                      |
| `srct-br-loading`             | `background-color`, `border-radius`          |
| `srct-br-navigation`          | `background-color`, `color`                  |
| `srct-br-sportsfilter`        | `background-color`, `color`                  |
| `srct-br-content`             | `background-color`                           |
| `srct-br-content__title`      | `color`                                      |
| `srct-br-cardlist`            | `background-color`, `border-radius`          |
| `srct-br-card`                | `background-color`, `color`, `border-radius` |
| `srct-br-card__divider`       | `border-color`                               |
| `srct-br-outcome`             | `background-color`, `color`, `border-radius` |
| `srct-br-outcome--selected`   | `background-color`, `color`, `border-radius` |
| `srct-br-outcome--disabled`   | `background-color`, `color`, `border-radius` |
| `srct-br-outcome__name`       | `font-size`, `color`                         |
| `srct-br-outcome__value`      | `font-size`, `color`                         |
| `srct-br-eventinfo`           | `font-size`, `color`                         |
| `srct-br-eventinfo__info`     | `font-size`                                  |
| `srct-br-eventinfo__icon`     | `color`                                      |
| `srct-br-eventinfo__time`     | `font-size`, `color`                         |
| `srct-br-eventinfo__status`   | `font-size`, `color`                         |
| `srct-br-eventinfo__name`     | `font-size`, `color`                         |
| `srct-br-scoreboard`          | `font-size`, `color`                         |
| `srct-br-scoreboard__teams`   | `font-size`, `color`                         |
| `srct-br-scoreboard__scores`  | `font-size`, `color`                         |
| `srct-br-scoreboard__score-1` | `font-size`, `color`                         |
| `srct-br-scoreboard__score-2` | `font-size`, `color`                         |
| `srct-br-scoreboard__score-3` | `font-size`, `color`                         |

## Integration

> **Warning**
>
> **Mandatory Configuration**
> The `filters` property is required for this widget to function correctly. It defines the recommendation logic and basic data constraints.

![Bet Recommendation technical guide](https://docs.sportradar.com/resources/widgets/static/img/betRecommendationTechnicalGuide.jpg)

Demo: [Open demo](https://widgets.sir.sportradar.com/bet-recommendation#)

### Widget Setup

**Basic Grid**

Basic horizontal grid with popular and trending recommendations.

**JavaScript**

```javascript
SIR("addWidget", "#highlights-1", "betRecommendation", {
  count: 24,
  maxRows: 3,
  filters: {
    recommendationType: {
      available: ["popular", "trending"],
    },
  },
});
```

**HTML (data attributes)**

```html
<div
  class="sr-widget"
  data-sr-widget="betRecommendation"
  data-count="24"
  data-max-rows="3"
  data-filters='{"recommendationType": {"available": ["popular", "trending"]}}'
></div>
```

**Personalized**

> **Info**
>
> **Personalization requirement**
> To enable personalized recommendations (the `recommended` type), you must provide a unique `user` identifier. When no user ID is provided, the widget will fall back to `popular` recommendations.

Personalized recommendations for logged-in user.

**JavaScript**

```javascript
SIR("addWidget", "#highlights-2", "betRecommendation", {
  user: "user123",
  count: 24,
  maxRows: 3,
  filters: {
    recommendationType: {
      available: ["recommended", "popular"],
      active: "recommended",
    },
  },
});
```

**HTML (data attributes)**

```html
<div
  class="sr-widget"
  data-sr-widget="betRecommendation"
  data-user="user123"
  data-count="24"
  data-max-rows="3"
  data-filters='{"recommendationType": {"available": ["recommended", "popular"], "active": "recommended"}}'
></div>
```

**Compact Mobile**

Compact vertical layout ideal for mobile sidebars.

**JavaScript**

```javascript
SIR("addWidget", "#highlights-3", "betRecommendation", {
  count: 12,
  maxRows: 2,
  cardVariant: "compact",
  cardsLayout: "vertical",
  filters: {
    recommendationType: {
      available: ["popular"],
    },
  },
});
```

**HTML (data attributes)**

```html
<div
  class="sr-widget"
  data-sr-widget="betRecommendation"
  data-count="12"
  data-max-rows="2"
  data-card-variant="compact"
  data-cards-layout="vertical"
  data-filters='{"recommendationType": {"available": ["popular"]}}'
></div>
```

**Live Only**

Live events only with trending recommendations focused.

**JavaScript**

```javascript
SIR("addWidget", "#highlights-4", "betRecommendation", {
  count: 18,
  maxRows: 2,
  filters: {
    recommendationType: {
      available: ["trending", "popular"],
      active: "trending",
    },
    time: {
      available: ["live"],
      active: ["live"],
    },
  },
});
```

**HTML (data attributes)**

```html
<div
  class="sr-widget"
  data-sr-widget="betRecommendation"
  data-count="18"
  data-max-rows="2"
  data-filters='{"recommendationType": {"available": ["trending", "popular"], "active": "trending"}, "time": {"available": ["live"], "active": ["live"]}}'
></div>
```

**Soccer**

Soccer-specific recommendations and filtering.

**JavaScript**

```javascript
SIR("addWidget", "#highlights-5", "betRecommendation", {
  count: 24,
  maxRows: 3,
  filters: {
    recommendationType: {
      available: ["popular", "trending"],
    },
    sport: {
      available: [1], // Soccer only
      hidden: false,
    },
  },
});
```

**HTML (data attributes)**

```html
<div
  class="sr-widget"
  data-sr-widget="betRecommendation"
  data-count="24"
  data-max-rows="3"
  data-filters='{"recommendationType": {"available": ["popular", "trending"]}, "sport": {"available": [1]}}'
></div>
```

**Expanded View**

Multi-sport with expanded category layout (no category switching).

**JavaScript**

```javascript
SIR("addWidget", "#highlights-6", "betRecommendation", {
  count: 16,
  maxRows: 2,
  categoryLayout: "expanded",
  filters: {
    recommendationType: {
      available: ["recommended", "popular", "trending"],
    },
    sport: {
      available: [1, 2, 5, 10], // Soccer, Basketball, Tennis, American Football
    },
  },
});
```

**HTML (data attributes)**

```html
<div
  class="sr-widget"
  data-sr-widget="betRecommendation"
  data-count="16"
  data-max-rows="2"
  data-category-layout="expanded"
  data-filters='{"recommendationType": {"available": ["recommended", "popular", "trending"]}, "sport": {"available": [1, 2, 5, 10]}}'
></div>
```

**Table View**

Structured table card variant for analytical display.

**JavaScript**

```javascript
SIR("addWidget", "#highlights-7", "betRecommendation", {
  count: 5,
  cardVariant: "table",
  filters: {
    recommendationType: {
      available: ["popular"],
    },
  },
});
```

**HTML (data attributes)**

```html
<div
  class="sr-widget"
  data-sr-widget="betRecommendation"
  data-count="5"
  data-card-variant="table"
  data-filters='{"recommendationType": {"available": ["popular"]}}'
></div>
```

**Similar**

> **Warning**
>
> **Similar Recommendations Requirement**
> When using the `similar` recommendation type, you must provide the `similarEventIds` identifier to specify the reference matches. Refer to [Getting Identifiers](https://docs.sportradar.com/resources/widgets/docs/tutorials/getting-identifiers.md) for more details.

Similar events based on provided reference match context.

**JavaScript**

```javascript
SIR("addWidget", "#highlights-8", "betRecommendation", {
  count: 12,
  maxRows: 2,
  similarEventIds: [12345, 67890],
  filters: {
    recommendationType: {
      available: ["similar"],
      active: "similar",
    },
  },
});
```

**HTML (data attributes)**

```html
<div
  class="sr-widget"
  data-sr-widget="betRecommendation"
  data-count="12"
  data-max-rows="2"
  data-similar-event-ids="[12345, 67890]"
  data-filters='{"recommendationType": {"available": ["similar"], "active": "similar"}}'
></div>
```

**Top Leagues**

Filter recommendations to top European leagues only.

**JavaScript**

```javascript
SIR("addWidget", "#highlights-9", "betRecommendation", {
  count: 24,
  maxRows: 3,
  filters: {
    recommendationType: {
      available: ["popular", "trending"],
    },
    sport: {
      available: [1],
    },
    league: {
      available: [
        "sr:tournament:17", // Premier League
        "sr:tournament:34", // Bundesliga
        "sr:tournament:7", // La Liga
      ],
    },
  },
});
```

**HTML (data attributes)**

```html
<div
  class="sr-widget"
  data-sr-widget="betRecommendation"
  data-count="24"
  data-max-rows="3"
  data-filters='{"recommendationType": {"available": ["popular", "trending"]}, "sport": {"available": [1]}, "league": {"available": ["sr:tournament:17", "sr:tournament:34", "sr:tournament:7"]}}'
></div>
```

**Geographic**

Recommendations filtered by country of competition.

**JavaScript**

```javascript
SIR("addWidget", "#highlights-10", "betRecommendation", {
  count: 24,
  maxRows: 3,
  filters: {
    recommendationType: {
      available: ["popular"],
    },
    country: {
      available: ["GB", "DE", "ES", "IT", "FR"],
    },
  },
});
```

**HTML (data attributes)**

```html
<div
  class="sr-widget"
  data-sr-widget="betRecommendation"
  data-count="24"
  data-max-rows="3"
  data-filters='{"recommendationType": {"available": ["popular"]}, "country": {"available": ["GB", "DE", "ES", "IT", "FR"]}}'
></div>
```

**Click Handler**

Full interaction handling for navigation and bet slips.

**JavaScript**

```javascript
SIR("addWidget", "#highlights-11", "betRecommendation", {
  count: 24,
  maxRows: 3,
  onItemClick: function (target, data) {
    console.log("Highlights interaction:", target, data);

    if (target === "outcome") {
      // User clicked outcome to add to bet slip
      const { event, market, outcome } = data;

      betSlip.addSelection({
        eventId: event.id,
        eventName: `${event.teams.home.name} vs ${event.teams.away.name}`,
        marketId: market.id,
        marketName: market.name,
        outcomeId: outcome.id,
        outcomeName: outcome.name,
        odds: outcome.odds,
        sportId: event.sport.id,
      });

      // Track analytics
      gtag("event", "bet_slip_add", {
        source: "highlights_widget",
        event_id: event.id,
        market_name: market.name,
        odds: outcome.odds,
        recommendation_type: "popular",
      });
    } else if (target === "event") {
      // User clicked event card/header for navigation
      const { event } = data;

      // Navigate to match detail page
      window.location.href = `/matches/${event.id}`;

      gtag("event", "event_card_click", {
        event_id: event.id,
        sport_id: event.sport.id,
      });
    }
  },
  filters: {
    recommendationType: {
      available: ["popular", "trending"],
    },
  },
});
```

**Styling**

Custom layout configuration (no padding).

**JavaScript**

```javascript
SIR("addWidget", "#highlights-12", "betRecommendation", {
  count: 24,
  maxRows: 3,
  styling: {
    disablePaddingTop: true,
    disablePaddingBottom: true,
  },
  filters: {
    recommendationType: {
      available: ["popular"],
    },
  },
});
```

**Fixed Config**

Hidden filters with fixed predefined configuration.

**JavaScript**

```javascript
SIR("addWidget", "#highlights-13", "betRecommendation", {
  count: 18,
  maxRows: 2,
  filters: {
    recommendationType: {
      available: ["popular"],
      hidden: true, // No category switching UI
    },
    sport: {
      available: [1, 2],
      hidden: true, // No sport filter UI
    },
    time: {
      available: ["live"],
      active: ["live"],
      hidden: true, // No time filter UI
    },
  },
});
```

**Outcome Positioning**

Custom label positioning for outcomes.

**JavaScript**

```javascript
SIR("addWidget", "#highlights-14", "betRecommendation", {
  count: 12,
  maxRows: 2,
  outcomeNamePosition: "top", // Label above odds
  cardVariant: "compact",
  filters: {
    recommendationType: {
      available: ["popular"],
    },
  },
});
```

**Sports Mapping**

Mapping client sport taxonomy to Sportradar IDs.

**JavaScript**

```javascript
SIR("addWidget", "#highlights-15", "betRecommendation", {
  count: 24,
  maxRows: 3,
  sportsMapping: {
    101: 1, // Client sport 101 = Soccer
    102: 2, // Client sport 102 = Basketball
    105: 5, // Client sport 105 = Tennis
  },
  filters: {
    recommendationType: {
      available: ["popular"],
    },
    sport: {
      available: [101, 102, 105], // Using client sport IDs
    },
  },
});
```

### onItemClick

The `onItemClick` callback is fired whenever the user interacts with the widget. The first argument is a `target` string that identifies the interaction type; the second argument is a `data` object containing contextual information.

| `target` value          | Trigger                                                        | Key `data` properties                                         |
| :---------------------- | :------------------------------------------------------------- | :------------------------------------------------------------ |
| `"externalOutcome"`     | User clicks a single outcome button                            | `externalEvent`, `externalMarket`, `externalOutcome`          |
| `"externalOutcomes"`    | User clicks multiple outcomes at once (e.g. combo card)        | Array of `{ externalEvent, externalMarket, externalOutcome }` |
| `"externalEvent"`       | User clicks an event header/card                               | `externalEvent`                                               |
| `"externalCompetition"` | User clicks a competition/league name                          | `externalCompetition`                                         |
| `"goToBetSlip"`         | User clicks the "Go to Bet Slip" button (swipeBet only)        | —                                                             |
| `"betSlipMode"`         | Bet slip mode changes between single and multi (swipeBet only) | `value: "single" \| "multi"`                                  |

```javascript
SIR("addWidget", "#sr-widget", "betRecommendation.markets", {
  onItemClick: function (target, data) {
    if (target === "externalOutcome") {
      // Add single outcome to bet slip
      const { externalEvent, externalMarket, externalOutcome } = data;
      betSlip.add({
        eventId: externalEvent.id,
        marketId: externalMarket.id,
        outcomeId: externalOutcome.id,
      });
    } else if (target === "externalEvent") {
      // Navigate to event/match detail page
      window.location.href = `/matches/${data.externalEvent.id}`;
    } else if (target === "externalCompetition") {
      // Navigate to competition/league page
      window.location.href = `/league/${data.externalCompetition.tournament.id}`;
    }
  },
  filters: { recommendationType: { available: "popular" } },
});
```

For the full flow after a selection is emitted — trusting snapshot odds, re-pricing against your platform, validating availability, and accepting or rejecting the bet — see [Handling Selections and Odds](https://docs.sportradar.com/resources/widgets/docs/tutorials/handling-selections-and-odds.md).

Note: Widgets support callbacks on outcome clicks — the `onItemClick` handler receives `target === "outcome"` and a `data` object containing `externalEvent`, `externalMarket` and `externalOutcome`. Use this for custom outcome callbacks (e.g., add-to-betslip, analytics, modals).

The widget also exposes `onTrack` for event tracking analytics. See the [tracking guide](https://apidocs.sportradar.online/resources/widgets/docs/tutorials/tracking-guide) for details.

### Bet Slip Sync

To keep the widget's selected-outcome state in sync with your own bet slip (i.e. show outcomes as selected when they were added outside the widget), use `registerOnBetSlipChange` inside `registerAdapter`.

```javascript
// 1. Track your bet slip state
let changeCallback;
let betSlipState = { betslip: [], combinedOddsValue: undefined };

// 2. Notify the widget whenever the bet slip changes
function onBetSlipChanged(callback) {
  changeCallback = callback;
  changeCallback && changeCallback(betSlipState); // push current state immediately
}

// 3. Handle outcome clicks from the widget
function onItemClick(target, data) {
  if (target === "externalOutcome") {
    const newBet = {
      externalEventId: data.externalEvent.id,
      externalMarketId: data.externalMarket.id,
      externalOutcomeId: data.externalOutcome.id,
      externalSpecifierId: data.externalMarket.specifier
        ? data.externalMarket.specifier.value
        : undefined,
    };
    betSlipState = {
      betslip: [...betSlipState.betslip, newBet],
      combinedOddsValue: "14.52", // replace with your own calculation
    };
    changeCallback && changeCallback(betSlipState);
  }
}

// 4. Register adapter with bet slip sync + add the widget
SIR("registerAdapter", "{ADAPTER_NAME}", { onBetSlipChanged });
SIR("addWidget", "#sr-widget", "betRecommendation.markets", { onItemClick });
```

Until a custom adapter is developed, use the `mockData` adapter for local testing:

```javascript
SIR("registerAdapter", "mockData", { onBetSlipChanged });
```

### Adapter Setup

An **adapter** is a software component developed by the Sportradar engineering team that bridges the Bet Recommendation widgets and your platform's API. It retrieves data from your API and feeds it to the widget, ensuring seamless communication between the two systems.

SIR Widgets supports two types of adapter implementations:

1. [Self-Service Adapter](https://docs.sportradar.com/resources/widgets/docs/adapter/SelfServiceImplementation.md)
2. [Hosted Adapter](https://docs.sportradar.com/resources/widgets/docs/adapter/HostedImplementation.md)

Before adapter development begins, confirm and align your API contract with the Sportradar engineering team. Integration requires two SIR calls:

| SIR method                    | Purpose                                                               |
| :---------------------------- | :-------------------------------------------------------------------- |
| `SIR('registerAdapter', ...)` | Configure the adapter that retrieves and displays data from your API. |
| `SIR('addWidget', ...)`       | Mount the widget on the page.                                         |

```javascript
(function (a, b, c, d, e, f, g, h, i) {
  a[e] ||
    ((i = a[e] =
      function () {
        (a[e].q = a[e].q || []).push(arguments);
      }),
    (i.l = 1 * new Date()),
    (i.o = f),
    (g = b.createElement(c)),
    (h = b.getElementsByTagName(c)[0]),
    (g.async = 1),
    (g.src = d),
    g.setAttribute("n", e),
    h.parentNode.insertBefore(g, h));
})(
  window,
  document,
  "script",
  "https://widgets.sir.sportradar.com/sportradar/widgetloader",
  "SIR",
  { language: "en" },
);

SIR("registerAdapter", "{ADAPTER_NAME}");
SIR("addWidget", "#sr-widget", "betRecommendation.markets");
```

#### Adapter Endpoint Requirements

##### Mandatory Endpoints

- `eventMarkets` or (`market` + `availableMarketsForEvent`)
- `event`

##### Optional Endpoints

- `filterMarkets` - narrows markets selection for widget specific use
- `betSlipSelection` - visual representation of markets already in betslip
- `cashBackSelections` - adds visual representation of cash back markets

#### Adapter Implementation Template

This is an example of an adapter implementing all endpoints. It is intended to be a copy/paste template, where only data fetching and transformation need to be implemented. When implementing an adapter, implement only the endpoints which are required by the widget being integrated, and discard the rest. For each endpoint, only the `getData${ENDPOINT_NAME}()` and `transormData${ENDPOINT_NAME}()` functions need to be implemented.

***Expand Adapter Template Code***

```html
<script type="text/javascript">
// Widget loader script from Step 3 
ndatory 
// -------- Data + Transform functions --------

async function getDataMarket(args) {
  // Here fetch data from your data source and return it
  return {};
}

function transformDataMarket(data) {
  // Here transform your data into data structure exemplified by the object below.
  /*
  // Illustration how data transformation might work from client data to Adapter types
  return {
    market: {
      id: data.marketId,
      name: data.marketName,
      outcomes: data.outcomes.map((outcome) =>  { id: outcome.id, name: outcome.name, odds: outcome.odds } )
    },
    event: { id: data.eventId, type: data.eventType }
  };
  */

  return {
    market: {
      id: "sr:market:1",
      name: "Match Winner",
      outcomes: [
        { id: "1", name: "Home", odds: 2.5 },
        { id: "X", name: "Draw", odds: 3.0 },
        { id: "2", name: "Away", odds: 3.2 }
      ]
    },
    event: "sr:match:12345"
  };
}

async function getDataAvailableMarketsForEvent(args) {
  // Here fetch data from your data source and return it
  return {};
}

function transformDataAvailableMarketsForEvent(data) {
  // Here transform your data into data structure exemplified by the object below.
  /*
  // Illustration how data transformation might work from client data to Adapter types
  return {
    selection: data.map((selection) => { type: selection.type, event: selection.event, market: selection.market})
  }; 
  */

  return {
    selection: [
      {
        type: "uf",
        event: "61513908",
        market: "1",
      },
    ],
  };
}

async function getDataEventMarkets(args) {
  // Here fetch data from your data source and return it
  return {};
}

function transformDataEventMarkets(data, args) {
  // Here transform your data into data structure exemplified by the object below.
  /*
  // Illustration how data transformation might work from client data to Adapter types
  let markets = []

  function mapMarkets(market){
    return {
      id: market.id,
      status: market.status,
      name: market.name,
      outcomes: market.outcomes.map((outcome) => {id: outcome.id, name: outcome.name , odds: { type: outcome.odds.type, value: outcome.odds.value}, status: outcome.status})
    };
  }

  return data.forEach(mapMarkets);
  */

  return {
    event: args.selection.event,
    markets: [
      {
        id: "1",
        status: "active",
        name: "1x2",
        outcomes: [
          {
            id: "1",
            name: "Tenhaisen",
            odds: { type: "decimal", value: "1.88" },
            status: "active",
          },
          {
            id: "2",
            name: "draw",
            odds: { type: "decimal", value: "3.85" },
            status: "active",
          },
          {
            id: "3",
            name: "Hoftenstain",
            odds: { type: "decimal", value: "3.7" },
            status: "active",
          },
        ],
      },
    ],
  };
}

async function getDataEvent(args) {
  // Here fetch data from your data source and return it
  return {};
}

function transformDataEvent(data) {
  // Here transform your data into data structure exemplified by the object below.
  /*
  // Illustration how data transformation might work from client data to Adapter types
  return {
    event: {
      id: data.event,
      date: {
        displayValue: data.displayTime,
        startTime: data.dateTime,
      },
      sport: {
        id: data.sport.id,
        name: data.sport.name,
      },
      category: {
        id: data.category.id,
        name: data.category.country,
      },
      tournament: {
        id: data.tournament.id,
        name: data.tournament.name,
      },
      teams: data.teams.map((team) => {id: team.id, name: team.name}),
      isLive: data.isLive,
    },
  }; 
  
  */
  return {
    event: {
      id: args.selection.event,
      date: {
        displayValue: "14/01/26, 19:30",
        startTime: "2026-01-14T19:30:00.000Z",
      },
      sport: {
        id: "1",
        name: "Soccer",
      },
      category: {
        id: "30",
        name: "Germany",
      },
      tournament: {
        id: "42",
        name: "Liga Supreme",
      },
      teams: [
        { id: "1270229", name: "Tenhaisen" },
        { id: "31531", name: "Hoftenstain" },
      ],
      isLive: false,
    },
  };
}

async function getDataFilterMarkets(args) {
  // Here fetch data from your data source and return it
  return {};
}

function transformDataFilterMarkets(data) {
  // Here transform your data into data structure exemplified by the object below.
  /*
  // Illustration how data transformation might work from client data to Adapter types
  return {
    selection: data.selection.map((market) => {type: market.type, event: market.event, market: market.id})
  }
  */
  return {
    selection: [
      {
        type: "uf",
        event: "61513908",
        market: "1",
      },
    ],
  };
}

async function getDataBetSlipSelection(args) {
  // Here fetch data from your data source and return it
  return {};
}

function transformDataBetSlipSelection(data) {
  // Here transform your data into data structure exemplified by the object below.
  /*
  // Illustration how data transformation might work from client data to Adapter types
  return {
    selection: data.selection.map((market) => {event: market.event, market: market.market, outcome: market.outcome, type: market.type}),
  };
  */

  return {
    selection: [
      {
        event: "61513908",
        market: "1",
        outcome: "1",
        type: "uf",
      },
    ],
  };
}

async function getDataCashBackSelections(args) {
  // Here fetch data from your data source and return it
  return {};
}

function transformDataCashBackSelections(data) {
  // Here transform your data into data structure exemplified by the object below.
  /*
  // Illustration how data transformation might work from client data to Adapter types
  return {
    events: data.events.map((event) => {event: event.id, type: event.type}),
  }
  */

  return {
    events: [
      {
        event: "56418457",
        type: "uf",
      },
    ],
  };
}

async function getDataTickets(args) {
  // Here fetch data from your data source and return it
  return {};
}

function transformDataTickets(data) {
  // Here transform your data into data structure exemplified by the object below.
  /*
  // Illustration how data transformation might work from client data to Adapter types
  return {
    tickets: data.tickets.map((ticket) => {
      ticketId: ticket.id,
      bets: ticket.bets.map((bet) => {
        betId: bet.id,
        selections: bet.selections.map((selection) => {
          type: selection.type,
          eventId: selection.eventId,
          marketId: selection.marketId,
          outcomeId: selection.outcomeId,
          odds: { type: selection.odds.type, value: selection.odds.value },
        }),
        odds: { type: bet.odds.type, value: bet.odds.value },
        stake: bet.stake.map((stake) => {
          type: stake.type,
          currency: stake.currency,
          amount: stake.amount,
          mode: stake.mode
        }),
      }),
      version: ticket.version,
    }),
  };
  */

  return {
    tickets: [
      {
        ticketId: "ticket_123456",
        bets: [
          {
            betId: "bet_001",
            selections: [
              {
          type: "uf",
          productId: "1",
          eventId: "sr:match:12345",
          marketId: "1",
          outcomeId: "1",
          odds: { type: "decimal", value: "2.10" },
          context: {
            eventName: "Manchester United vs Liverpool",
            marketName: "1x2",
            outcomeName: "Home",
            tournament: "Premier League",
            sportName: "Soccer",
            categoryName: "England",
            isLive: false,
            eventStartTime: "1738519200000",
            sportId: "1"
          }
        }
            ],
            odds: { type: "decimal", value: "2.10" },
            stake: [{
              type: "cash",
              currency: "USD",
              amount: "10.00",
              mode: "total"
            }],
            payout: [{ type: "cash", currency: "USD", amount: "21.00" }]
          }
        ],
        version: "2.0"
      }
    ]
  };
}

async function getDataMatchEventSuggestedSelection(args) {
  // Here fetch data from your data source and return it
  return {};
}

function transformDataMatchEventSuggestedSelection(data) {
  // Here transform your data into data structure exemplified by the object below.
  /*
  // Illustration how data transformation might work from client data to Adapter types
  return {
    selections: data.selections.map((selection) => {
      event: selection.event,
      market: selection.market,
      outcome: selection.outcome,
      type: selection.type,
      specifiers: selection.specifiers
    })
  };
  */

  return {
    selections: [
      { event: "sr:match:12345", market: "1", outcome: "1", type: "uf" },
      { event: "sr:match:12345", market: "18", specifiers: "total=2.5", type: "uf" }
    ]
  };
}

async function getDataRecommendedSelections(args) {
  // Here fetch data from your data source and return it
  return {};
}

function transformDataRecommendedSelections(data) {
  // Here transform your data into data structure exemplified by the object below.
  /*
  // Illustration how data transformation might work from client data to Adapter types
  return {
    selection: data.selections.map((selection) => {
      event: selection.event,
      market: selection.market,
      outcome: selection.outcome,
      type: selection.type,
      specifiers: selection.specifiers
    })
  };
  */

  return {
    selection: [
      { event: "sr:match:12345", market: "1", outcome: "1", type: "uf" },
      { event: "sr:match:67890", market: "18", specifiers: "total=2.5", outcome: "13", type: "uf" }
    ]
  };
}

async function getDataCalculateCustomBetXML(args) {
  // Here fetch data from your data source and return it
  return {};
}

function transformDataCalculateCustomBetXML(data) {
  // Here transform your data into data structure exemplified by the object below.
  /*
  // Illustration how data transformation might work from client data to Adapter types
  return {
    payload: '<xml>data</xml>',
  }
  */
  return {
    payload: `<filtered_calculation_response generated_at="2025-04-16T13:29:08+00:00">
                <calculation odds="27.50303106727931" probability="0.027418715351118873" harmonization="false"/>
                <available_selections>
                  <event id="sr:match:12345678">
                    <markets>
                      <market id="65" specifiers="hcp=0:2" conflict="false">
                        <outcome id="1711" conflict="true"/>
                        <outcome id="1712" conflict="true"/>
                        <outcome id="1713" conflict="false"/>
                      </market>
                      ...
                    </markets>
                  </event>
                </available_selections>
              </filtered_calculation_response>`
  };
}

// -------- Adapter --------

const adapter = {
  config: {},
  endpoints: {
    market: (args, callback) => {
      getDataMarket(args)
        .then(data => transformDataMarket(data))
        .then(result => callback(undefined, result));
      return () => {};
    },

    availableMarketsForEvent: (args, callback) => {
      getDataAvailableMarketsForEvent(args)
        .then(data => transformDataAvailableMarketsForEvent(data))
        .then(result => callback(undefined, result));
      return () => {};
    },

    eventMarkets: (args, callback) => {
      getDataEventMarkets(args)
        .then(data => transformDataEventMarkets(data, args))
        .then(result => callback(undefined, result));
      return () => {};
    },

    event: (args, callback) => {
      getDataEvent(args)
        .then(data => transformDataEvent(data, args))
        .then(result => callback(undefined, result));
      return () => {};
    },

    filterMarkets: (args, callback) => {
      getDataFilterMarkets(args)
        .then(data => transformDataFilterMarkets(data))
        .then(result => callback(undefined, result));
      return () => {};
    },

    betSlipSelection: (args, callback) => {
      getDataBetSlipSelection(args)
        .then(data => transformDataBetSlipSelection(data))
        .then(result => callback(undefined, result));
      return () => {};
    },

    cashBackSelections: (args, callback) => {
      getDataCashBackSelections(args)
        .then(data => transformDataCashBackSelections(data))
        .then(result => callback(undefined, result));
      return () => {};
    },

    tickets: (args, callback) => {
      getDataTickets(args)
        .then(data => transformDataTickets(data))
        .then(result => callback(undefined, result));
      return () => {};
    },

    matchEventSuggestedSelection: (args, callback) => {
      getDataMatchEventSuggestedSelection(args)
        .then(data => transformDataMatchEventSuggestedSelection(data))
        .then(result => callback(undefined, result));
      return () => {};
    },

    recommendedSelections: (args, callback) => {
      getDataRecommendedSelections(args)
        .then(data => transformDataRecommendedSelections(data))
        .then(result => callback(undefined, result));
      return () => {};
    },

    calculateCustomBetXML: (args, callback) => {
      getDataCalculateCustomBetXML(args)
        .then(data => transformDataCalculateCustomBetXML(data))
        .then(result => callback(undefined, result));
      return () => {};
    },
  },
};
</script>
```

### Data Types

The following data types are provided by the adapter and are also available in the `onItemClick` callback payload.

**Event**

| Property                          | Type                | Required | Description                                                      |
| :-------------------------------- | :------------------ | :------- | :--------------------------------------------------------------- |
| `id`                              | `string \| number`  | Yes      | Sportradar event ID.                                             |
| `externalId`                      | `string \| number`  | —        | Client-side event ID.                                            |
| `date`                            | `string`            | Yes      | Formatted date string displayed in the widget.                   |
| `sport.id`                        | `string \| number`  | Yes      | Sport ID. Use `sportsMapping` if not using Sportradar sport IDs. |
| `sport.name`                      | `string`            | Yes      | Sport name.                                                      |
| `category.id`                     | `string \| number`  | —        | Category ID.                                                     |
| `category.name`                   | `string`            | Yes      | Category name (e.g. "England").                                  |
| `tournament.id`                   | `string \| number`  | —        | Tournament/league ID.                                            |
| `tournament.name`                 | `string`            | Yes      | Tournament name.                                                 |
| `teams`                           | `Array<{id, name}>` | Yes      | Home and away competitors.                                       |
| `isLive`                          | `boolean`           | Yes      | Whether the event is currently live.                             |
| `liveCurrentTime`                 | `string`            | Yes      | Live time display (e.g. `"2nd set"`, `"45'"`).                   |
| `result1` / `result2` / `result3` | `result`            | —        | Score columns: `{ result: [homeScore, awayScore] }`.             |

**Market**

| Property          | Type               | Required | Description                                |
| :---------------- | :----------------- | :------- | :----------------------------------------- |
| `id`              | `string \| number` | Yes      | Market ID.                                 |
| `name`            | `string`           | —        | Market name (e.g. `"Match Winner"`).       |
| `status.isActive` | `boolean`          | —        | When `false`, the market is not displayed. |

**Outcome**

| Property          | Type               | Required | Description                                                                        |
| :---------------- | :----------------- | :------- | :--------------------------------------------------------------------------------- |
| `id`              | `string \| number` | Yes      | Outcome ID.                                                                        |
| `name`            | `string`           | Yes      | Outcome name (e.g. `"Home"`, `"Draw"`).                                            |
| `odds`            | `string \| number` | Yes      | Odds value. Use a `number` type to enable odds-change indicators (up/down arrows). |
| `specifier.value` | `string \| number` | —        | Additional specifier (e.g. handicap value `"-2.50"`).                              |
| `status.isActive` | `boolean`          | —        | When `false`, that outcome's selection is disabled.                                |

## Tips

- With `cardsLayout: "horizontal"`, visible cards = cards per row × `maxRows`. Cards per row varies by container width: 1 (< 400px), 2 (400–660px), 3 (660–970px), 4 (970px+).
