Replies: 1 comment 1 reply
-
Or something close to |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently the only URL environment variable that Vercel exposes for running apps is
VERCEL_URL
(in the format<project-name>-<unique-hash>-<scope-slug>.vercel.app
) which links to the unique id of that one deployment (this is the so called automatic deployment URL).But the URL that the Vercel bot links in GitHub pull request's comments for preview enviroments is not this same deployment URL, but instead the branch specific URL (this is the so called automatic branch URL).
This is problematic, since now in one's code there is no way to programmatically access this branch specific URL which is the actual URL that the preview application is actually most likely accessed from.
Suggestion:
Expose a
VERCEL_BRANCH_URL
environment variable during runtime (andNEXT_PUBLIC_VERCEL_BRANCH_URL
etc. during build time) which contain the URL for the branch, in the format:<project-name>-git-<branch-name>-<scope-slug>.vercel.app
.Beta Was this translation helpful? Give feedback.
All reactions