# LobbyLab quickstart

> The `lobbylab` npm package is not published yet, so the `npx -y lobbylab` commands on this page do not work today. Everything else here is current. Request an alpha key at https://lobbylab.gg/developers.

LobbyLab is a hosted multiplayer backend. Your game keeps its own UI, engine and domain; players join LobbyLab rooms over WebSockets through `@lobbylab/client`, and LobbyLab keeps the rooms, invite codes, matchmaking and shared game state. Game rules that run on LobbyLab's servers come later. Request an alpha key at https://lobbylab.gg/developers.

Status: alpha. There are no public keys yet, and `@lobbylab/client` and `@lobbylab/node` are not on npm yet; both arrive with the alpha. What works today: the `lobbylab` package's `docs` and `mcp` commands, and lobbylab.gg, where people describe a game, LobbyLab builds it, and friends play it on phone or web.

Read these docs offline with `npx -y lobbylab docs [topic]`. For coding agents: `npx -y lobbylab mcp` (see the agents doc).

## What works today

- `npx -y lobbylab docs [topic]` prints these docs: `quickstart`, `agents`, `client`, `rooms`, `protocol`, `status`.
- `npx -y lobbylab mcp` starts a local MCP server with two read-only tools, `lobbylab_docs` and `lobbylab_multiplayer_quickstart`. It needs no key and makes no network calls.
- The wire protocol the API reuses, `multiplayer-wire/v0`, already runs every room on https://lobbylab.gg (see the protocol doc).
- https://lobbylab.gg itself: describe a game, LobbyLab builds it, and friends play it together on phone or web.

## What arrives with the alpha

- Projects with a publishable key (`llpk_...`, safe in a browser, checked against your allowed origins) and secret keys (`llsk_...`, backend only).
- `@lobbylab/client` (browser, Node, Bun, Deno, React Native) and `@lobbylab/node` (player tokens from your own login, server calls).
- Rooms with 6-letter invite codes, quick-join matchmaking and a lobby list of open rooms.
- Shared state: a shared document, one slot per player, private data only its owner sees, write rules per path, guards for races, messages to all, others, the host or chosen players, and host controls.
- Two room flavors: turn-based (every change saved) and live (a fixed 20 Hz tick).
- Reconnection handled by the SDK.

## Planned after that

- `npx -y lobbylab@1 init`: a short-lived sandbox project with no account, keys written to `.env` and `.env.local`.
- MCP tools that create projects and rooms, report usage and add test players.
- Game rules that run on LobbyLab's servers.
- SDKs for more engines (Flutter and Godot first).

## The planned client API (preview: may change, not installable yet)

```js
import { LobbyLab } from "@lobbylab/client";
const lobby = new LobbyLab({ key: process.env.LOBBYLAB_PUBLISHABLE_KEY });
const room = await lobby.joinOrCreate("default");
room.on("message", ({ from, topic, data }) => console.log(from, topic, data));
room.send("hello", { at: Date.now() });
```

Do not add `@lobbylab/client` or `@lobbylab/node` to a project yet: npm has no usable release of either.

## Next step

Request an alpha key at https://lobbylab.gg/developers. Until you have one, keep your game's networking behind one small module (connect, send, and a callback when the state changes), so moving to LobbyLab later changes one file.
