durable-objects

Build and audit Cloudflare Durable Objects with RPC, alarms, WebSockets, and SQLite.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Cloudflare Durable Objects provide a simple model to coordinate stateful resources at the edge, enabling per-entity storage, RPC methods, alarms, and real-time communication across distributed instances without stateless bottlenecks.

Core Features & Use Cases

  • One DO per coordination unit (chat rooms, game sessions, documents, users) to avoid global bottlenecks.
  • Supports RPC endpoints, alarms, WebSockets, and SQLite-backed storage for durable state.
  • Includes wrangler configuration guidance, testing workflows with Vitest, and best practices for migrations and observability.
  • Use cases include chat rooms, collaborative apps, real-time dashboards, and per-tenant coordination scenarios.

Quick Start

Create a Durable Object class, wire it to wrangler.json with a DO binding, and run wrangler dev to test locally.

Frequently Asked Questions about durable-objects

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

FAQPage Schema
How do I coordinate stateful resources at the edge using Cloudflare Durable Objects?

To coordinate stateful resources with Cloudflare Durable Objects, you assign one DO per coordination unit like a chat room or game session. This model uses per-entity storage and RPC methods to avoid global bottlenecks across distributed edge instances.

How do I set up WebSocket connections and SQLite storage in a Durable Object?

You set up WebSockets and SQLite storage in a Durable Object by defining them within your DO class and wiring the class to a DO binding in wrangler.json. This configuration supports real-time communication and durable state for collaborative applications.

Can I use Vitest to test Cloudflare Durable Objects locally?

Yes, you can test Cloudflare Durable Objects locally using Vitest. The workflow involves creating your DO class, wiring it to wrangler.json, and running wrangler dev alongside Vitest to validate RPC methods, alarms, and SQLite-backed storage.

What are the best use cases for stateful edge computing with Durable Objects?

The best use cases for stateful edge computing with Durable Objects include chat rooms, collaborative apps, real-time dashboards, and per-tenant coordination scenarios. These applications benefit from per-entity state and real-time WebSocket communication without stateless bottlenecks.

How do I configure alarms and RPC methods for edge applications in wrangler?

You configure alarms and RPC methods for edge applications by defining them inside your Durable Object class and registering the class through a DO binding in wrangler.json. This setup enables scheduled tasks and direct invocations across distributed instances.

When should I avoid using Durable Objects for edge state management?

You should avoid using Durable Objects for edge state management when your application requires shared global state across all users rather than per-entity coordination, as the one-DO-per-unit model is designed to isolate state for specific chat rooms, game sessions, or tenants.