At some point, every Phaser developer asks the same question: how do I add multiplayer? The game client is sorted. Phaser handles that beautifully. The problem is the server side. WebSocket state management, auth, rate limiting, reconnect logic, heartbeats — none of that is the fun part. It's plumbing.
Rivalis is an open-source Node.js framework built around exactly that problem. As its creator Daniel Kalevski puts it: "core idea is rooms, actors, and typed messages — so you write game logic instead of plumbing." It ships as two packages: @rivalis/core for the server and @rivalis/browser for a typed WebSocket aclient with auto-reconnect for your game running in the browser.
It's free, MIT licensed, and still early but stable enough to build on. Daniel is actively looking for feedback on the API ergonomics — anything that feels off, missing, or just weird. Drop your thoughts on GitHub.
How Rivalis Works: Rooms, Actors and Typed Messages
The entire framework is built around two concepts. Rooms are where your game logic lives: define handlers, bind topics, broadcast to everyone inside. Actors are connected players, each carrying typed data from your auth middleware. Every message is a binary frame with a topic and a payload. The framework never inspects the payload, so encode it however you like.
What Can You Build with Rivalis and Phaser?
Rivalis is built for anywhere multiple players need to share state in real time. Arena games, .io titles, party games, MMO zones, turn-based strategy with presence — all natural fits. But it's not limited to games: chat lobbies, live leaderboards, collaborative editors, and real-time dashboards all use the same Rooms and Actors model.
If your Phaser game needs players to see each other, send messages, or react to shared events, Rivalis handles that layer.
Rivalis ships with a demo included in the repository, with several rooms — chat lobby, shared counter, and a two-player Pac-Man — to exercise every feature end-to-end.


Built-in Rate Limiting, Heartbeats and Reconnect for Your Game Server
Rivalis ships with the things that are easy to forget but painful to add later: heartbeats with two-miss disconnect, per-actor rate limiting via a token bucket, exponential-backoff reconnect on the browser client, and origin allow-lists for CSWSH protection. All on by default with sensible values, all tunable.
Rivalis vs Colyseus: Which Node.js Multiplayer Framework Is Right for You?
Both Rivalis and Colyseus are Node.js multiplayer frameworks that work well with Phaser. The difference is in philosophy. Colyseus focuses on automatic state synchronization via schema classes — a great fit if you want the framework to manage shared state for you.
Rivalis takes a lower-level approach: free-form binary payloads, two concepts to learn, and a drop-in integration with any Node.js HTTP server. A good fit if you want full control over what gets sent and when.
Neither is the wrong choice. It depends on how much you want the framework to do for you 😉
AI-Ready: Use Rivalis with Claude Code, Cursor and Phaser Skills
Rivalis ships a skill file at rivalis.kalevski.dev/SKILL.md. Load it into Claude Code, Cursor, or any agent, and it will know the recipes, close codes, and security defaults. The same approach Phaser uses with its own AI skills files.
Get Started with Rivalis
MIT licensed, free forever. Read the docs, or check the source on GitHub before you dive in.
