Multiplayer rooms for the web
A web-native multiplayer layer, built from the ground up so rooms sleep whenever they're idle, even with players still connected, and wake in milliseconds. Board and card games sleep between turns, and action games stop costing anything 30 seconds after a match ends.
npx @irtio/cli init my-game
Server and client in lockstep
State syncs seamlessly between the room and every client, and client-side prediction and lag compensation keep it looking right no matter the network conditions. Input reaches your server code as calls that read like ordinary functions, and ownership rules let the client change the fields it's allowed to directly.
1The client calls a functionClient
const roll = await room.calls.roll({ sides: 20 });2The room runs your handlerServer
roll({ sides }) {
return 1 + Math.floor(Math.random() * sides);
},3The client carries on with the resultClient
die.textContent = `You rolled ${roll}`;Declare a call once; its args are checked on both sides and its reply comes back typed. Calls
1The client draws health bars from the room's stateClient
function frame() {
for (const p of room.entities.all(Player)) {
drawHealthBar(p, p.hp);
}
requestAnimationFrame(frame);
}2The room changes itServer
onTick(room) {
for (const p of room.entities.all(Player)) {
p.hp = Math.min(100, p.hp + 1);
}
},3The next frame draws the new valueClient
drawHealthBar(p, p.hp); // p.hp is already the room'sOnly what changed is sent, as a binary delta, to the clients that can see it. State sync
1The player writes its own cursor, with no round tripClient
addEventListener("pointermove", (e) => {
for (const cursor of room.entities.mine(Cursor)) {
cursor.x = e.clientX;
}
});2The room checks every writeServer
writes: {
cursor(room, conn, cursor, write) {
if (write.x === undefined) return write;
return { ...write, x: Math.min(write.x, 800) };
},
},3Every other client sees it moveClient
room.entities.onChange(Cursor, (c) => drawCursor(c));Players write the fields they own with no round trip, and the room has the last word. Ownership
1The player fires at the target on their screenClient
input.fire = aimAt(others.get(target));2The room rewinds to what the shooter sawServer
onTick(room) {
for (const conn of room.connections.values()) {
const shot = conn.input?.fire;
if (!shot) continue;
const seen = room.rewind(poses, conn.viewTick);
const hit = firstHit(conn, shot, seen);
if (hit) room.broadcast({ type: "hit", id: hit.id });
}
},3A shot that looked like a hit is a hitClient
room.addEventListener("message", (e) => {
if (e.data.type === "hit") showHitMarker(e.data.id);
});The room keeps recent positions and checks each shot against the tick the shooter saw. Lag compensation
Rooms that sleep, and wake anywhere
IRT rooms are built from the ground up to be portable. While a room runs, its state changes stream to the state store, so it can be restarted at any time, on any server, from exactly where it left off. Connections are held outside the room, so a restart doesn't drop a single player.
What that gets you
Rooms sleep when nobody needs them
An empty room hibernates 30 seconds after its last player leaves, and an idle one, like a board game between turns, can sleep with its players still connected. A sleeping room costs nothing.
Scale without sizing servers
Each room is placed when it wakes, so a spike gets room after room and a lull holds nothing.
Crashes and deploys that don't kick players
A room that breaks is replaced from its saved state with its players' connections held. Running rooms stay on their build until they next hibernate, then wake on the new one.
Replays and state you can inspect
Because a room's state streams out of it, you get replays and shareable clips out of the box, and state you can inspect to debug problems.
Try it: a party quiz
One person writes the quiz, a TV shows the questions and a code to join with, and everyone answers on their phone. The room keeps every deadline in its alarm, so the game runs itself to the podium, and between games it sleeps with every phone still connected. The answer stays in room code until the reveal, so no phone can read it early.

Handled out of the box
irt deploy ships your rooms and site as one build, so clients always match their room code.Tested in process@irtio/testing runs rooms with test clients and a controlled clock, crashes included.Ready for coding agentsThe docs are published as llms.txt, and every example in them is compiled.Client trust based on game needs
A project can mix room types that make different choices.
- 1
Relay
A native room runs no code of yours. It passes messages on and keeps presence and a leader.
- 2
Shared entities
Players spawn, own and write entities under rules each kind declares, still with no server code.
- 3
Ownership
Players write the entities they control with no round trip, and the room checks every write.
- 4
Fully authoritative
The room runs the rules, clients predict their own movement, and hits are checked by rewinding.
An example game: Breach
Breach is a 5v5 bomb-defusal shooter for the browser: buy rounds, rifles and a sniper, grenades, a kill cam. Its room is fully authoritative and runs at 60 ticks a second.

Movement with no wait
Players are physics characters the client predicts, with the same controller as the room. At 150 ms round trip, 1,200 ticks of running, jumping and climbing stairs needed no correction.
Hits where you saw them
A shot travels in the player's input, and the room checks it against where the target was on the shooter's screen, with a hitbox for each bone of its pose.
Ten players from one button
Finding a 5v5 waits in a lobby until ten have joined, then hands them all to a new match. Quick play fills public matches between rounds.
Crashes don't end the round
The round clock, the bomb and the economy are room state, so a room that crashes picks up where it was, and players reconnect to it.
A full room of ten sends each player about 20 KB a second and takes 0.3 ms a tick.
Multiplayer you can test
Multiplayer bugs hide between players: a write lost in a reconnect, an entity one team shouldn't see, an avatar duplicated by a crash. IRT's test tools run your room and the real client in process, on a clock that moves only when the test moves it, so those bugs show up in a test instead of in a playtest. They need no network or account, and run the same in CI.
test("a crash keeps one avatar per player", async () => {
const t = testRoom(room);
const alice = await t.connect({ player: "alice" });
await t.host.crash();
await alice.reconnected();
expect(alice.view(Avatar)).toHaveLength(1);
expect(alice.reconnects).toBe(1);
});Crashes and reconnects on demand
@irtio/testing crashes the room, hibernates it or drops a client the way production does, so you can check what each player sees afterwards.
Dozens of scripted players
irt simulate runs bots with real client connections and checks every tick that nobody sees what they shouldn't and no write is silently lost.
20 players, 600 ticks (30.0 s at 20 Hz), seed 1, in 2.1 s pass visibility 11980 client views checked against the room's interest pass prediction 0 mispredictions, at most 0 for one bot (allowed 10) pass room-errors 0 errors logged by the room pass limits room state peaked at 1840 bytes (allowed 33554432), 20 entities pass script 0 errors thrown by the script and behaviours trace: .irt/simulate/trace.jsonl
Why it matters for coding agents
A coding agent can't open two browsers and play against itself, so multiplayer code is the code it can least check. With these tools it can: it runs the tests and the simulation, reads the result, and fixes what failed before it calls the work done.
Failures it can reproduce
A run is deterministic for its seed, so a bug the agent finds is one it can run again after its fix.
Output written to be read
The simulation's trace is JSON lines. The last gives the verdict and the first failure, and each failure has its tick and the entity's values in the room and on the client.
Docs that match your version
irt mcp gives the agent the docs for the SDK you installed, andllms.txt has them for any agent.
Hosting on irt.io
You pay for room-hours, the time a room is awake, at the size you pick. The number of players in a room doesn't change it, and a hibernated or sleeping room costs nothing.
Prepaid credit, no subscriptions
irt.io runs on prepaid credit. You won't be surprised by a bill, or have a monthly subscription to manage.
Each project also caps the rooms awake at once and the room-hours used in a day. You get an alert at 80%, and at a cap players already in rooms keep playing.
An open source room host
The room host is open source and runs a build on your own machine. The client SDKs work against it unchanged, so moving off irt.io is a change of project URL. SeeSelf-hosting.
| Meter | What it counts | Price |
|---|---|---|
| Room-hours | An hour of one room awake, however many players are in it. | From $0.005 an hour, by room size |
| Traffic | The bytes your rooms send to players and receive from them. | Free |
| Voice-minutes | Per participant, per minute in a call. Only if you turn voice on. | $0.001 a participant-hour |
| Storage | The room state your hibernated rooms keep, and your replays and clips. | Free |
irt.io is currently invite-only
We're inviting game developers in small groups, and every invite comes with $10 of credit to try out the platform. Tell us what you're building for access. We want to hear about it.
From the blog
Build rooms that sleep
Tell us what you're building, and we'll email you an invite with $10 of credit to start.