# Event handling zoom UIKit React

**URL:** <https://devforum.zoom.us/t/event-handling-zoom-uikit-react/130193>\
**Category:** Video SDK\
**Created:** [March 20, 2025, 7:31am UTC](https://devforum.zoom.us/t/event-handling-zoom-uikit-react/130193 "2025-03-20T07:31:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gireesh.ks](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/gireesh.ks/32/48293_2.png) [@gireesh.ks](https://devforum.zoom.us/u/gireesh.ks)\
**Post date:** [March 20, 2025, 7:31am UTC](https://devforum.zoom.us/t/event-handling-zoom-uikit-react/130193/1 "2025-03-20T07:31:33Z")

</div>

### Before Creating a New Topic:

_If you’re experiencing unexpected Video SDK behavior please search the forum with relevant keywords (e.x. error message) and follow the guidance outlined in those posts. Please also leverage the following support links:_

- Zoom Developer Changelog for Dev Product Changes: [https://marketplace.zoom.us/docs/guides/stay-up-to-date/changelog/](https://marketplace.zoom.us/docs/guides/stay-up-to-date/changelog/)
- General Troubleshooting: [Support](https://devsupport.zoom.us/hc/en-us)
- To Submit a Ticket for Unexpected Video SDK Behavior: [Official Zoom Support | Help Center](https://support.zoom.us/hc/en-us)
- For General & Integrations Related Guidance: [https://community.zoom.com/](https://community.zoom.com/)

* * *

**Description**  
I am using Zoom UIKit to integrate Zoom video sessions into my application. I need to detect when a user joins or leaves the session.

Is there any built-in event listener or callback in Zoom UIKit that provides these events? If not, what would be the recommended approach to track user presence in the session?

Any guidance or sample code would be greatly appreciated.

Thanks!

---

<div class="post-metadata">

**Author:** ![ekaansh.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/ekaansh.zoom/32/55004_2.png) [@ekaansh.zoom](https://devforum.zoom.us/u/ekaansh.zoom)\
**Post date:** [March 20, 2025, 9:39am UTC](https://devforum.zoom.us/t/event-handling-zoom-uikit-react/130193/2 "2025-03-20T09:39:46Z")

</div>

Hi @gireesh.ks the UITookit has events for:

| Event Listener | Description |
| --- | --- |
| onSessionJoined | Fires when the user joins the session successfully. |
| onSessionClosed | Fires when a user leaves a session or it ends. |
| offSessionJoined | Unsubscribes to the onSessionJoined event. |
| offSessionClosed | Unsubscribes to the onSessionClosed event. |

You can set up a listener for session join as:

```js
const sessionJoined = () => {
  console.log("session joined");
};

uitoolkit.onSessionJoined(sessionJoined);

// clean up
uitoolkit.offSessionJoined(sessionJoined);

```

Same for `onSessionClosed`.

---

<div class="post-metadata">

**Author:** ![gireesh.ks](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/gireesh.ks/32/48293_2.png) [@gireesh.ks](https://devforum.zoom.us/u/gireesh.ks)\
**Post date:** [April 11, 2025, 4:08am UTC](https://devforum.zoom.us/t/event-handling-zoom-uikit-react/130193/3 "2025-04-11T04:08:17Z")

</div>

**Thank you for the response.**  
We have already implemented handlers for these events. However, when the browser’s back button is clicked, the session does not disconnect, and other participants can still see and hear the user. Similarly, when the browser is refreshed, the session isn’t properly handled, leading to unexpected behavior.

Could you please advise on how to properly manage session disconnection and cleanup during browser navigation (back/forward) or page refresh?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [April 29, 2025, 3:34pm UTC](https://devforum.zoom.us/t/event-handling-zoom-uikit-react/130193/4 "2025-04-29T15:34:38Z")

</div>

Closed on April 29, 2025, 3:34pm UTC

This topic was automatically closed 25 hours after the last reply. New replies are no longer allowed.
