Docs
Node SDK

rooms.list

List rooms in the key's environment.

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 rooms:read. The requested resource must belong to that key's project environment.

Parameters

OptionTypeDefault / requirementPurpose
cursorstringOptionalOpaque endCursor from the previous page.
limitinteger50From 1 to 100.
statusstringOptionalcreated, active, ending, ended or failed.

Every method accepts RequestOptions as its final argument.

Example

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

Returns

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

REST equivalent

GET /v1/rooms. Failures throw RelayApiError.