[ Web Proxy ]
URL:
Viewing: https://developers.cloudflare.com/workers/vite-plugin/reference/secrets/ [Back]  [Original]

Secrets Cloudflare Workers docsSkip to content
SearchCtrlKLog in
  1. Home
  2. /Workers
  3. /
  4. /Reference
  5. /Secrets

Secrets

Last updated Apr 23, 2026Copy as MarkdownView as MarkdownAgent setup

Secrets are typically used for storing sensitive information such as API keys and auth tokens. For deployed Workers, they are set via the dashboard or Wrangler CLI.

In local development, secrets can be provided to your Worker by using a .dev.vars file. If you are using Cloudflare Environments then the relevant .dev.vars file will be selected. For example, CLOUDFLARE_ENV=staging vite dev will load .dev.vars.staging if it exists and fall back to .dev.vars.

Note

The vite build command copies the relevant .dev.vars file to the output directory. This is only used when running vite preview and is not deployed with your Worker.

PreviousMigrating from wrangler devNextVite Environments

Was this helpful?

YesNo
Edit pageReport issue
[]

Web Proxy Viewer  |  New URL  |  Original Page