Skip to content
extraorbital

EXTRAORBITAL / FLIGHT MANUAL

Everything you need to get into orbit.
Browse documentation

Realtime

Rooms, presence, messaging, and WebRTC signalling for your project.

AI/LLM: this page is available in plain markdown at /docs/resources/realtime.md

npx extraorbital add realtime

Connect collaborative applications through ExtraOrbital’s realtime relay. The CLI writes REALTIME_URL, NEXT_PUBLIC_REALTIME_URL, REALTIME_API_KEY, and REALTIME_TURN_KEY.

Join a room from your server

import { Realtime } from "@extraorbital/realtime";

const realtime = Realtime.fromEnv(process.env);
const room = await realtime.join("lobby", { peer: "server" });
room.on("message", (message) => console.log(message.from, message.data));
await room.send({ hello: "world" });

For browser clients, mint a room join token on your server and pass that token to the browser. Keep the resource API key and TURN key private. The public relay URL is an address, not an access credential.

Usage

Connections, messages, and TURN usage appear alongside the rest of your project's resources. Review usage and adjust your budget from the control desk.