Set and list production secrets

cloudflare pages

// what it does

Stores an encrypted secret (API keys, DB URLs) that Functions read from `env` at runtime, without committing it to the repo. `put` prompts for the value; `list` shows the names currently configured.

// shell

$ wrangler pages secret put DATABASE_URL --project-name my-app
$ wrangler pages secret list --project-name my-app

// gotcha

Secrets are write-only — you can never read the value back, only overwrite it. Production and preview keep separate secret sets.