Skip to Content
Introduction

mesh

Mesh is a command-based WebSocket framework for real-time apps. It uses Redis to coordinate connections, rooms, presence, and shared state across distributed servers—with built-in support for structured commands, latency tracking, and automatic reconnection.

Core concepts

Mesh is built from a small set of primitives. Each one is simple, but together they let you build powerful real-time systems.

Quickstart

Here’s the fastest way to get a server and client talking.

1. Start a Redis server

docker run -p 6379:6379 redis

2. Start a Mesh server

npm install @mesh-kit/server
import { } from "@mesh-kit/server"; const = new ({ : 8080, : { : "localhost", : 6379 }, }); .("echo", async () => { return `echo: ${.}`; });

3. Connect from a client

npm install @mesh-kit/client
import { } from "@mesh-kit/client"; const = new ("ws://localhost:8080"); await .(); const = await .("echo", "Hello!"); .(); // "echo: Hello!"

Who is this for?

Mesh is for the 95% of real-world apps that need real-time sync but don’t want to build a protocol, socket engine, or multi-server infra from scratch.

Common use cases where Mesh works well:

Collaborative apps

  • Live cursors
  • Shared documents or boards
  • Co-browsing

Dashboards and control panels

  • IoT devices
  • Live analytics
  • Monitoring & alerts

Real-time social features

  • Chat and presence
  • Typing indicators
  • Notification feeds

Async or turn-based games

  • Card or strategy games
  • Shared inventories and positions
  • Multiplayer state syncing
Last updated on
© 2025