Multiplayer rooms for the web

A web-native multiplayer layer, built from the ground up so rooms sleep when they're empty and wake in milliseconds.

Request an invite

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.

Client
Server

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

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.

How rooms hibernate and wake

Handled out of the box

Client trust based on game needs

A project can mix room types that make different choices.

  1. 1

    Relay

    A native room runs no code of yours. It passes messages on and keeps presence and a leader.

  2. 2

    Shared entities

    Players spawn, own and write entities under rules each kind declares, still with no server code.

  3. 3

    Ownership

    Players write the entities they control with no round trip, and the room checks every write.

  4. 4

    Fully authoritative

    The room runs the rules, clients predict their own movement, and hits are checked by rewinding.

Room types

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.

avatars.test.ts
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.

npx irt simulate --players 20
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.

Testing rooms

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.

MeterWhat it countsPrice
Room-hoursAn hour of one room awake, however many players are in it.From $0.005 an hour, by room size
TrafficThe bytes your rooms send to players and receive from them.Free
Voice-minutesPer participant, per minute in a call. Only if you turn voice on.$0.001 a participant-hour
StorageThe 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.

Pricing

Build rooms that sleep

Tell us what you're building, and we'll email you an invite with $10 of credit to start.