Shared secrets across workers

I wanna build a monorepo of multiple workers and wondering if it's possible to provide the path to the .dev.vars file or its directory in the wrangler config? Something like this:
{
"$schema": "../../node_modules/wrangler/config-schema.json",
"name": "react-starter",
"secrets": "../../packages/vars"
}
{
"$schema": "../../node_modules/wrangler/config-schema.json",
"name": "react-starter",
"secrets": "../../packages/vars"
}
This is a basic necessity to provide shared environment variables across apps. I hope it's possible. Thank you.
No description
3 Replies
Walshy
Walshy3w ago
The best way to share secrets would be using secret store - https://developers.cloudflare.com/secrets-store/
broly
brolyOP3w ago
I will check this out. I like that they are assigned to your account so you dont have to bother keeping them in sync across your devices. But I hope we'll also have a possibility to store them in code and the separation into .dev.vars and .env disappears. Thank you
broly
brolyOP3w ago
Cloudflare Docs
Wrangler and the Cloudflare Vite plugin support .env files in loc...
Use .env files to provide secrets and override environment variables on the env object during local development.

Did you find this page helpful?