Build configuration · Cloudflare Pages d...

Can you access environment variables during runtime in Cloudflare Pages? This only refers to environment variables for build time https://developers.cloudflare.com/pages/configuration/build-configuration/#environment-variables
Cloudflare Docs
Build configuration · Cloudflare Pages docs
You may tell Cloudflare Pages how your site needs to be built as well as where its output files will be located.
5 Replies
konga
kongaOP10mo ago
Local development works just fine but doesn't work in Preview or Production. It's just undefined.
konga
kongaOP10mo ago
This is in middleware.ts
No description
BrianJM
BrianJM10mo ago
Same problem. Did you find an answer @konga
konga
kongaOP10mo ago
@BrianJM no I haven't. I just switched to docker and running on fly.io. If you can figure it out that would be awesome!
BrianJM
BrianJM10mo ago
I didn't notice you're using process.env until now. Different problem.

Did you find this page helpful?