Skip to content

Keep your own site navigation in sync with the Sportsbook. The way you do it depends on how you integrated the app — pick your mode below.

Navigation customization sample

In Shadow mode you control navigation directly through the Sportsbook API, so you don't need to build a postMessage bridge:

INFO

NOTE: Subscribing to categorizer data automatically hides the built-in categorizer in the Sportsbook to avoid duplicating it next to your own menu. If you want to keep the Sportsbook's categorizer visible as well, pass isShowCategorizerInSportsbook: true to subscribeOnCategorizerData.

For example, your code may look like this:

javascript
// 1. Initialize the Sportsbook (Shadow mode)
const SportsbookApp = Sportsbook.init({
  host: 'https://APP_URL',
  cid: 'PARTNER_ID',
  // ...other params
});

// 2. Subscribe to categorizer data and build your own menu from it
await window.Sportsbook.subscribeOnCategorizerData({
  host: 'https://APP_URL',
  cid: 'PARTNER_ID',
  sportsbookPath: '/betting', // the path of the page where the Sportsbook is rendered
  onChange: (categorizerData) => {
    renderYourMenu(categorizerData);
  },
});

// 3. Navigate the Sportsbook when a user clicks one of your menu items
function onMenuItemClick(route) {
  SportsbookApp.then((sportsbookInstance) => {
    sportsbookInstance.setRoute(route); // e.g. '/live'
  });
}

INFO

NOTE: In Shadow mode you do not need allowParentUrlUpdate, the setIframePath query parameter, or the routeChange postMessage — the Sportsbook API above replaces them. Those belong to the iFrame approach.