跳到正文

PartyKit

热门趋势活跃
partykit/partykit

基于 Durable Objects 构建多人协作和实时应用——协同编辑、在线状态、聊天和游戏——无需自己管理 WebSocket 基础设施。

在 GitHub 查看
星标
5729
Fork
202
关注
5729
未关闭 Issue
92

该介绍目前仅提供英文版本。

Overview

PartyKit makes it simple to build multiplayer and real-time applications — collaborative editors, live cursors, chat, presence, and games — without running your own WebSocket infrastructure. You write a small server (“party”) that reacts to connections and messages, and PartyKit handles scaling, state, and deployment.

PartyKit joined Cloudflare and is built on Durable Objects. Active development of the Workers-native successor libraries (such as PartyServer) now happens in the cloudflare/partykit repository, while this repository hosts the original PartyKit platform, CLI, and documentation.

Key Features

  • Real-time by default: WebSocket connections with rooms, broadcasts, and per-room state
  • Add multiplayer with very little code to an existing app
  • Stateful rooms backed by Durable Objects, so each room keeps its own memory and storage
  • Local dev server and one-command deploys
  • Integrations with popular collaboration tools such as Yjs for CRDT-based editing
  • Extensive docs, guides, and examples for chat, cursors, games, and AI use cases

Getting Started

Requires Node.js 17 or newer. Create a new project with a server and a client:

npm create partykit@latest

Or add PartyKit to an existing project:

npx partykit@latest init

Then run the dev server and deploy when ready:

npm run dev
npm run deploy

Use Cases

  • Collaborative documents and whiteboards
  • Live cursors, presence, and reactions
  • Chat rooms and notifications
  • Multiplayer browser games
  • Real-time dashboards and AI agents that stream updates to many clients

License

MIT License.

按共同分类和标签排序的同类开源项目。

全部 Web 框架项目 →