Skip to content

Commit 027ef5e

Browse files
authored
changelog: fix typo + add example (#20713)
cc @mikenomitch
1 parent 5190ca1 commit 027ef5e

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

src/content/changelog/workers/2025-03-11-process-env-support.mdx

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ products:
66
date: 2025-03-11T15:00:00Z
77
---
88

9+
import { WranglerConfig } from "~/components";
10+
911
You can now access [environment variables](/workers/configuration/environment-variables/) and
1012
[secrets](/workers/configuration/secrets/) on [`process.env`](/workers/runtime-apis/nodejs/process/#processenv)
1113
when using the [`nodejs_compat` compatability flag](/workers/configuration/compatibility-flags/#nodejs-compatibility-flag).
@@ -26,7 +28,20 @@ Now, [environment variables](/workers/configuration/environment-variables/),
2628
[secrets](/workers/configuration/secrets/), and [version metadata](/workers/runtime-apis/bindings/version-metadata/)
2729
can all be accessed on `process.env`.
2830

29-
After April 1, 2025, populating `process.env` will become the default behavior when `nodejs_compat` is enabled, and
30-
your Worker's compatability date is after "2025-04-01". Until then, users can opt-in to this behavior by adding the
31-
[`nodejs_compat_populate_process_env`](/workers/configuration/compatibility-flags/#enable-auto-populating-processenv)
32-
compatability flag.
31+
To opt-in to the new `process.env` behaviour now, add the [`nodejs_compat_populate_process_env`](/workers/configuration/compatibility-flags/#enable-auto-populating-processenv) compatibility flag to your
32+
`wrangler.json` configuration:
33+
34+
<WranglerConfig>
35+
36+
```jsonc
37+
{
38+
// Rest of your configuration
39+
// Add "nodejs_compat_populate_process_env" to your compatibility_flags array
40+
"compatibility_flags": ["nodejs_compat", "nodejs_compat_populate_process_env"],
41+
// Rest of your configuration
42+
```
43+
44+
</WranglerConfig>
45+
46+
After April 1, 2025, populating `process.env` will become the default behavior when both `nodejs_compat` is enabled and
47+
your Worker's `compatability_date` is after "2025-04-01".

0 commit comments

Comments
 (0)