When trying to setup a new custom environment (staging), I noticed the value of VERCEL_ENV is “preview”. I was expecting the value to be the name of my new environment.
Is the intended behavior to have this variable always have the value “preview” for custom environments?
The team just confirmed that it is expected since anything other than a production deployment is effectively a preview. But we opened a new ticket to make sure the docs say this. Thanks for pointing out that this was missing.
As a workaround, you could create an ENVenvironment variable for each of your environments and set the value to match the environment name. That would be fairly easy to set up in Project Settings, and then the correct environment name would be available to each new deployment.