ยฉ 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Cloudflare DevelopersCD
Cloudflare Developersโ€ข3y agoโ€ข
2 replies
glamboyosa

Confused about prod workers environment variables

possible noob question as I'm super new to CF using it for a side project (https://vaella.glamboyosa.xyz) and environment variables and CF workers but.

say I have an environment variable in my dev.vars called database_id

and in the [vars] I reference database_id as database_id=$database_id

and also for environment.development

and it all works fine.

but how would I reference environment variables for production that way?

I am aware you could set up a GitHub action but I don't want to or need to so early. and I'd like to commit my wrangler.toml file with my sensitive data secure.

so kinda like on the Vercel dashboard where you can specify environment variables and it'll be read for prod deploys.

like I wanna be able to tell D1 to reference the database_id variable and it kinda point to the var in prod somehow when I use wrangler.

same for using wrangler deploy ...
Vaella
Private Audio Rant Rooms
Cloudflare Developers banner
Cloudflare DevelopersJoin
Welcome to the official Cloudflare Developers server. Here you can ask for help and stay updated with the latest news
85,042Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Confused about Caching with Fetch API within Workers
Cloudflare DevelopersCDCloudflare Developers / workers-and-pages-help
3y ago
Confused about caching
Cloudflare DevelopersCDCloudflare Developers / workers-and-pages-help
3y ago
Confused about Environments
Cloudflare DevelopersCDCloudflare Developers / workers-and-pages-help
3y ago