Own UI

Concept: Betslip

When your application already has a betslip, set mode: 'EXTERNAL' and drive selections from overlay events. Do not provide onPlaceBet.

After your sportsbook API accepts or rejects a bet, call embet.notifyBetPlaced so the SDK receives the same outcomes as an embedded onPlaceBet return (success and error codes).

Configuration and events

await embet.init({ clientId: 'YOUR_CLIENT_ID' });

embet.betSlipConfig({
  mode: 'EXTERNAL',
  currency: '€',
  currencyDisplay: 'prefix',
  decimalSign: ',',
  maxAmount: 1000,
});

embet.eventManager(({ eventName, payload }) => {
  if (eventName === 'outcome_selected') {
    addSelectionToHostBetslip(payload);
  }
});

Render your betslip outside <embet-overlay>. When the user confirms in your UI, call your sportsbook API, then notify the SDK:

async function onHostPlaceBet({ marketId, outcomeId, stake }) {
  const result = await placeBetWithYourSportsbook(/* ... */);

  if (result.accepted) {
    embet.notifyBetPlaced({
      marketId,
      outcomeId,
      stake,
      betResult: 'success',
    });
    return;
  }

  embet.notifyBetPlaced({
    marketId,
    outcomeId,
    stake,
    betResult: 'failed',
    error: result.errorCode, // same codes as embedded onPlaceBet
  });
}

notifyBetPlaced payload

FieldDescription
marketId, outcomeIdSelection from outcome_selected (must match your updateOdds feed).
stakeAmount the user placed in your betslip.
betResult'success' or 'failed'.
errorWhen betResult is 'failed': 'insufficientFunds', 'oddsChanged', 'betSuspended', or 'undefined' — same as embedded onPlaceBet errors.

Full error semantics: Betslip (feature).

Event reference: Event manager · Web — Event manager.

End-to-end sample: Recipe — Own UI betslip.