Getting started
From API key to live room in five minutes.
Create a room through REST, mint a short-lived runtime token, and connect a realtime client without requiring Supabase Auth for your end users.
Get an API key
Create a tenant in the console and generate an API key scoped to your modules.
Open RTIE Cloud quickstart.ts
import { AuctionSync } from "@rtie/sdk";
const apiKey = process.env.RTIE_API_KEY!;
const room = await fetch("https://api.rtie.ai/v1/rooms", {
method: "POST",
headers: {
"X-API-Key": apiKey,
"Content-Type": "application/json",
},
body: JSON.stringify({ name: "Lot 42", slug: "lot-42" }),
}).then((res) => res.json());
const handshake = await fetch("https://api.rtie.ai/v1/runtime/connect", {
method: "POST",
headers: {
"X-API-Key": apiKey,
"Content-Type": "application/json",
},
body: JSON.stringify({
roomId: room.id,
modules: ["rooms", "presence", "chat"],
actor: { type: "agent", id: "agent:host" },
}),
}).then((res) => res.json());
const sync = new AuctionSync({
host: handshake.realtime.endpoint,
moduleAddress: handshake.realtime.moduleAddress,
authToken: handshake.session.token,
});
await sync.connect();
sync.subscribeToLobby();
sync.onRoomsSnapshotChanged((rooms) => {
console.log("rooms", rooms.length);
}); Next moves