To add Player Prop Zone selections to your bet slip and keep the widget’s selection state in sync (e.g. show selected/locked state), use the adapter’s betSlipSelection endpoint and handle AddSelectionsToBetSlip in the widget’s onAction callback.
After receiving a selection, re-validate availability and fetch authoritative odds from your platform before adding to the bet slip. See Handling Selections and Odds for the full flow.
// Bet slip state
let betslipCallback;
let betslipState = [];
SIR('registerAdapter', '{ADAPTER_NAME}', {
config: {},
endpoints: {
betSlipSelection: (args, callback) => {
// Always store the latest callback
betslipCallback = callback;
betslipCallback && betslipCallback(undefined, { selection: betslipState });
// Return an unsubscribe function for cleanup
return () => {
betslipCallback = undefined;
};
},
},
});
SIR('addWidget', '#sr-widget', 'match.playerPropZone', {
matchId: 'sr:match:61301097',
onAction: (event) => {
// Only handle bet slip selections
if (event.type === 'AddSelectionsToBetSlip') {
// Append new selections to the bet slip
betslipState.push(...event.data.selections);
// Notify the widget about the updated bet slip
betslipCallback && betslipCallback(undefined, {
selection: betslipState
});
}
},
});Summary:
betSlipSelection – The adapter exposes this endpoint. The widget calls it to subscribe to bet slip state. Your implementation should invoke the provided callback with the current selection (e.g. { selection: betslipState }) and return an unsubscribe function for cleanup.onAction – In the handler, listen for event.type === 'AddSelectionsToBetSlip', append event.data.selections to your bet slip state, then call the stored betslipCallback with the updated state so the widget can reflect selected/locked state.For general widget options and theming, see Player Prop Zone and Player Prop Zone – Theming customization.