# Realtime

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

```bash
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

```js
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.

---

More for agents: [Docs index](https://extraorbital.dev/sitemap.md) · [llms.txt](https://extraorbital.dev/llms.txt) · [agents.md](https://extraorbital.dev/agents.md)
