Public system env variables

The framework I am using requires exposed env variable to be prefixed with PUBLIC_ I am trying to use CF_PAGES_COMMITSHA from CF but I am not able to build with that since it doesnt prefix PUBLIC How can I make it so cloudflare also exposes one with PUBLIC_?
4 Replies
Idris
IdrisOP5w ago
Any help is welcome Bump If anyone knows how I can contact the pages team, then that would be helpful as well.
AGill
AGill5w ago
can you expose it via process.env? I'm also curious about the answer, just wondering
Idris
IdrisOP4w ago
Honestly I gave up on Cloudflare, their DX is bad. But that is okay, but their support is bad as well. So we cant trust them to run our prod on them. Their loss since we wont be buying other products because of these reasons.
DaniFoldi
DaniFoldi4w ago
Hey, I'm sorry you've had a bad experience with Pages. This Discord server is a community for the developers (us green-names are also volunteers, to be clear) to share their knowledge with others. I, and many others, go through channels and threads somewhat frequently, however I think that a few days is perfectly valid amount of time to wait for "free support". You can purchase a pro/biz zone or sign up for enterprise to get support directly from Cloudflare (I myself am not completely satisfied with the level of support they give to paygo customers, but that's a separate conversation) if this is for a prod service. To answer your original question, what I would do is set the environment variable in your build script, so the framework that needs it in that format can detect the one that starts with PUBLIC_.

Did you find this page helpful?