Skip to main content

KVNamespace

A Cloudflare KV Namespace is a key-value store for storing data in your Worker applications.

Props

string
Title of the namespace.
KVPair[]
KV pairs to store in the namespace (only used for initial setup or updates).
boolean
default:"false"
Whether to adopt an existing namespace with the same title if it exists.
boolean
default:"true"
Whether to delete the namespace when the resource is removed from Alchemy.

Output

string
The ID of the namespace.
string
Title of the namespace.
number
Time at which the namespace was created.
number
Time at which the namespace was last modified.
kv_namespace
Type identifier for the binding.

Examples

Basic KV Namespace

KV Namespace with Initial Values

KV Namespace with Metadata

Adopt Existing Namespace