Join a Webinar

Webinars are launched and joined in the Web SDK using the ZoomMtg.init() method to launch the SDK, then the ZoomMtg.join() to join the user into the meeting. The join method receives an encrypted signature, your API Key, a webinar ID, and any user settings.

Before joining, remember to prepare the required files and set up a server-side signature function.

Create webinar

For testing, create a webinar in your Zoom client or at https://zoom.us/webinar/schedule to retrieve a Meeting ID and passcode. Advanced applications can also use the Webinars API to create and retrieve meetings. If you already have a webinar ID to join, proceed below.

Create meetConfig Object

To receive user input and webinar settings, create a client-side meetConfig object to pass data to a server-side generateSignature function and the webinar join methods.

Example meetConfig object:

const meetConfig = {
	apiKey: '3239845720934223459'
	meetingNumber: '123456789',
	leaveUrl: 'https://yoursite.com/meetingEnd',
	userName: 'Firstname Lastname',
	userEmail: 'firstname.lastname@yoursite.com', // required
	passWord: 'password', // if required
	role: 0 // 1 for host; 0 for attendee
};

Launch & Join webinar

Pass your meetConfig object to a getSignature function. Make a request to your signature endpoint, then pass that response to call the init method.

In the ZoomMtg.init() method, set any webinar settings (ex: leaveUrl, isSupportAV).

Call the ZoomMtg.join() method as a success param of ZoomMtg.init(). The join() method will handle your signature (as a text string).

index.js
import { ZoomMtg } from '@zoomus/websdk'

// prepare required files
ZoomMtg.preLoadWasm();
ZoomMtg.prepareJssdk();

getSignature(meetConfig) {
	// make a request for a signature
	fetch(`${YOUR_SIGNATURE_ENDPOINT}`, {
			method: 'POST',
			body: JSON.stringify({ meetingData: meetConfig })
		})
		.then(result => result.text())
		.then(response => {
			// call the init method with meeting settings
			ZoomMtg.init({
				leaveUrl: meetConfig.leaveUrl,
				isSupportAV: true,
				// on success, call the join method
				success: function() {	
					ZoomMtg.join({
						// pass your signature response in the join method
						signature: response,
						apiKey: meetConfig.apiKey,
						meetingNumber: meetConfig.meetingNumber,
						userName: meetConfig.userName,
						passWord: meetConfig.passWord,
						// on success, get the attendee list and verify the current user
						success: function (res) {
            console.log("join meeting success");
            console.log("get attendee list");
            ZoomMtg.getAttendeeslist({});
            ZoomMtg.getCurrentUser({
              success: function (res) {
                console.log("success getCurrentUser", res.result.currentUser);
              },
            });
          },
error: function (res) {
            console.log(res);
          },
					})		
				}
			})
	}
}

Set this function to launch within your application, for example, on a “Join Webinar” button.

Joining webinars with registration required

As of version 1.8.0 and higher, the Web SDK can be used to join webinars with registration required. After successfully joining the webinar (see above), a registration dialog screen will display, prompting the user to register for the webinar.

After registering, the user will then join by clicking “Join Webinar in Progress”.

Join registered webinar

Web SDK v1.9.6 and above supports the webinar registration feature using the registration token denoted by the tk value in the query parameter. This feature enables users to join registered webinars automatically. Your app handles the join process automatically using the registration token retrieved via the Zoom API.

Automatically join registered webinar

Attendees and panelists can join registered webinars using a registration token, which is the value of the tk query parameter in the registrant’s join_url:

"join_url": "https://example.zoom.us/w/12345?tk=TOKEN"

To get a registrant’s token and join the webinar:

  1. Call Add a webinar registrant, List webinar registrants, or Update registrant’s status.
  2. Get the tk value from the response:
{
   "registrant_id": "ESJWWYqvTDWFGNUqJzB_bQ",
   "id": 96231721187,
   "topic": "My Registered websdk Webinar",
   "start_time": "2021-05-31T14:00:00Z",
   "join_url": "https://example.zoom.us/w/12345?tk=JtbsW3pp3KxPLLrE_y7-968kggkV7R5czHM9c0tVvgpM.DQIAAAAWZ9uI4xZFU0pXV1lxdlREV0ZHTlVxSnpCX2JRAzzzzzz&pwd=Ri0TkdxhXeWRUOITyT3ZDZmOOOGwxQT09&uuid=XX_pII1ZlzIQ42xx3zA2zYrrU"
}

// Example in JavaScript
var registrantToken = new URL(response.join_url).searchParams.get("tk")

// JtbsW3pp3KxPLLrE_y7-968kggkV7R5czHM9c0tVvgpM.DQIAAAAWZ9uI4xZFU0pXV1lxdlREV0ZHTlVxSnpCX2JRAzzzzzz
  1. Set the registrant token as the value for tk in ZoomMtg.join:
ZoomMtg.join({
         meetingNumber: meetingConfig.meetingNumber,
         userName: meetingConfig.userName,
         signature: signature,
         apiKey: meetingConfig.apiKey,
         userEmail: meetingConfig.userEmail,
         passWord: meetingConfig.passWord,
         tk: registrantToken, //JtbsW3pp3KxPLLrE_y7-968kggkV7R5czHM9c0tVvgpM.DQIAAAAWZ9uI4xZFU0pXV1lxdlREV0ZHTlVxSnpCX2JRAzzzzzz
         success: function (res) {
           console.log("join meeting success");
           console.log("get attendeelist");
           ZoomMtg.getAttendeeslist({});
           ZoomMtg.showPureSharingContent({
             show: true
            });
           ZoomMtg.getCurrentUser({
             success: function (res) {
               console.log("success getCurrentUser", res.result.currentUser);
             },
           });
         },
         error: function (res) {
           console.log(res);
         },
       });

Also supported by tk parameter

The tk parameter also supports:

  • Joining automatically-approved registered webinars.
  • Webinar registration using the tk parameter.
  • Panelists can join Webinar in Practice mode.
  • Automatically joining a webinar as a panelist.
Best practice

When panelists join webinars automatically using the tk parameter, they should use their email in addition to the tk parameter to join.