The PL modal will emit events on initialization and shutdown.
The following example shows how to listen and respond to the modal's events.
window.addEventListener("message", (event) => {
if (event.data.source === 'lcly_pl') {
if (event.data.payload.name === 'init') {
console.log('lcly_init')
}
else if (event.data.payload.name === 'shutdown') {
console.log('lcly_shutdown')
}
}
});