cloudflare pages Env config help

I hope this message finds you well. I am a developer at a company that is currently exploring hosting options for our projects. We were wondering if Cloudflare Pages provides the ability to set environment variables for individual branches beyond the current "Production" and "Preview" configurations. As we specifically use unique environment variables for feature branches, having this capability would be highly beneficial in aligning with our workflow and ensuring seamless testing and deployment processes. Additionally, could you let us know if this functionality, or similar features, falls under a specific plan or pricing tier? Understanding the associated costs, if any, would greatly help us in our decision-making process. I look forward to your response and appreciate your assistance! Thanks !!
2 Replies
Cyb3r-Jak3
Cyb3r-Jak33w ago
Pages only offers production and preview environment. You can submit a feature request in #pages-feature-suggestions
theo
theo3w ago
Not within Cloudflare directly, but the platform does pass in a CF_PAGES_BRANCH env var (docs), which you could then use to alter the rest of your config according to your needs. You could wire this up yourself or use a tool like https://dmno.dev also worth noting that hosting on cloudflare pages (or workers with static assets) can be a great option, even if you don't want to use cloudflare's provided build/CI tools. So you can imagine running your build within github actions (or any CI provider) and then deploying already fully built code with the correct env vars already bundled to cloudflare using wrangler

Did you find this page helpful?