Skip to content

Commit 8af8f32

Browse files
committed
Update secrets-in-dev.mdx
1 parent 4ab45e9 commit 8af8f32

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/content/partials/workers/secrets-in-dev.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
22
{}
3-
43
---
54

65
When developing your Worker or Pages Function, create a `.dev.vars` file in the root of your project to define secrets that will be used when running `wrangler dev` or `wrangler pages dev`, as opposed to using [environment variables in `wrangler.toml`](/workers/configuration/environment-variables/#compare-secrets-and-environment-variables). This works both in local and remote development modes.
@@ -11,3 +10,5 @@ The `.dev.vars` file should be formatted like a `dotenv` file, such as `KEY="VAL
1110
SECRET_KEY="value"
1211
API_TOKEN="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9"
1312
```
13+
14+
You can set secrets per environment by creating additional files with the naming convention `.dev.vars.<environment-name>`. Like other environment variables, secrets are [non-inheritable](/workers/wrangler/configuration/#non-inheritable-keys) and must be defined per environment.

0 commit comments

Comments
 (0)