Documentation Index
Fetch the complete documentation index at: https://docs.zavu.dev/llms.txt
Use this file to discover all available pages before exploring further.
Secrets
Function secrets are encrypted at rest and injected as environment variables at runtime. The function reads them viaprocess.env.<KEY> just like in any
Node program.
Setting secrets
Inline
From a file
From stdin (safest)
- placeholder tells the CLI to
read from stdin until EOF.
Listing
Removing
When changes take effect
Setting / unsetting a secret marks the function as out of sync. The nextzavu deploy rebuilds the Lambda with the new env vars. Until then, the
running function still has the old environment.
Constraints
| Constraint | Limit |
|---|---|
| Key format | [A-Z_][A-Z0-9_]* (uppercase env-var style) |
| Key length | ≤ 64 chars |
| Reserved prefixes | AWS_, LAMBDA_, _HANDLER, _X_AMZN (Lambda reserves these) |
| Value size | ≤ 4096 chars |
| Total secrets per function | 50 |
| Total env size | 4 KB (AWS Lambda hard limit) |
Auto-provisioned secrets
Every function created byzavu fn init gets these injected automatically —
you don’t set them yourself:
| Key | Value | Purpose |
|---|---|---|
ZAVU_API_KEY | A unique live API key scoped to this function’s project | Lets the function call Zavu’s REST API. |
ZAVU_API_BASE_URL | The dashboard’s Convex .site URL | So local-dev functions hit the right backend. |
ZAVU_PROJECT_ID | The function’s project ID | For logging / multi-tenant code. |
ZAVU_FUNCTION_ID | This function’s ID | For logging. |
ZAVU_FUNCTION_SLUG | This function’s slug | For logging / URL construction. |
ZAVU_API_KEY is revoked automatically when you zavu fn delete the
function. If you reset it manually from the dashboard’s API Keys page, the
function will start failing — redeploy to provision a new one.The auto-key has messages:send, messages:read, contacts:read scopes.
For other operations create a separate scoped key and inject it as a secret.Encryption
Values are encrypted with AES-256-GCM, key derived via PBKDF2 (100,000 iterations, SHA-256) from the platform encryption key. Encryption happens server-side before the value is persisted, so plaintext never lives in our database. The Lambda receives plaintext at deploy time as a standard environment variable, encrypted at rest by AWS (KMS-managed CMK). Inside the function,process.env.X returns the decrypted value.
Common patterns
Rotating an API key
Rotating an API key
Different secrets per environment
Different secrets per environment
Functions are project-scoped — if you have separate Zavu projects for
staging vs prod, each has its own secrets.
zavu whoami shows the current project before each operation.Secrets in source control (don't)
Secrets in source control (don't)
Never commit secret values. Commit a
.zavu/secrets.example.yml style
file with key names + descriptions, and have a teammate’s setup script
prompt for actual values:CI / automation
CI / automation
Use
ZAVUDEV_API_KEY env var so the CLI uses your CI’s key: