a month ago
How do I sync Railway's PR preview environments with Vercel's PR preview environments?
Our Vercel config has an env var to point to the URL of the backend, and Railway has a variable that specifies the public URL, but it's unclear how to make Vercel point to the preview PR env of railway
34 Replies
a month ago
You can set up CICD pipelines to update Vercel environment variables (via Vercel API) when a PR is created.
a month ago
I don't think there's native sync...? Nevermind 💀
This exists:
-# Thanks medim
The problem seems to be that the railway integration doesn't sync preview env vars to be branch specific.
a month ago
Not sure. Sorry.
No worries I appreciate it!
What's the best way to get support from the team?
a month ago
Here...
Is it Railway's API you're having trouble with?
to retrieve an env var for a preview environment via the api, I need a token.
but the tokens are per environment, so this wouldn't work because I'd need to generate them on demand
a month ago
Project tokens should use RAILWAY_TOKEN. Account/workspace tokens should use RAILWAY_API_TOKEN.
a month ago
Tokens are not per-environment.
a month ago
They are either account based or project based.
a month ago
Oh thats interesting tokens are now locked to environments…
a month ago
Try using an account scoped token.
Go to account settings > tokens to create one.
a month ago
(This is for CLI btw.)
a month ago
Yes.
a month ago
Are you using the public API or the CLI?
it's just not documented from where you create the account token
The docs point to this but say nothing about needing to use RAILWAY_API_TOKEN
Thanks for the help @pepper!
Honestly this whole process has been one of the most frustrating I've ever had with a vendor.
a month ago
np
a month ago
All good now? Going to mark this thread as solved if it is.
a month ago
Thanks!
a month ago
Closing this note then.
Status changed to Solved 0x5b62656e5d • about 1 month ago