/Knowledge/sources/honojs__hono/llms-full/cloudflare-workers-load-env-when-local-development--0b83b12d6803.md
Cloudflare Workers: Load env when local development - hono-docs
Cloudflare Workers: Load env when local development Source evidence: /Sources/honojs hono/provenance.md Canonical citation: https://hono.dev/llms full.txt lo...
Cloudflare Workers: Load env when local development
Source evidence: /Sources/honojs__hono/provenance.md Canonical citation: https://hono.dev/llms-full.txt#load-env-when-local-development
Summary
To configure the environment variables for local development, create a .dev.vars file or a .env file in the root directory of the project. These files should be formatted using the [dotenv](https://hexdocs.pm/dotenvy/dotenv-file-form...
Content
To configure the environment variables for local development, create a .dev.vars file or a .env file in the root directory of the project.
These files should be formatted using the dotenv syntax. For example:
SECRET_KEY=value
API_TOKEN=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9
For more about this section you can find in the Cloudflare documentation: https://developers.cloudflare.com/workers/wrangler/configuration/#secrets
Then we use the c.env.* to get the environment variables in our code.
Metadata
{
"chunk_index": 0,
"citation": "https://hono.dev/llms-full.txt#load-env-when-local-development",
"coverage_role": "overview",
"qualified_title": "Hono / llms-full / Cloudflare Workers > Load env when local development (1)",
"retrieved_at": "2026-07-02T05:51:01Z",
"section_index": 392,
"source_id": "/honojs/hono",
"source_type": "llms_full",
"target_label": "llms-full",
"title": "Cloudflare Workers: Load env when local development",
"upstream_url": "https://hono.dev/llms-full.txt",
"version": "2026"
}