Skip to main content

Events

Example code: Listening to the Event

To listen to the postMessage event in the parent system, you can use the following sample code:

window.addEventListener(
'message',
function (event) {
const { event, data } = event.data;

if (event === 'RedRobinSessionCompleted') {
console.log('Session completed:', data);
// Perform actions such as closing the iframe
}
},
false,
);