Hi,
I have a custom env (staging) and I’m kinda confused with the env vars
In docs VERCEL_URL should be the actual domain and VERCEL_BRANCH_URL should be the domain with the branch (Vercel.app)
In practice I see that in custom env VERCEL_URL = the branch domain and not the …staging.vercel.app
I’m hosting payloadcms and I’m using such vars for email generation
Also, does Vercel support string interpolation? (I’d like to use a var inside var)
I see your question and I tried doing what you’re asking. For me, VERCEL_BRANCH_URL was undefined in a custom environment and VERCEL_URL was set correctly. I’m talking to our team to see how to fix this.
For environment variable interpolation, we recommend doing it directly in the application code.
For example, in Next.js you would do that with next.config.js (docs link):
The framework should be able to provide ways to create a new environment variable based on a provided one by the system either at build time or at runtime.