Prompt Buddy logoPrompt Buddy

cloudflare · Cloudflare Workers Docs

Workers Secrets

How to store, manage, and access encrypted sensitive information like API keys and auth tokens within Cloudflare Workers using both local development files and deployed environments.

Import to Prompt Buddy

Derived skill

Files assembled from official documentation

Viewing SKILL.md

Workers Secrets

How to store, manage, and access encrypted sensitive information like API keys and auth tokens within Cloudflare Workers using both local development files and deployed environments.

When To Use

Use when you need to securely inject API keys or credentials into a Worker environment for both local testing and production deployment.

Reference Files

FileContainsUse For
SKILL.mdEntry point: scope, routing table, and workflow.Start here.
docs/workers-configuration-secrets-workflow-guide.mdA guide explaining how to use encrypted bindings to store and access sensitive information like API keys within Cloudflare Workers.Questions about a guide explaining how to use encrypted bindings to store and access sensitive information like API keys within Cloud...
examples/workers-configuration-secrets-cloudflare-workers-secrets-postgres-connec.textA JavaScript code example demonstrating how to access a database connection string stored as a Worker secret using the env object.Exact payloads, commands, or snippets shown in A JavaScript code example demonstrating how to access a database connection string stored as a Worker secret using th...
examples/workers-configuration-secrets-cloudflare-workers-secrets-env-import-java.textA JavaScript code example demonstrating how to import and use environment secrets via the cloudflare:workers module.Exact payloads, commands, or snippets shown in A JavaScript code example demonstrating how to import and use environment secrets via the cloudflare:workers module.
examples/workers-configuration-secrets-cloudflare-workers-secrets-env-import-java-2.textA JavaScript code example demonstrating how to import and use environment secrets via the cloudflare:workers module.Exact payloads, commands, or snippets shown in A JavaScript code example demonstrating how to import and use environment secrets via the cloudflare:workers module.
examples/workers-configuration-secrets-cloudflare-workers-secrets-environment-var.textA list of example environment variable assignments for defining secrets in a Cloudflare Workers configuration.Exact payloads, commands, or snippets shown in A list of example environment variable assignments for defining secrets in a Cloudflare Workers configuration.
examples/workers-configuration-secrets-cloudflare-workers-secrets-wrangler-put-co.textA text snippet demonstrating the use of the wrangler secret put command to upload secrets to a Cloudflare Worker.Exact payloads, commands, or snippets shown in A text snippet demonstrating the use of the wrangler secret put command to upload secrets to a Cloudflare Worker.
examples/workers-configuration-secrets-cloudflare-workers-wrangler-versions-secre.textA command line instruction using Wrangler to upload a secret to a Cloudflare Workers environment.Exact payloads, commands, or snippets shown in A command line instruction using Wrangler to upload a secret to a Cloudflare Workers environment.
examples/workers-configuration-secrets-cloudflare-workers-secrets-deploy-env-comm.textA command line instruction demonstrating how to deploy Cloudflare Workers secrets using a specific environment file with the Wrangler CLI.Exact payloads, commands, or snippets shown in A command line instruction demonstrating how to deploy Cloudflare Workers secrets using a specific environment file w...
examples/workers-configuration-secrets-cloudflare-workers-secrets-upload-command.textA CLI command demonstrating how to upload secrets to Cloudflare Workers using the wrangler versions upload flag.Exact payloads, commands, or snippets shown in A CLI command demonstrating how to upload secrets to Cloudflare Workers using the wrangler versions upload flag.
examples/workers-configuration-secrets-cloudflare-workers-secret-delete-wrangler-.textA text snippet demonstrating the wrangler command used to delete a secret from a Cloudflare Worker.Exact payloads, commands, or snippets shown in A text snippet demonstrating the wrangler command used to delete a secret from a Cloudflare Worker.
examples/workers-configuration-secrets-cloudflare-workers-wrangler-secret-delete-.textA text snippet demonstrating the wrangler command used to delete a secret version in Cloudflare Workers.Exact payloads, commands, or snippets shown in A text snippet demonstrating the wrangler command used to delete a secret version in Cloudflare Workers.

What This Skill Covers

  • Secrets are a type of binding that allow you to attach encrypted text values to your Worker. Secrets are used for storing sensitive information like API keys...
  • Main sections: Background, Access your secrets with Workers, Local Development with Secrets, Secrets on deployed Workers, Validate secrets before deploy.

Workflow

  1. Open the most relevant file under docs/ for the exact documented workflow and wording.
  2. Open schemas/ files for exact structured contracts.
  3. Open examples/ files for concrete requests, commands, snippets, and manifests.
  4. Do not add behavior or configuration that is not present in the attached source files.

Canonical source: https://developers.cloudflare.com/workers/configuration/secrets