| name | documenso-local-dev-loop |
| description | Set up local development environment and testing workflow for Documenso.
Use when configuring dev environment, setting up test workflows,
or establishing rapid iteration patterns with Documenso.
Trigger with phrases like "documenso local dev", "documenso development",
"test documenso locally", "documenso dev environment".
|
| allowed-tools | Read, Write, Edit, Bash(npm:*), Bash(docker:*), Bash(node:*) |
| version | 1.13.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","documenso","testing","workflow"] |
| compatibility | Designed for Claude Code, also compatible with Codex and OpenClaw |
Documenso Local Dev Loop
Overview
Configure a fast local development environment for Documenso integrations. Covers project structure, environment configs, self-hosted Documenso via Docker, test utilities, and cleanup scripts.
Prerequisites
- Completed
documenso-install-auth setup
- Node.js 18+ with TypeScript
- Docker (for self-hosted local Documenso)
Instructions
Step 1: Project Structure
my-signing-app/
├── src/
│ └── documenso/
│ ├── client.ts # Configured SDK client
│ ├── documents.ts # Document operations
│ ├── recipients.ts # Recipient management
│ └── webhooks.ts # Webhook handlers
├── scripts/
│ ├── verify-connection.ts # Quick health check
│ ├── create-test-doc.ts # Generate test documents
│ └── cleanup-test-docs.ts # Remove test data
├── tests/
│ └── integration/
│ ├── document.test.ts
│ └── template.test.ts
├── .env.development
├── .env.test
└── .env.production
Step 2: Environment Configuration
.env.development:
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
.env.test:
DOCUMENSO_API_KEY=api_test_xxxxxxxxxxxx
DOCUMENSO_BASE_URL=https://stg-app.documenso.com/api/v2
DOCUMENSO_WEBHOOK_SECRET=whsec_test_xxxxxxxxxxxx
LOG_LEVEL=warn
Step 3: Client Wrapper with Dev Helpers
import { Documenso } from "@documenso/sdk-typescript";
let _client: Documenso | null = null;
export function getClient(): Documenso {
if (!_client) {
_client = new Documenso({
apiKey: process.env.!,
...(process.. && {
: process..,
}),
});
}
_client;
}
() {
client = ();
{ documents } = client..({
: ,
: limit,
: ,
: ,
});
documents;
}