Advanced integration

Single-page apps and JavaScript

Widgets pick up containers added to or removed from the page. In React, Vue and similar you can also call:

const el = document.querySelector("#lineups");
el.dataset.matchId = "fm_xxxxxxxxxxxx";
await window.SportxWidgets.mount(el);
// ...
window.SportxWidgets.destroy(el);

Security and CSP

  • Only registered domains can read the data; other pages show a widget loading error.
  • If your site sends a Content-Security-Policy, allow our domain in script-src, style-src and connect-src; team logos come from several hosts, so img-src needs https:.
  • Widgets set no cookies and send no information about your users.
Content-Security-Policy: script-src 'self' https://bbidt.name; style-src 'self' https://bbidt.name; connect-src 'self' https://bbidt.name; img-src 'self' https: