Skip to content

Dynamic integration (white-label)

For white-label platforms with many operators, domains and menus. Everything here works with the SDK (recommended) or a plain iframe plus postMessage. Needs SDK 1.3.0 (/embed/v1.js serves it; 1.3.1 adds the competition_unavailable error code).

Section titled “1. Share links on the operator’s domain (host_url)”

Pass the page of your site that mounts the sportsbook. Every shared bet (copy link, WhatsApp, Telegram, the device’s share sheet) then points at it:

const sb = OrbiSportbook.mount('#sportsbook', {
url: 'https://<sportsbook>',
tenant: '<your tenant>',
launchToken,
hostUrl: 'https://mysite.com/sports', // or 'page': this page's address without its query
});

A shared bet: https://mysite.com/sports?bet_code=K7M3Q9XT. Every channel uses that link, with the share_params: copy link, WhatsApp, Telegram and the device’s share sheet; the bet’s image shows the host_url’s domain, and the share event carries each channel’s exact link. When someone opens it, the SDK reads bet_code from your page and the sportsbook opens the bet (its selections, re-priced, ready for the slip). Without the SDK, read bet_code yourself and pass ?bet_code=K7M3Q9XT (or path=/share/K7M3Q9XT) in the iframe URL, or send open_bet_slip.

Security. host_url is used only when its origin is the framing page’s, one of your embed origins, or your back-office Share URL’s; https only (http on localhost/*.test). Anything else answers invalid_host_url and shared links keep the last valid host (or the default page when there was none): an updateContext with a refused host never drops the one in use, so nobody can frame the sportsbook to send your players to another domain.

Plain iframe: ?host_url=https%3A%2F%2Fmysite.com%2Fsports.

Any public attribute (affiliate, UTMs, A/B/C tests, campaigns): there is no fixed list.

OrbiSportbook.mount('#sportsbook', {
// ...
hostUrl: 'https://mysite.com/sports',
shareParams: { ref: 'affiliate123', utm_source: 'facebook', utm_medium: 'paid_social', experiment: 'checkout_v2', variant: 'B' },
});

Shared bet: https://mysite.com/sports?bet_code=K7M3Q9XT&ref=affiliate123&utm_source=facebook&utm_medium=paid_social&experiment=checkout_v2&variant=B. Plain iframe: share_params, the JSON object URL-encoded.

  • Values: text, numbers or booleans (as text), up to 256 characters; up to 30 parameters; keys of letters, digits and _ - . [ ].
  • Always dropped (no error): private keys (token, session, auth, secret, password, signature/sig, api_key, jwt, otp, cookie, email, phone, cpf, cnpj, card, user_id, player_id, external_id…), the sportsbook’s own keys (tenant, launch, path, bet_code, link, locale, currency…) and values that look like an e-mail or a JWT.
  • A parameter your host_url already has keeps its value.
  • Without host_url they are added to the default share link (/s/CODE?ref=…&utm_…), and that link’s redirect to the brand’s Share URL passes them all on (a parameter the Share URL sets keeps its value; the link’s ref never replaces the code’s affiliate and travels only when it is a valid id).

Persistence. host_url and share_params live in the iframe’s own address: they hold across every page of the sportsbook and survive a reload of the iframe. Change them live with sb.updateContext({ hostUrl?, shareParams? }) (a field left out keeps its value, null clears it; a refused hostUrl answers invalid_host_url and keeps the previous host, while shareParams sent with it still apply).

Route Opens
/ Home
/live, /live/{sportId} In-play, all sports or one
/sport/{sportId} A sport
/competition/{competitionId} A competition
/event/{eventId} A match
/event/{eventId}?market={marketId} A match, opened on a market
/my-bets My bets
/share/{code} A shared bet

Sports: football, basketball, tennis, volleyball, american_football, ice_hockey, baseball, rugby_union, handball, darts, aussie_rules, cricket, boxing, badminton.

Stable competition aliases: brasileirao-serie-a, brasileirao-serie-b, brasileirao-serie-c, premier-league, la-liga, serie-a-italia, bundesliga, champions-league (e.g. /competition/brasileirao-serie-a). Other ids: GET /api/v1/sports/{sportId}/competitions, GET /api/v1/events?sport=&competition= and GET /api/v1/events/{eventId} (markets[].id), with X-Tenant-ID.

A competition with no matches (out of season, say) shows “No matches of this competition are on offer right now” with a link to the sport, and the sportsbook emits the competition_unavailable error once per competition: use it to hide or grey out your menu entry.

  • From your page’s address: https://mysite.com/sports?link=/competition/brasileirao-serie-a. The SDK reads link (rename with linkParam, false turns it off). Order: an explicit path, then bet_code, then link, then a widget click (ob_path).
  • Once loaded, without a reload or a new session: sb.navigate(path), sb.openBetSlip(code). Anything that is not a route answers invalid_path; no external URL is ever followed.
  • Following the player: route events carry url, the same page on your site (host_url?link=<path>&<share params>), when a host URL is set. A match opened on a market keeps it (path is /event/{id}?market={marketId}), so copying or reloading the url lands on the same market.
Type Direction Payload SDK
ready iframe → page features lists update_context, open_bet_slip, share_event onReady
route iframe → page { path, title, url? } onRouteChange
share iframe → page { code, url, channel }: created, copy_code, copy_link, whatsapp, telegram, native, image onShare
navigate page → iframe { path } sb.navigate()
open_bet_slip page → iframe { code } sb.openBetSlip()
update_context page → iframe { hostUrl?, shareParams? } sb.updateContext()

Origin rules are the protocol’s: only the verified parent origin, never '*'.

To create shared bets automatically (tips, signals, per-affiliate campaigns), use the aggregator API: POST /api/v1/aggregator/clients/{id}/shares takes the selections, the brand’s hostUrl and each affiliate’s shareParams (ref, UTMs…) and returns the code and both links. Each brand’s shareUrl (the default link’s landing) is set through the API too, on POST and PATCH /clients/{id}.

Unchanged: the launch token works the same when a player lands on a competition, match, market or shared bet. It is consumed and removed from the iframe’s address; host_url and share_params stay.