Building a custom video experience is more than just connecting users to a session. Developers must also ensure that only authorized users can join and that participants receive the appropriate permissions.
The Zoom Video SDK enables developers to integrate video, audio, screen sharing, and other real-time communication features directly into web applications.
But how do you securely authenticate users and control their roles?
Let’s explore how to implement server-side authentication using Node.js and manage participant permissions with the Zoom Video SDK.
Unlike traditional Zoom Meetings, the Zoom Video SDK allows developers to create fully customized video experiences within their own applications.
To start or join a Video SDK session, users need a JSON Web Token (JWT) generated using their application’s Video SDK credentials.
The JWT contains essential information, including:
Important: JWTs should always be generated on a secure backend. Exposing the Video SDK Secret in frontend code creates a serious security risk.
Let’s look at a simple Node.js implementation using the jsonwebtoken library.
First, install the dependency:
npm install jsonwebtoken
Next, create a function that generates a JWT:
import jwt from 'jsonwebtoken';
function generateToken(sessionName, isHost) {
const now = Math.floor(Date.now() / 1000);
const payload = {
app_key: process.env.ZOOM_VIDEO_SDK_KEY,
tpc: sessionName,
role_type: isHost ? 1 : 0,
version: 1,
iat: now,
exp: now + 3600
};
return jwt.sign(
payload,
process.env.ZOOM_VIDEO_SDK_SECRET,
{ algorithm: 'HS256' }
);
}
This function creates a JWT valid for one hour.
The isHost value must be determined by your backend after authenticating the user and checking their permissions, rather than trusting a value submitted by the browser.
In a production application, expose this function through a protected API endpoint that verifies the user’s identity and session membership before returning the token.
Once the backend generates the token, the web application can use it to join a session.
Install the Zoom Video SDK:
npm install @zoom/videosdk
Initialize the SDK and connect:
import ZoomVideo from '@zoom/videosdk';
const client = ZoomVideo.createClient();
await client.init('en-US', 'Global', {
patchJsMedia: true
});
// Token returned by your authenticated backend
await client.join(
'TeamSession',
token,
'John Doe',
'sessionPasscode'
);
The session name must match the tpc value inside the JWT. A session passcode is optional, but must match if the session uses one.
After joining, developers can implement features such as video streaming, audio controls, and participant management.
The Zoom Video SDK supports different permission levels through its role system.
| Role | JWT Value | Capabilities |
|---|---|---|
| Host | role_type: 1 |
Can start and manage sessions, remove participants, and assign management privileges. |
| Participant | role_type: 0 |
Can join and participate in sessions with limited administrative privileges. |
A session host can also assign manager (co-host) privileges to other participants.
For example, in a virtual coaching application, coaches may receive host privileges while members join as participants.
This allows developers to create controlled experiences without giving every participant administrative access.
Before deploying your integration, consider these essential security measures:
A secure implementation should also use HTTPS, authenticate its token endpoint, and avoid logging sensitive JWTs.
Secure authentication and participant management are essential foundations for reliable, scalable video applications.
With 6+ years of Zoom expertise, access to specialized Zoom APIs, and direct collaboration with Zoom developers, Codimite helps businesses build custom Zoom-powered solutions tailored to their requirements.
Whether you’re developing a virtual coaching platform, customer engagement solution, or embedded video application, the right authentication architecture is a critical first step.
Looking to build a custom video experience with Zoom? Connect with Codimite to explore your integration requirements.