Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/cloudflare/partykit/llms.txt

Use this file to discover all available pages before exploring further.

PartyKit is a collection of open-source TypeScript libraries that make it easy to build real-time, collaborative, and multiplayer applications on Cloudflare Workers. At its core, partyserver enhances Durable Objects with a clean WebSocket lifecycle API, while partysocket gives clients a resilient, auto-reconnecting WebSocket. Together they provide everything you need — from live cursors and collaborative text editing to AI agent orchestration and pub/sub at scale.

Quickstart

Build and deploy your first real-time app in minutes

How It Works

Understand the Durable Object model powering PartyKit

API Reference

Full API docs for partyserver, partysocket, and all packages

Guides

Deep dives into routing, auth, storage, scaling, and more

Core Packages

partyserver

Durable Object base class with lifecycle hooks, broadcasting, and hibernation support

partysocket

Auto-reconnecting WebSocket client with message buffering and React hooks

y-partyserver

Add Yjs CRDT collaborative editing to any PartyServer with one import

partysub

Pub/sub at scale across distributed Durable Object shards

partywhen

Schedule tasks by cron, delay, or exact time using Durable Object alarms

partytracks

Observable-based WebRTC audio/video via Cloudflare Realtime SFU

Multiplayer Apps

Shared state and real-time sync

Live Chat

Room-based messaging with broadcast

Presence

Show who’s online in real time

Collaborative Editing

Yjs-powered rich text and code editors

AI Agents

Long-running agents with durable state

Hono Integration

Drop PartyServer into any Hono app
1

Install partyserver and partysocket

npm install partyserver partysocket
2

Define your Server class

Extend Server and implement lifecycle hooks like onConnect and onMessage.
3

Configure wrangler.jsonc

Bind your Server class as a Durable Object and set up migrations.
4

Connect from the client

Use PartySocket to connect from the browser with automatic reconnection and message buffering.
PartyKit is inspired by the original PartyKit platform and runs entirely on your own Cloudflare account — no vendor lock-in beyond Cloudflare Workers and Durable Objects.

Build docs developers (and LLMs) love