Skip to content

SecretsStore

Source: src/Cloudflare/SecretsStore/SecretsStore.ts

A Cloudflare Secrets Store, a per-account container for secrets that can be bound into Workers with full redaction and audit support.

Cloudflare enforces a limit of one Secrets Store per account. Deleting a store changes its ID and permanently destroys all secrets inside it. Because of this, the provider always adopts an existing store rather than creating a new one, and never deletes the store on teardown. If no store exists yet, one is created, but once it exists it is treated as account-level infrastructure that outlives any single stack.

Basic Secrets Store (adopts existing or creates one)

const store = yield* Cloudflare.SecretsStore("MyStore");

Adopt a specific named store

const store = yield* Cloudflare.SecretsStore("MyStore", {
name: "production-secrets",
});