convex-env

Configure Convex deployment environment variables and secrets via CLI commands.

Updated Sep 17, 2026
One-click install
npx skills add https://github.com/Tehzeeb07/CodeRush --skill convex-env-tehzeeb07
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: convex-env
Source: https://github.com/Tehzeeb07/CodeRush/tree/main/.agents/skills/convex-env
Command: npx skills add https://github.com/Tehzeeb07/CodeRush --skill convex-env-tehzeeb07

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Managing API keys and secrets across Convex deployments is error-prone when developers hardcode values or commit them to git. This Skill provides a clear workflow for storing secrets as Convex deployment env vars and reading them safely in backend code. ## Core Features & Use Cases - Secret Storage: Set environment variables per deployment using npx convex env set KEY value. - Safe Access Patterns: Read values via process.env inside actions (with 'use node' when needed), never in queries or mutations. - Security Guardrails: Enforces rules that secrets never live in code or git, with .env.local reserved for local development only. - Use Case: When adding a third-party API key to your Convex backend, set it with the CLI, confirm it with npx convex env list, and access it inside an action without exposing it in your repository. ## Quick Start Set the OPENAI_API_KEY environment variable on my Convex deployment and show me how to read it inside an action.

Frequently Asked Questions about convex-env

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set environment variables in Convex?▼

Set environment variables in Convex with the CLI command `npx convex env set KEY value`, which stores the value on the current deployment. Confirm the stored values at any time with `npx convex env list`.

How do I store API keys securely in a Convex backend?▼

Store API keys as Convex deployment env vars using `npx convex env set`, never in source code or git. For local development only, place them in `.env.local`, and give each deployment its own values.

Can I use process.env in Convex queries and mutations?▼

No, process.env is only available inside Convex actions, not queries or mutations. If the action runs in the Node runtime, add the 'use node' directive so environment variables resolve correctly.

Why is my Convex env var undefined in a mutation?▼

Environment variables are undefined in queries and mutations because Convex only exposes process.env inside actions. Move the secret-dependent logic into an action and call it from your mutation if needed.

Do Convex environment variables sync across deployments?▼

No, each Convex deployment maintains its own set of environment variables. You must run `npx convex env set` separately for dev, staging, and production deployments with their respective values.