# I want to listen event in webSdk!

**URL:** <https://devforum.zoom.us/t/i-want-to-listen-event-in-websdk/97914>\
**Category:** Web\
**Created:** [November 6, 2023, 10:01am UTC](https://devforum.zoom.us/t/i-want-to-listen-event-in-websdk/97914 "2023-11-06T10:01:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ashishdwivediw](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/ashishdwivediw/32/49346_2.png) [@ashishdwivediw](https://devforum.zoom.us/u/ashishdwivediw)\
**Post date:** [November 6, 2023, 10:01am UTC](https://devforum.zoom.us/t/i-want-to-listen-event-in-websdk/97914/1 "2023-11-06T10:01:01Z")

</div>

I am using a server-to-server app to create meetings and a meeting SDK to display them. Now, I want to listen to some events like ‘onUserLeave,’ and I also want to use some APIs for reporting or recording details. How can I achieve this?

---

<div class="post-metadata">

**Author:** ![elisa.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/elisa.zoom/32/47836_2.png) [@elisa.zoom](https://devforum.zoom.us/u/elisa.zoom)\
**Post date:** [November 6, 2023, 10:46pm UTC](https://devforum.zoom.us/t/i-want-to-listen-event-in-websdk/97914/2 "2023-11-06T22:46:20Z")

</div>

Hi @ashishdwivediw  
you are on the right track  
You can listen to those events using the meeting SDK app you have to display the meeting and you can either use the meeting SDK oauth credentials to generate accees tokens and display reporting or recording details or you could also use the server to server oauth app used to create the meetings to generate access tokens to access report and recording endpoints

---

<div class="post-metadata">

**Author:** ![jenzushsu](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jenzushsu/32/34251_2.png) [@jenzushsu](https://devforum.zoom.us/u/jenzushsu)\
**Post date:** [November 7, 2023, 5:44am UTC](https://devforum.zoom.us/t/i-want-to-listen-event-in-websdk/97914/3 "2023-11-07T05:44:13Z")

</div>

Hi @ashishdwivediw,

Expanding on the use of Meeting SDK, you can refer to the SDK documentation where there is a list of Listener Functions available. This is the link for Client view [ZoomMtg | Zoom Meeting SDK for Web - 2.17.0](https://marketplacefront.zoom.us/sdk/meeting/web/modules/ZoomMtg.html#inMeetingServiceListener)

---

<div class="post-metadata">

**Author:** ![ashishdwivediw](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/ashishdwivediw/32/49346_2.png) [@ashishdwivediw](https://devforum.zoom.us/u/ashishdwivediw)\
**Post date:** [November 7, 2023, 7:03am UTC](https://devforum.zoom.us/t/i-want-to-listen-event-in-websdk/97914/4 "2023-11-07T07:03:49Z")

</div>

I am using ZoomMtgEmbedded, and after reading the documentation, it is unclear where I should place this function

```auto
ZoomMtg.inMeetingServiceListener('onMeetingStatus', function (data) {
// {status: 1(connecting), 2(connected), 3(disconnected), 4(reconnecting)}
console.log(data);
});

```

This is my code for users to join. If you could point out where to place these events, or if you have some GitHub examples to share, that would be helpful.

```auto
const client = ZoomMtgEmbedded.createClient();

    
     var authEndpoint = `${process.env.REACT_APP_BASE_URL}/api/v1/zoom/authEndpoint`
     var sdkKey = `${process.env.ZOOM_MEETING_SDK_KEY}`
    // var meetingNumber = zoomData.id
    // var passWord = zoomData.password
     var role = 0
     var userName = ''
     var userEmail = ''
     var registrantToken = ''  
     var zakToken = ''
    
     function getSignature(zoomData) {
      
    
      fetch(authEndpoint, {
       method: 'POST',
       headers: { 'Content-Type': 'application/json' },
       body: JSON.stringify({
        meetingNumber: zoomData.id,
        role: role
       })
      }).then(res => res.json())
      .then(response => {
       startMeeting(response.Data, zoomData)
       console.log(response,"aaaaaaaaaa")
      }).catch(error => {
       console.error(error,"AAAAAA")
      })
     }
    
     function startMeeting(signature, zoomData) {
    
      let meetingSDKElement = document.getElementById('meetingSDKElement');
    
      client.init({
       debug: true,
       zoomAppRoot: meetingSDKElement,
       language: 'en-US',
       customize: {
        meetingInfo: ['topic', 'host', 'mn', 'pwd', 'telPwd', 'invite', 'participant', 'dc', 'enctype'],
        toolbar: {
         buttons: [
          {
           text: 'Custom Button',
           className: 'CustomButton',
           onClick: () => {
            console.log('custom button');
           }
          }
         ]
        }
       }
      });
    
      client.join({
       signature: signature,
       sdkKey: sdkKey,
       meetingNumber: zoomData.id,
       password: zoomData.password,
       userName: userName,
       userEmail: userEmail,
       tk: registrantToken,
       zak: zakToken
      })
     }

```

---

<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:** [December 7, 2023, 5:04pm UTC](https://devforum.zoom.us/t/i-want-to-listen-event-in-websdk/97914/5 "2023-12-07T17:04:19Z")

</div>

Closed on December 7, 2023, 5:04pm UTC

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