Docs
Node SDK

participants.list

Read participants belonging to a room.

Import and client

TypeScript
import { RelayServer } from '@relayrtc/node'
 
const relay = new RelayServer({
  apiUrl: process.env.RELAYRTC_API_URL!,
  apiKey: process.env.RELAYRTC_SECRET_KEY!,
})

Requirements

A secret key with participants:read. The requested resource must belong to that key's project environment.

Parameters

OptionTypeDefault / requirementPurpose
roomIdstringRequiredID of a room in the key's environment.
cursorstringOptionalOpaque endCursor from the previous page.
limitinteger50From 1 to 100.
statusstringOptionalactive or left.

Every method accepts RequestOptions as its final argument.

Example

TypeScript
const roomId = 'room_example'
const result = await relay.participants.list(roomId, { limit: 20, status: 'active' })

Returns

Promise<CursorPage<Participant>>. Returns nodes: Participant[] and pageInfo.

REST equivalent

GET /v1/rooms/{roomId}/participants. Failures throw RelayApiError.