MapleLeaf 🍁M
Convex Community15mo ago
8 replies
MapleLeaf 🍁

Set environment variables programmatically

I want to set up a Doppler webhook which updates secrets in Convex. I know of two ways to update secrets: through the dashboard, and through the CLI.

CLI seems like the easiest route, but I'm not exactly sure how to do this arbitrarily:

C:\dev
❯ CONVEX_DEPLOY_KEY="dev:fake-project-777|superreallylongstringthathasaconvexkeyinit" pnpx convex env set TEST itworks
✖ Unable to read your package.json: Error: ENOENT: no such file or directory, open 'C:\dev\package.json'. Make sure you're running this command from the root directory of a Convex app that contains the package.json


And I figure going down this route will run into other issues, since I imagine the CLI wasn't built to do this.

Accomplishing this through the dashboard is possible but extremely cursed, and I would prefer not to pull out puppeteer/playwright for this :ultra_joy:

Tentatively, I'm thinking a GitHub action triggered by a workflow might work, which would have the source directory and the surrounding dev environment, but that feels like a lot of orchestration.

Is there any way to accomplish this right now?
Doppler redefines how engineering teams handle secrets management. Experience enhanced security, agility, and automation with our cloud platform. Start your free trial.
Doppler | Centralized Cloud-Based Secrets Management Platform
Was this page helpful?