Sessions
A session is one live occupancy of a room, from the first join to the end. A room has many sessions over time. Use the sessions resource for both live and past sessions.
For a room's current participants, participants is a shortcut that resolves the active session for you.
List sessions
- Node.js
- Go
const sessions = await client.sessions.list({ roomId, status: "ended" });
for await (const session of sessions) {
console.log(session.id, session.start, session.end);
}
for session, err := range client.Sessions.ListAutoPaging(ctx, videosdk.SessionListParams{
RoomID: videosdk.String(roomID),
Status: videosdk.Ptr(videosdk.SessionEnded),
}) {
if err != nil {
return err
}
fmt.Println(session.ID, session.Start, session.End)
}
Filters: query, roomId, customRoomId, userId, startDate / endDate (epoch ms), status (ongoing or ended), plus pagination.
Get a session
- Node.js
- Go
const session = await client.sessions.get("session_abc123");
session, err := client.Sessions.Get(ctx, "session_abc123")
List participants
Includes participants who have already left. Use listActiveParticipants / ListActiveParticipants for only those connected, or getParticipant / GetParticipant for one.
- Node.js
- Go
const participants = await client.sessions.listParticipants("session_abc123");
participants, err := client.Sessions.ListParticipants(ctx, "session_abc123", videosdk.ListParams{})
End a session
Requires roomId or meetingId.
- Node.js
- Go
await client.sessions.end({ roomId, force: true });
session, err := client.Sessions.End(ctx, videosdk.SessionEndParams{
RoomID: videosdk.String(roomID),
Force: videosdk.Bool(true),
})
Options: roomId / meetingId (one required), sessionId, force, ignoreClosed.
Remove a participant
Requires roomId or sessionId.
- Node.js
- Go
await client.sessions.removeParticipant({ participantId: "participant-alice", roomId });
msg, err := client.Sessions.RemoveParticipant(ctx, videosdk.SessionRemoveParticipantParams{
ParticipantID: "participant-alice",
RoomID: videosdk.String(roomID),
})
Statistics
Quality-of-service stats for a session or a single participant.
- Node.js
- Go
await client.sessions.getStats("session_abc123");
await client.sessions.getParticipantStats("session_abc123", "participant-alice");
client.Sessions.GetStats(ctx, "session_abc123")
client.Sessions.GetParticipantStats(ctx, "session_abc123", "participant-alice")
Objects
A session has id, roomId, customRoomId, start, end, status, region, and (where embedded) participants. A participant has participantId, name, and timelog (join/leave intervals).
Got a Question? Ask us on discord

