npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@irtio/client

v4.4.0

Published

irtio client SDK: joinRoom, owned-write batching, corrections, typed RPCs, presence, reconnection

Readme

@irtio/client

Connect a browser game or Node script to an irtio room. Read shared state, update records you own, call typed RPCs, and handle connection changes.

npm install @irtio/client @irtio/schema

Join a room

This browser excerpt assumes the schema and room from the quickstart, with the room server running locally. Bundle it as main.ts in your game page:

import { joinRoom } from '@irtio/client';
import { schema } from './irtio/schema.js';

const room = await joinRoom(schema, { name: 'Player' });

window.addEventListener('pointermove', (event) => {
  const player = room.state.players.get(room.me);
  if (!player) return;
  player.x = event.clientX;
  player.y = event.clientY;
});

console.log('Share this room:', room.link);
room.on('status', (status) => console.log(status));

The join resolves after the initial snapshot arrives. In a browser, the client reads ?room= from the page URL or creates a room and puts its code in the URL. Open that link in another tab to join the same room. Call room.leave() when your application is finished with it.

Read, write, and react

| API | Use | | --- | --- | | room.state | Current state and writes to owned records | | room.render | Interpolated remote state for drawing | | room.call.<name>(params) | A typed server RPC; rejects on refusal or failure | | room.onAdd, room.onRemove, room.onChange | Subscribe to entity collection changes | | room.messages.<name> | Send and receive schema-declared messages | | room.on('status', callback) | Update connection UI | | room.on('error', callback) | Handle reported errors |

An RPC reply can arrive before its state update. Return a value from the RPC when the caller needs it immediately, or react to state updates independently.

In Node.js 22, pass url and a room code explicitly to connect scripts to the same room. Omitting room creates a new room on each call. See Node usage.

Optional features

Use matchRoom for hosted matchmaking, joinRelay for relay messages, and joinVoice for voice chat after a user gesture. Identity and matchmaking use the hosted control API.

For physics prediction, install the matching engine peer dependency and import its entry point:

| Engine | Install | Import | | --- | --- | --- | | Rapier 3D | @dimforge/rapier3d-compat | @irtio/client/rapier3d | | Rapier 2D | @dimforge/rapier2d-compat | @irtio/client/rapier2d | | Matter 2D | matter-js | @irtio/client/matter |

Pass the imported engine as module in the appropriate physics option. Follow the physics setup to share world definitions with the server. See the client reference for signatures, defaults, and errors.