How a Client Connects to VideoSDK
Understand how a VideoSDK client joins a room, which values your backend must provide, and how token permissions control what a participant can do.
Every client SDK follows the same basic connection flow: your server provides a room ID and an access token, and the client uses them to join the room.
What the client needs
A client needs two values before it can join a VideoSDK room:
- A
roomId - An access token
Both should come from your server.
Room ID
A roomId identifies the VideoSDK room the participant should join.
Your server creates the room using the Server SDK or REST API and returns its roomId to the client.
Rooms are reusable. The same roomId can be used across multiple sessions.
For example:
- The first participant joins the room and a new session starts.
- Participants join and leave during the session.
- The session ends when the last participant leaves or it is ended explicitly.
- The same room can be used again for another session later.
For more information about the relationship between rooms and sessions, see Rooms, Sessions, Participants, and Streams.
Access token
An access token authenticates the participant and defines what they are allowed to do in the room.
VideoSDK access tokens are JWTs signed by your server using your API key and secret.
A token can be scoped to a specific:
- Room
- Participant
- Set of permissions
Scoping tokens helps prevent them from being reused outside the context for which they were issued.
How the join flow works
The connection flow is the same across VideoSDK client SDKs.
-
Install the client SDK
Add the VideoSDK SDK for your target platform.
-
Request connection details from your server
Your application requests a
roomIdand access token from your backend. -
Join the room
Pass the room ID and token to the client SDK. You can also configure participant information such as the display name and whether the microphone and camera start enabled.
-
Handle room events
Listen for participant, stream, and connection events so your application can react as the room changes.
-
Leave the room
Call the SDK's leave method when the participant is finished so other connected clients are notified immediately.
For complete client SDK examples, see Join a room from a client.
Token permissions
Your server controls what a participant can do by including the appropriate grants when generating the access token.
VideoSDK evaluates the token when the participant joins the room.
| Grant | Permission |
|---|---|
allow_join | Allows the participant to join the room directly and admit participants waiting to join. |
ask_join | Requires the participant to wait for admission from a participant with allow_join. |
allow_mod | Allows the participant to moderate others, including requesting or disabling microphone and camera access and removing participants. |
allow_join
Use allow_join for participants who should be able to enter the room without waiting for approval.
Participants with this grant can also admit participants who join using ask_join.
ask_join
Use ask_join when a participant should wait for approval before entering the room.
This is useful for workflows such as:
- Waiting rooms
- Interviews
- Virtual appointments
- Moderated sessions
A participant with allow_join must admit them before they can join.
allow_mod
Use allow_mod for hosts or moderators who need to control other participants.
Depending on the client SDK, moderation actions can include:
- Requesting that a participant enable their microphone.
- Requesting that a participant enable their camera.
- Disabling another participant's microphone or camera.
- Removing a participant from the room.
See Participant management for moderation examples.
Token expiration
Access tokens can include an expiration time.
VideoSDK validates the token when the participant joins. If the token expires while the participant is already connected, the active session is not interrupted.
For production applications, use short-lived tokens and generate them from your backend when the client needs to join.
For development and testing, you can generate a temporary token from the VideoSDK dashboard.
For complete token generation and authentication details, see Authentication and tokens.
Recommended client-server flow
A typical application uses the following architecture:
Client
|
| Request room access
v
Your Backend
|
|-- Create or retrieve room
|-- Generate scoped access token
|
| Return roomId + token
v
Client
|
| Join room
v
VideoSDK
Your API key and secret remain on your backend throughout this process. The client receives only the values required to connect.
Next steps
Join a room from a client
Install a client SDK, join using a room ID and token, and handle connection and leave states.
Authentication and tokens
Generate access tokens with the Server SDK or sign JWTs directly from your backend.
Room management
Create, retrieve, validate, list, and manage rooms and sessions from your server.

