Devflare Docs
Binding reference Bindings

Use Durable Objects when coordination or state really belongs with a single object identity

Devflare treats Durable Objects as a real first-class surface in config, local runtime, and tests, not as an awkward plugin hanging off the side of the worker.

That makes DO-heavy apps easier to reason about locally, but it also means you should be honest about the preview and migration caveats that come with them.

Config key
bindings.durableObjects
Authoring shape
Record<string, string | { className: string; scriptName?: string }>
Best for
Stateful sessions, locks, room state, and coordination that should not be faked as random stateless requests

Author it in the simplest shape that still says what you mean

A DO binding can be as simple as a class name string when the object lives in the same worker package.

When the object lives in another worker, keeps that relationship explicit instead of scattering script names and class names across the repo.

Durable Object authoring in one worker

When this binding fits best

  • Use Durable Objects when state or coordination should live behind one object identity, not when you merely want a fancy singleton.
  • They are a good fit for rooms, counters, distributed locks, and request serialization.
  • If the state is really just data you query, D1 or KV may stay simpler and easier to preview.

Notes worth keeping visible

  • DO-heavy apps need extra preview care because same-worker preview URLs do not cover every real DO deployment case.
  • does not currently apply Durable Object migrations, so migration-sensitive previews need a stronger plan.
  • Test and review worker naming carefully when DO bindings cross worker boundaries.

The preview caveat is real, not optional trivia

If previews must exercise real Durable Object behavior, branch-scoped preview workers are often safer than hoping same-worker preview URLs will be enough.

Cloudflare docs vs the Devflare layer

Cloudflare Durable Objects docs is the platform reference. This page is the Devflare translation layer: keep readable in source, understand the typed env surface, and know which local, preview, or remote lane actually matches the binding.

QuestionCloudflare docsThis Devflare page
Primary focusPlatform reference for object identity, storage, alarms, migrations, and deployment caveats.How to author , what the runtime surface looks like, and how Durable Objects fits a Devflare project.
Testing and runtime lensCloudflare’s docs focus on the raw binding API, product semantics, and platform limits for the binding itself.First-class local runtime and tests, including cross-worker references. Use the Devflare guidance when you need the honest local harness or the right remote gate instead of only the product API shape.
When to open itWhen you need the platform contract, limits, APIs, or account-level product details.When you are wiring, testing, previewing, or reviewing the binding inside a Devflare app.

Go deeper only if this one-page guide stops being enough