participants.list
Read participants belonging to a room.
Import and client
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
| Option | Type | Default / requirement | Purpose |
|---|---|---|---|
| roomId | string | Required | ID of a room in the key's environment. |
| cursor | string | Optional | Opaque endCursor from the previous page. |
| limit | integer | 50 | From 1 to 100. |
| status | string | Optional | active or left. |
Every method accepts RequestOptions as its final argument.
Example
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.