Declare bindings with accepted config keys
Use allowlisted wrangler keys, scoped D1 migrations, and read-only DO previews.
Stay inside the accepted keys
Use only these top-level keys in dist/wrangler.json (from ACCEPTED_CONFIG_KEYS):
| Keys |
|---|
$schema, name, main, no_bundle |
compatibility_date, compatibility_flags |
durable_objects, migrations, assets, services |
triggers, vars, d1_databases, kv_namespaces |
queues, workflows, r2_buckets, worker_loaders |
containers, define, rules |
- Expect any other key to fail the deploy naming the key (
ai,Vectorize,Cache,send_emailincluded). - Set bindings in
void.config.tsand rebuild; never hand-writedist/wrangler.json. - Stay inside your plan’s cron floor (hourly or slower on Free, down to a minute on Pro); the deploy pipeline does not enforce floors yet, so hold the line yourself.
Preview Durable Object state read-only
- Declare classes under
durable_objectsinvoid.config.ts. - Answer
GET /do/<scope>?read=1by forwarding toenv.ROOMS.get(env.ROOMS.idFromName(scope)). - Return a small JSON snapshot; keep it read-only (
?read=1never creates, changes, or counts anything). - Return 404 for unrecognized scopes, stay under 5 s and 2 KB, and never include secrets.
For the person-side walkthrough, see How deploys work.