durable-objects

Coordinate stateful per-entity logic across Cloudflare Workers with Durable Objects.

Updated May 17, 2026
One-click install
npx skills add https://github.com/cenjie/skills --skill durable-objects-cenjie
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: durable-objects
Source: https://github.com/cenjie/skills/tree/main/skills/durable-objects
Command: npx skills add https://github.com/cenjie/skills --skill durable-objects-cenjie

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Durable Objects provide a principled way to coordinate stateful entities at the edge, enabling scalable, consistent per-entity logic across workers.

Core Features & Use Cases

  • One DO per logical unit (chat rooms, game sessions, or user sessions) to encapsulate coordination and storage
  • RPC-style methods, alarms, WebSockets, and integrated SQLite storage with migrations and testing
  • Real-world workflows like multi-tenant coordination, live collaborative apps, and turn-based systems

Quick Start

Create a Durable Object class, connect it to wrangler, and expose deterministic RPC methods to manage per-entity state.

Frequently Asked Questions about durable-objects

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build stateful chat rooms or multiplayer sessions with Cloudflare Workers?

Build stateful chat rooms or multiplayer sessions with Cloudflare Workers by assigning one Durable Object per logical unit, encapsulating coordination and storage using RPC methods, WebSockets, and SQLite-backed persistence.

What is a Durable Object and when do I need it for edge applications?

A Durable Object is a stateful, per-entity coordination primitive at the edge. You need it for scalable, consistent per-entity logic across workers, such as multi-tenant coordination, live collaborative apps, or turn-based systems.

How do I persist state in a Durable Object using SQLite and wrangler?

Persist state in a Durable Object using integrated SQLite storage with migrations. Define storage operations within your DO class, connect it to wrangler, and apply storage-first persistence practices to maintain consistent per-entity state.

Does Cloudflare Workers Durable Objects support WebSocket connections and RPC methods?

Cloudflare Workers Durable Objects support WebSocket connections and RPC-style methods to manage per-entity state and real-time communication for live collaborative apps and multiplayer sessions.

How do I test Durable Objects logic with Vitest?

Test Durable Objects logic with Vitest by enforcing best practices for deterministic routing and testability. Create a DO class, expose deterministic RPC methods, and validate per-entity coordination and storage behavior.

What are the limitations of using Durable Objects for per-user coordination at the edge?

Limitations of Durable Objects for per-user coordination include strict per-entity routing and storage constraints. They enforce deterministic routing and storage-first persistence, requiring careful design for scalable, consistent state logic across workers.