ObjectBindingDef
ObjectBindingDef =
object
Defined in: packages/env/src/types.ts:110
Binding definition for an object-type Cloudflare binding (D1, KV, R2, Queue, Durable Object, or Service).
Object bindings are validated via duck-type method checks at startup.
Example
Section titled “Example”const schema = { DB: { type: "d1" as const }, CACHE: { type: "kv" as const }, UPLOADS: { type: "r2" as const },};Properties
Section titled “Properties”optional?
Section titled “optional?”
optionaloptional:boolean
Defined in: packages/env/src/types.ts:114
When true, a missing binding produces undefined instead of a validation error.
type:
Exclude<BindingType,"var"|"secret">
Defined in: packages/env/src/types.ts:112
The Cloudflare binding type: "d1", "kv", "r2", "queue", "durable-object", or "service".