PlayMesh
GitHub
Open Source · MIT License

Build multiplayer worlds,
not networking infrastructure.

PlayMesh is an open-source multiplayer server framework for Node.js. Real-time networking, session management, presence, and horizontal scaling — so you can focus on the game.

Get Started →How It Works
$npm install @playmesh/server @playmesh/client
↗ @playmesh/server↗ @playmesh/client

Real-time networking

Powered by Socket.IO. Handle thousands of concurrent connections with event-driven messaging, broadcasts, and low-latency communication.

🌐

Horizontal scaling

Add Redis and run as many nodes as you need. Sessions, presence, state, and pub/sub are automatically synchronized across your cluster.

🗺️

Multi-instance sessions

A single player can be in multiple Instances simultaneously — world, guild, party, and global chat all at once.

🔑

Bring your own auth

PlayMesh does not implement authentication. Use JWT, OAuth, API keys, or any custom strategy via a simple hook.

🗃️

Runtime state

Per-instance synchronized state for match timers, boss health, objectives, and counters. Backed by Redis in distributed mode.

⚙️

Background queues

BullMQ-powered queues built in. Use them for matchmaking, delayed tasks, event pipelines, and background processing.

Clear hierarchy, simple API

PlayMesh organizes multiplayer environments in a three-level hierarchy.

Universe (PlayMesh)
├── Domain — world, lobby, ranked, social
├── Instance — dungeon, match, city
└── Instance — guild hall, trade hub
└── Domain — matchmaking
Sessions join Instances and can be in multiple at once

Up in minutes

A multiplayer chat server in under 30 lines.

server.ts
import { PlayMesh } from '@playmesh/server';

const mesh = new PlayMesh({ port: 4000 });

mesh.onAuthenticate(async req => ({
  userId: String(req.auth.username),
}));

mesh.bootstrap(async ({ mesh }) => {
  const lobby = mesh
    .createDomain('social')
    .createInstance('lobby');

  lobby.on('chat', (session, payload) => {
    lobby.broadcast('chat', {
      sender: session.userId,
      message: payload.message,
    });
  });
});

mesh.onAdmission(async () => ({
  instances: ['social/lobby'],
}));

await mesh.start();
client.ts
import { PlayMeshClient } from '@playmesh/client';

const client = new PlayMeshClient({
  url: 'http://localhost:4000',
  auth: { username: 'alice' },
});

client.on('chat', payload => {
  console.log(
    `${payload.sender}: ${payload.message}`
  );
});

const session = await client.connect();
console.log('Joined:', session.instances);

client.emit('chat', {
  message: 'Hello, world!',
});
Full Getting Started guide →

You build the game. We handle the network.

PlayMesh is infrastructure, not a framework that owns your business logic.

CapabilityPlayMeshYour App
Socket communication
Session management
Presence tracking
Distributed messaging
Multi-node support
Redis infrastructure
Queue infrastructure
Authentication logic
Databases & persistence
Game logic
Economy & inventory