Doppler integration investigation
That was what brought me here, actually! We had a customer that suggested reaching out, as any sync we do would require some documented API to work with from our side. I was just doing a bit of initial research on our end.
4 Replies
Hi @Fyrewulfie! feel free dm or email tom@convex.dev but affirming what's in the thread above, there are no documented APIs for this on an instance short of running the CLI. You could start with these undocumented APIs they change very slowly since old CLIs need to work for a long time.
In the future we need to work out some patterns for environment variable sync for convex generally: like cloudflare workers we'd aspire to a declarative system where environment variables (or at least their existence) are declared somewhere in the codebase so the can be applied transactionally with the deploy, but that's not how these APIs work today. But also allow imperatively setting them later... and then on deploy blowing away (or not) these overridden values.
There's potential for doppler integration at dev/build/deploy time (setting environment variables along with code deploys) and at runtime, overriding values. Today setting an environment variable invalidates query caches like a code deploy because queries don't currently track which environment variables they read. We'd want to fix this before encouraging developers to sync environment variables to prod willy-nilly, since they may not understand the costs of changing environment variables matches that of a code deploy. This doesn't seem uncommon, e.g. Vercel won't let you change environment variables in a running deploy.
Also as you try out convex let us know what you think @Fyrewulfie!
No worries! We have a few options there as well. Some of our integrations have an additional option to trigger a redeploy on sync, so if a user updates a synced variable in Doppler, it would push the update to the third party, then trigger a redeploy there. That's how we're currently doing it with Railway and a few others.
Cool, as long as that's clear could be fine. Changing environment variables doesn't require a redeploy on convex, but it's still more expensive than setting a variable.
That makes sense. I'll have to get an internal ticket made on our side to look into it a bit more. For now, I'm just gathering info.