Getting started

Quickstart

Five minutes from npm install to a live room with two players exchanging state. No backend of your own, no servers to provision.

JavaScriptTypeScriptUnity (2026)
1

Install the SDK

One package, no peer dependencies. Works with any bundler, or straight from a CDN.

terminal
$ npm install @plot/client
2

Grab 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.

.env
PLOT_APP_KEY=pl_pub_live_xxx
3

Open 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.

game.ts
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()
4

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.

game.ts
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.

NEXT →
Core concepts

Points, lines, planes, and how a room stays consistent.

NEXT →
Authoritative handlers

Run server logic inside the room to validate moves and keep score.