CarlosC
Convex Community5mo ago
2 replies
Carlos

Updating external services with Convex preview url on new preview deployment

I have a staging branch that collects all changes before pushing to main. I am using Vercel to deploy Convex along with my client side code. The application uses service workers hosted on Railway and sort of uses Convex tables as a job queue, so those external services need to update Convex tables. Given that, I currently need to manually update the convex url in my Railway env variables each time I push to staging and trigger a new Convex deployment. When Vercel runs the build command on a new push to staging, the new Convex URL is generated for the preview deployment. Is there a clean way to automatically tell railway "Convex URL has changed to x" during the Vercel build other than waiting for the new preview deployment url to be created, manually updating Railway CONVEX_URL and then redeploying the Railway infra?

I can think of ways to do this that would make me sad, but before doing that I was wondering if anyone has an elegant solution, given this is likely a common issue.
Was this page helpful?