3 months 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
3 months ago
You can set up CICD pipelines to update Vercel environment variables (via Vercel API) when a PR is created.
3 months 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.
3 months ago
Not sure. Sorry.
No worries I appreciate it!
What's the best way to get support from the team?
3 months 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
3 months ago
Project tokens should use RAILWAY_TOKEN. Account/workspace tokens should use RAILWAY_API_TOKEN.
3 months ago
Tokens are not per-environment.
3 months ago
They are either account based or project based.
3 months ago
Oh thats interesting tokens are now locked to environments…
3 months ago
Try using an account scoped token.
Go to account settings > tokens to create one.
3 months ago
(This is for CLI btw.)
3 months ago
Yes.
3 months 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.
3 months ago
np
3 months ago
All good now? Going to mark this thread as solved if it is.
3 months ago
Thanks!
3 months ago
Closing this note then.
Status changed to Solved 0x5b62656e5d • 3 months ago