I want to listen event in webSdk!

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?

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

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

1 Like

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

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.

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
      })
     }

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