JAVASCRIPT / TYPESCRIPT

Web SDK

Use the browser SDK for room chat and real-time calls in modern WebRTC-capable browsers.

Before you start

Authenticate the user in your own backend, decide whether they may enter the room, and request a short-lived RTC token. The client receives that token and never receives the App Secret.

Install

The web package is not published on public npm yet. Download the starter and follow the voice calling tutorial; it includes local SDK packages.

# Download and extract the voice starter linked below first.
npm install
npm run dev

Initialize and join a room

import { RTCExpress } from "@rtc/sdk";

const rtc = new RTCExpress();
await rtc.init({ serverUrl, appId, userId, token, mediaMode: "auto" });
rtc.on("roomJoined", () => rtc.sendMessage("Hello"));
rtc.joinRoom("support-room-42");

Production notes

Keep authorization on your serverUse HTTPS in production. Request camera and microphone access only when the user starts a call.

Test two real devices, permission denial, network switching, background behavior, and reconnects. Record the call ID and UTC time for diagnostics.