Reference / @getenginex/sdk-igaming/first-frame / FirstFrame
FirstFrame
Connection to the FIRST iframe.
Methods
dispose()
dispose():
void
Removes the listener. Idempotent; after that nothing is delivered and send throws.
Returns
void
send()
send(
eventType,eventData?):void
Sends an event to the iframe: postMessage(JSON.stringify({ eventType, eventData }), origin), with the origin of the src (never '*'). Wait for onReady before sending: FIRST only listens after loading. Events FIRST understands: sportId, leagueId, eventId ({ value: id }), liveBetting, home ({ value: true }), betting-history, open-bets, expand-bet-slip ({ value: boolean }), bscode ({ value: code }) and shareBetslip ({ url }).
Parameters
eventType
string
eventData?
unknown
Returns
void
Example
frame.send('sportId', { value: '66' })Throws
CONFIGURATION_ERROR if the src has no valid http(s) origin, if the iframe has no contentWindow or after dispose().