Cloudflare Pages w/ Convex NEXT_PUBLIC_CONVEX_URL
Does anyone have any guidance on how to properly set NEXT_PUBLIC_CONVEX_URL for de/preview/prod when using Cloudflare pages for hosting? I've attached my workaround that currently lets me deploy with it set to my prod convex instance but would like it to still set to my dev convex deployment for non prod deploys

2 Replies
Hello. Under (the Project) > Settings (tab) > Variables and Secrets (tab) you can add .env vars. I know that solved my undefined VITE_CLERK_PUBLISHABLE_KEY var error, but I'm not sure that's what you need.
I'm new to the Convex & Cloudflare ecosystem & actually came here to see if others have figured out a Vite + Convex + Clerk on Cloudflare deployment yet. I'm getting close to public beta testing and just started trying to piece it together from the docs for Vercel & Netlify. If / when I figure it out I'll try to share what I figure out.
Also, I had a similar issue for VITE_CLERK_FRONTEND_API_URL there was a link in the build to set the value at https://dashboard.convex.dev/d/ (my convex server subdomain) /settings/environment-variables?var=VITE_CLERK_FRONTEND_API_URL
Note that the subdomain should match the CONVEX_DEPLOY_KEY subdomain.
Convex Dashboard
Manage your Convex apps