| name | documenso-multi-env-setup |
| description | Configure Documenso across multiple environments (dev, staging, production).
Use when setting up environment-specific configurations, managing API keys,
or implementing environment promotion workflows.
Trigger with phrases like "documenso environments", "documenso staging",
"documenso dev setup", "multi-environment documenso".
|
| allowed-tools | Read, Write, Edit |
| version | 1.13.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","documenso","api","workflow"] |
| compatibility | Designed for Claude Code, also compatible with Codex and OpenClaw |
Documenso Multi-Environment Setup
Overview
Configure Documenso across development, staging, and production with environment isolation, secret management, and promotion workflows. Documenso cloud offers a staging environment at stg-app.documenso.com; self-hosted users run separate instances.
Prerequisites
- Documenso accounts or instances for each environment
- Secret management solution (Vault, AWS Secrets Manager, or
.env files)
- Completed
documenso-install-auth setup
Environment Architecture
┌─────────────────────────────────────────────────────────────┐
│ Development │
│ API: stg-app.documenso.com (or localhost:3000 self-hosted) │
│ Key: DOCUMENSO_API_KEY=api_dev_xxx │
│ Webhooks: ngrok tunnel │
├─────────────────────────────────────────────────────────────┤
│ Staging │
│ API: stg-app.documenso.com │
│ Key: DOCUMENSO_API_KEY=api_stg_xxx │
│ Webhooks: staging.yourapp.com/webhooks/documenso │
├─────────────────────────────────────────────────────────────┤
│ Production │
│ API: app.documenso.com (or sign.yourcompany.com) │
│ Key: DOCUMENSO_API_KEY=api_prod_xxx │
│ Webhooks: api.yourapp.com/webhooks/documenso │
└─────────────────────────────────────────────────────────────┘
Instructions
Step 1: Environment Configuration Files
DOCUMENSO_API_KEY=api_dev_xxxxxxxxxxxx
DOCUMENSO_BASE_URL=https://stg-app.documenso.com/api/v2
DOCUMENSO_WEBHOOK_SECRET=whsec_dev_xxxxxxxxxxxx
LOG_LEVEL=debug
NODE_ENV=development
DOCUMENSO_API_KEY=api_stg_xxxxxxxxxxxx
DOCUMENSO_BASE_URL=https://stg-app.documenso.com/api/v2
DOCUMENSO_WEBHOOK_SECRET=whsec_stg_xxxxxxxxxxxx
LOG_LEVEL=info
NODE_ENV=staging
DOCUMENSO_API_KEY=api_prod_xxxxxxxxxxxx
DOCUMENSO_BASE_URL=https://app.documenso.com/api/v2
DOCUMENSO_WEBHOOK_SECRET=whsec_prod_xxxxxxxxxxxx
LOG_LEVEL=warn
NODE_ENV=production
Step 2: Environment-Aware Client Factory
import { Documenso } from "@documenso/sdk-typescript";
{
: ;
: ;
: ;
}
(): {
apiKey = process..;
(!apiKey) ();
{
apiKey,
: process.. ?? ,
: process.. ?? ,
};
}
: | = ;
(): {
(!client) {
config = ();
client = ({
: config.,
: config.,
});
}
client;
}
(): {
().;
}
(): {
client = ;
}