Get when any user leave the room

Hello, i start my room like this…

script
const domain = ‘meet.jit.si’;
const options = {
roomName: “myRoomName”,
width: ‘100%’,
height: ‘100%’,
configOverwrite: { startWithAudioMuted: false },
parentNode: document.querySelector(’#meet’)
};
const api = new JitsiMeetExternalAPI(domain, options);
/script

Now how can i modify it to get the event of “user exit” ?

script
if (userExit = 1) {
alert(“byebye”
}
/script

Thanks