Module

Matchmaking

Find competitors. Room codes, invites, friends, and matched queues — every path lands two or more players in the same authoritative multiplayer session.

@pithy-sh/matchmaking

Built for Games
terminal
pithy add matchmaking
Read the docs Source on GitHub

What it is for

Multiplayer gives you a session once players are in it. This is how they find each other: a room code they read out, an invite they tap, a friend list, or a queue that buckets on skill.

What it sits on

KV for presence, D1 for the roster, and the multiplayer session it hands off to.

There is no service anyone operates. Pairing runs in your Worker, and every path ends by placing players in the same authoritative session.

  • KV
  • D1
  • Durable Objects

The honest bit

Four ways in, because one is never enough.

Friends want a code. Strangers want a queue. Someone who just installed the app wants the invite their friend sent. Shipping only a skill queue is the most common way a small game's multiplayer feels empty.

If you build it yourself

Four ways in, and they all end in the same room.

Every game needs pairing. Nobody wants to build four of them.

Room codes

Short, readable aloud, collision-free, and expiring — a surprisingly fiddly little system.

Presence

Who is online right now, kept fresh without hammering a database, and correct after a crash.

Skill buckets that relax

Matching too tightly means waiting forever; matching too loosely means a bad game. The window has to widen over time.

Invites and friends

A durable relationship model, and an invite that survives an app restart.

Handing off cleanly

Every path has to end with the same authoritative session, or you have built four half-games.

terminal
pithy add matchmaking

In the dashboard

Administer it from a browser, without building the screen.

Queue depth, wait times, and which path players are actually using.

The dashboard is the admin interface for your own application: whatever this capability writes, your team can look up, check and act on from a browser. Reading is free, forever, with no time limit. Connect the project when you deploy.

Add it, and get on with the feature.

One command installs the package, wires its bindings into every environment your project declares, and runs its migrations.