| 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;
}