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.
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
| File | Contains | Use For |
|---|---|---|
SKILL.md | Entry point: scope, routing table, and workflow. | Start here. |
docs/workers-configuration-secrets-workflow-guide.md | A 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.text | A 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.text | A 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.text | A 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.text | A 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.text | A 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.text | A 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.text | A 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.text | A 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-.text | A 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-.text | A 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
- Open the most relevant file under
docs/for the exact documented workflow and wording. - Open
schemas/files for exact structured contracts. - Open
examples/files for concrete requests, commands, snippets, and manifests. - Do not add behavior or configuration that is not present in the attached source files.
Canonical source: https://developers.cloudflare.com/workers/configuration/secrets
