Request: Environment Variable for `VERCEL_CUSTOM_URL`

Requesting the addition of a VERCEL_CUSTOM_URL environment variable or similar to simplify access to the deployment URL across different environments at runtime.

This would allow applications to access the correct deployment URL without needing to implement custom logic for different environments.

In my prototype Vercel project, it would look something like this across environments:

Environment Branch VERCEL_CUSTOM_URL
Production production app.foo.com
Staging staging app.staging.foo.com
Preview main app.main.foo.com
Preview feature-branch app-git-feature-branch-foo-corp.vercel.app
Development Any git branch localhost:3000

This feature would enhance the usability of Vercel by allowing applications to easily access the correct deployment URL without needing to manage multiple environment variables or configurations.

2 Likes

Hi @kaizen-insights-core, welcome to the Vercel Community!

Thanks for your valuable feedback. I’ve passed it on to the team.

Hi,

I “think” this is what the OP is suggesting, but I would need something similar to VERCEL_PROJECT_PRODUCTION_URL for any kind of environment, not just production. I would suggest something like VERCEL_PROJECT_URL or VERCEL_STABLE_URL :man_shrugging:

One of the most common example for having stable URLs in all environments is testing OAuth2 apps that need a redirect URI.

Thanks!

1 Like

Exactly right. The impetus for this request is for auth redirect URIs across all environments.