Prompt Buddy logoPrompt Buddy

cloudflare · Cloudflare Workers Docs

Workers Environment variables

Teaches how to define, configure, and access text and JSON environment variables in Cloudflare Workers using Wrangler configuration files, the dashboard, and global imports.

Import to Prompt Buddy

Derived skill

Files assembled from official documentation

Viewing SKILL.md

Workers Environment variables

Teaches how to define, configure, and access text and JSON environment variables in Cloudflare Workers using Wrangler configuration files, the dashboard, and global imports.

When To Use

Use when you need to attach configuration strings or JSON values to a Worker, manage environment-specific settings in Wrangler, or access variables globally within your code.

Reference Files

FileContainsUse For
SKILL.mdEntry point: scope, routing table, and workflow.Start here.
docs/workers-configuration-environment-variables-workflow-guide.mdA guide explaining how to add, import, and configure environment variables for Cloudflare Workers using Wrangler and the env parameter.Questions about a guide explaining how to add, import, and configure environment variables for Cloudflare Workers using Wrangler and...
examples/workers-configuration-environment-variables-cloudflare-workers-environme.textA wrangler.toml configuration file demonstrating how to define top-level and nested environment variables for a Cloudflare Worker.Exact payloads, commands, or snippets shown in A wrangler.toml configuration file demonstrating how to define top-level and nested environment variables for a Cloud...
examples/workers-configuration-environment-variables-cloudflare-workers-wrangler-.textA TOML configuration file demonstrating how to define top-level and nested environment variables in a Cloudflare Workers wrangler.toml file.Exact payloads, commands, or snippets shown in A TOML configuration file demonstrating how to define top-level and nested environment variables in a Cloudflare Work...
examples/workers-configuration-environment-variables-cloudflare-workers-environme-2.textA JavaScript code snippet demonstrating how to access environment variables via the env object in a Cloudflare Workers fetch handler.Exact payloads, commands, or snippets shown in A JavaScript code snippet demonstrating how to access environment variables via the env object in a Cloudflare Worker...
examples/workers-configuration-environment-variables-cloudflare-workers-environme-3.textA TypeScript interface definition demonstrating how to declare and access environment variables within a Cloudflare Workers script.Exact payloads, commands, or snippets shown in A TypeScript interface definition demonstrating how to declare and access environment variables within a Cloudflare W...
examples/workers-configuration-environment-variables-cloudflare-workers-environme-4.textA JavaScript code example demonstrating how to import and access environment variables using the cloudflare:workers module.Exact payloads, commands, or snippets shown in A JavaScript code example demonstrating how to import and access environment variables using the cloudflare:workers m...
examples/workers-configuration-environment-variables-cloudflare-workers-environme-5.textA TypeScript code example demonstrating how to import and access environment variables using the cloudflare:workers module.Exact payloads, commands, or snippets shown in A TypeScript code example demonstrating how to import and access environment variables using the cloudflare:workers m...
examples/workers-configuration-environment-variables-cloudflare-workers-wrangler--2.textA TOML configuration example demonstrating how to define top-level and environment-specific variables in a wrangler.toml file for Cloudflare Workers.Exact payloads, commands, or snippets shown in A TOML configuration example demonstrating how to define top-level and environment-specific variables in a wrangler.t...
examples/workers-configuration-environment-variables-cloudflare-workers-wrangler--3.textA TOML configuration file demonstrating how to define environment variables and environment-specific variables using Wrangler.Exact payloads, commands, or snippets shown in A TOML configuration file demonstrating how to define environment variables and environment-specific variables using...
examples/workers-configuration-environment-variables-cloudflare-workers-environme-6.textA text file demonstrating the syntax for defining environment variables like SECRET_KEY and APITOKEN in a Cloudflare Workers configuration.Exact payloads, commands, or snippets shown in A text file demonstrating the syntax for defining environment variables like SECRETKEY and APITOKEN in a Cloudflare W...
examples/workers-configuration-environment-variables-cloudflare-workers-environme-7.textA sample wrangler.toml configuration demonstrating how to define text and JSON environment variables for a Cloudflare Worker.Exact payloads, commands, or snippets shown in A sample wrangler.toml configuration demonstrating how to define text and JSON environment variables for a Cloudflare...

What This Skill Covers

  • You can add environment variables, which are a type of binding, to attach text strings or JSON values to your Worker. Environment variables are available on...
  • Main sections: Background, Add environment variables via Wrangler, Import env for global access, Configuring different environments in Wrangler, Add environment variables via the dashboard.

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/environment-variables