Docs
Node SDK

Node SDK

Administer RelayRTC rooms and resources from a Node.js server.

Install

Shell
pnpm add @relayrtc/node

The package requires Node.js 22 or newer. See installation for setup instructions.

Create a client

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

Use a secret API key. The client normalizes the API URL to include /v1.

Create a room and token

TypeScript
const room = await relay.rooms.create({ name: 'Team call' })
const issued = await relay.tokens.create(room.id, {
  participantName: 'Alice',
  permissions: ['room:join', 'audio:publish', 'video:publish'],
})

Send issued.token to that authenticated user. The browser joins with the React or browser SDK.

Resources

Client resourcePurpose
context()Read API key context.
roomsCreate, list, read and end rooms; inspect cleanup.
tokensIssue participant tokens.
participantsList, read, remove and inspect cleanup.
turnCreate temporary TURN credentials.
usageRead public usage categories.
webhooksManage endpoints and signing secrets.
webhooks.deliveriesRead delivery logs and replay.

The Node SDK does not capture a camera or join a media call. It wraps the public management REST API.

Request behavior

Successful data objects are returned directly. Errors throw RelayApiError.

Only GET requests retry automatically. Create, update, delete, secret rotation and replay requests are attempted once.

See RelayServer options and request options.