convex-env

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
<!-- GENERATED from convex-agents content/capabilities/env.json — do not edit by hand. -->
<!-- 由convex-agents的content/capabilities/env.json生成 — 请勿手动编辑。 -->

Manage env vars + secrets

管理环境变量与密钥

Store secrets as Convex deployment env vars (npx convex env set), read them with process.env in actions, never commit them.
将密钥存储为Convex部署环境变量(使用npx convex env set命令),在actions中通过process.env读取,切勿提交到版本库。

Workflow

工作流程

  1. npx convex env set KEY value
    (per deployment).
  2. Read via process.env.KEY inside actions (not queries/mutations).
  3. Never hardcode or commit secrets; add to .env.local only for local.
  4. Confirm with
    npx convex env list
    .
  1. npx convex env set KEY value
    (针对每个部署环境)。
  2. 在actions内部通过process.env.KEY读取(不可在queries/mutations中使用)。
  3. 切勿硬编码或提交密钥;仅在本地开发时添加到.env.local中。
  4. 使用
    npx convex env list
    确认设置。

Rules

规则

  • Secrets live in Convex env vars, never in code or git.
  • process.env only in actions ('use node' if needed), not queries/mutations.
  • Different deployments need their own values.
  • 密钥需存储在Convex环境变量中,绝不可放入代码或git版本库。
  • 仅可在actions中使用process.env(必要时使用'use node'),不可在queries/mutations中使用。
  • 不同的部署环境需要配置各自的变量值。