Quickstart
Five minutes from npm install to a live room with two players exchanging state. No backend of your own, no servers to provision.
Install the SDK
One package, no peer dependencies. Works with any bundler, or straight from a CDN.
$ npm install @plot/clientGrab your app key
Create a project in the dashboard and copy the public key. The public key is safe to ship in client code — it can only join rooms, never administer them.
PLOT_APP_KEY=pl_pub_live_xxxOpen a room, join as a point
A room is a plane; a player is a point. Open the plane, then join it. Every other point in the same room sees you arrive.
import { Plot } from '@plot/client' const plot = new Plot({ appKey: process.env.PLOT_APP_KEY }) // open the plane const room = await plot.open('lobby-1') // join it as a point const me = room.join()
Send and receive lines
A line is a message. Send anything serializable; every other point receives it within a tick. Here we broadcast a cursor position and draw everyone else's.
room.on('point', (peer) => spawn(peer.id, peer.color)) room.on('message', ({ from, data }) => move(from, data)) room.on('leave', (peer) => despawn(peer.id)) window.onmousemove = (e) => { room.send({ x: e.clientX, y: e.clientY }) // a line }
That's a working multiplayer client. Deploy your game anywhere — itch.io, Vercel, your own host — and Plot runs the room on Cloudflare's edge nearest your players.