Complete Documenso integration skill pack with 24 skills covering document signing, templates, workflows, and e-signature automation. Flagship tier vendor pack.
Installation
Open Claude Code and run this command:
/plugin install documenso-pack@claude-code-plugins-plus
Use --global to install for all projects, or --project for current project only.
Skills (24)
Configure CI/CD pipelines for Documenso integrations.
Documenso CI Integration
Overview
Configure CI/CD pipelines for Documenso integrations with GitHub Actions. Covers unit testing with mocks, integration testing against staging, and deployment workflows with secret management.
Prerequisites
- GitHub repository with Actions enabled
- Documenso staging API key
- Test environment configured (see
documenso-local-dev-loop)
Instructions
Step 1: GitHub Actions Workflow
# .github/workflows/documenso-ci.yml
name: Documenso CI
on:
push:
branches: [main, develop]
pull_request:
branches: [main]
env:
NODE_ENV: test
jobs:
unit-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- run: npm ci
- run: npm test
# Unit tests use mocks — no API key needed
integration-tests:
runs-on: ubuntu-latest
if: github.event_name == 'push' # Only on push to main/develop
needs: unit-tests
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- run: npm ci
- run: npm run test:integration
env:
DOCUMENSO_API_KEY: ${{ secrets.DOCUMENSO_STAGING_API_KEY }}
- run: npm run test:cleanup # Remove test documents
env:
DOCUMENSO_API_KEY: ${{ secrets.DOCUMENSO_STAGING_API_KEY }}
if: always()
Step 2: Unit Tests with Mocked SDK
// tests/unit/document-service.test.ts
import { describe, it, expect, vi, beforeEach } from "vitest";
import { createMockClient } from "../mocks/documenso";
import { DocumentService } from "../../src/services/document-service";
describe("DocumentService", () => {
let service: DocumentService;
let mockClient: ReturnType<typeof createMockClient>;
beforeEach(() => {
mockClient = createMockClient();
service = new DocumentService(mockClient as any);
});
it("creates document with recipients and sends", async () => {
const result = await service.createAndSend({
title: "Test Contract",
pdfPath: "./fixtures/test.pdf",
signers: [{ email: "test@example.com", name: "Test User" }],
});
expect(mockClient.documents.createV0).toHaveBeenCalledWith({ title: "Test Contract" });
expect(mockClient.documentsRecipients.createV0).toHaveBeenCalled();
expect(mockClient.documents.sendV0).toHaveBeenCalled();
expect(result.documentId).toBe(1);
});
it("handles API errors gracefully", async () => {
mockClient.documents.createV0.mockRejectedValue(
Object.assign(new Error("Unauthorized"),Diagnose and resolve common Documenso API errors and issues.
Documenso Common Errors
Overview
Quick-reference troubleshooting guide for Documenso API errors. Covers authentication, document lifecycle, field validation, file upload, webhook, and SDK-specific issues with concrete solutions.
Prerequisites
- Working Documenso integration (see
documenso-install-auth) - Access to application logs
- API key available
HTTP Error Reference
| Status | Error | Cause | Solution |
|---|---|---|---|
| 401 | Unauthorized | Invalid, expired, or missing API key | Regenerate key in dashboard; verify Authorization: Bearer header |
| 403 | Forbidden | Personal key accessing team resources | Use a team-scoped API token |
| 404 | Not Found | Wrong document/template ID or deleted resource | Verify ID with GET /api/v1/documents |
| 400 | Bad Request | Invalid payload or missing required fields | Check request body against API spec |
| 413 | Payload Too Large | PDF exceeds upload limit | Compress PDF; cloud plan limit varies by tier |
| 429 | Too Many Requests | Rate limit exceeded | Implement backoff; see documenso-rate-limits |
| 500/502/503 | Server Error | Documenso infrastructure issue | Retry with exponential backoff; check status.documenso.com |
Instructions
Scenario 1: 401 Unauthorized
// WRONG: missing or malformed header
const res = await fetch("https://app.documenso.com/api/v1/documents", {
headers: { "Authorization": process.env.DOCUMENSO_API_KEY! }, // Missing "Bearer "
});
// CORRECT: include Bearer prefix
const res = await fetch("https://app.documenso.com/api/v1/documents", {
headers: { "Authorization": `Bearer ${process.env.DOCUMENSO_API_KEY}` },
});
// SDK handles this automatically:
import { Documenso } from "@documenso/sdk-typescript";
const client = new Documenso({ apiKey: process.env.DOCUMENSO_API_KEY! });
Checklist:
- API key starts with
api_(personal) or is team-scoped - No trailing whitespace or newline in env var
- Key hasn't been revoked in dashboard
Scenario 2: 403 — Personal Key on Team Resources
// Error: "Forbidden" when accessing team documents
// Personal API keys can only access YOUR documents
// Fix: generate a team API key from Team Settings > API Tokens
const client = new Documenso({
apiKey: process.env.DOCUMENSO_TEAM_API_KEY!, // Team-scoped key
}Implement Documenso document creation and recipient management workflows.
Documenso Core Workflow A: Document Creation & Recipients
Overview
Complete workflow for creating documents, managing recipients with different roles, positioning fields, and controlling signing order. Covers both the SDK and v1 REST API for document-centric operations.
Prerequisites
- Completed
documenso-install-authsetup - Understanding of
documenso-sdk-patterns - PDF file ready for signing
Instructions
Step 1: Create a Document with the SDK
import { Documenso } from "@documenso/sdk-typescript";
import { readFileSync } from "fs";
const client = new Documenso({ apiKey: process.env.DOCUMENSO_API_KEY! });
// Create document shell
const doc = await client.documents.createV0({
title: "Service Agreement — Q1 2026",
});
// Upload PDF
const pdf = readFileSync("./contracts/service-agreement.pdf");
await client.documents.setFileV0(doc.documentId, {
file: new Blob([pdf], { type: "application/pdf" }),
});
Step 2: Recipient Roles
Documenso supports these recipient roles:
| Role | Behavior |
|---|---|
SIGNER |
Must complete all assigned fields to finish |
VIEWER |
Receives a copy but takes no action |
APPROVER |
Must approve before signers can proceed |
CC |
Receives a completed copy after all signatures |
// Add multiple recipients with roles
const signer = await client.documentsRecipients.createV0(doc.documentId, {
email: "ceo@acme.com",
name: "Alice CEO",
role: "SIGNER",
});
const approver = await client.documentsRecipients.createV0(doc.documentId, {
email: "legal@acme.com",
name: "Legal Team",
role: "APPROVER",
});
const cc = await client.documentsRecipients.createV0(doc.documentId, {
email: "records@acme.com",
name: "Records",
role: "CC",
});
Step 3: Signing Order
Control the sequence in which recipients act. Lower numbers go first.
// Sequential signing: legal approves, then CEO signs
await client.documentsRecipients.createV0(doc.documentId, {
email: "legal@acme.com",
name: "Legal",
role: "APPROVER",
signingOrder: 1, // Goes first
});
await client.documentsRecipients.createV0(doc.documentId, {
email: "ceo@acme.com",
name: "CEO",
role: "SIGNER",
signingOrder: 2, // Goes after legal approves
});
Step 4: Add Fields to Document
Field coordinates use percentage-based positioning (0-100 for both X a
Implement Documenso template-based workflows and direct signing links.
Documenso Core Workflow B: Templates & Direct Signing
Overview
Create reusable templates, generate documents from templates with prefilled fields, and implement direct signing links for public/anonymous signers. Templates define the PDF, fields, and recipient roles once — then stamp out documents on demand.
Prerequisites
- Completed
documenso-core-workflow-a - At least one PDF uploaded to Documenso as a template
- Understanding of recipient roles and field types
Instructions
Step 1: Create a Template via Dashboard
Templates are created in the Documenso UI:
- Navigate to Templates in the sidebar.
- Click Create Template and upload a PDF.
- Add placeholder recipients (e.g., "Signer 1", "Approver") — these become roles that get filled when creating documents from the template.
- Place fields on the PDF and assign them to placeholder recipients.
- Save the template and note the template ID from the URL.
Step 2: Create Document from Template (v1 REST API)
// The v1 API has a dedicated template endpoint
const templateId = 42; // From the dashboard URL
const res = await fetch(
`https://app.documenso.com/api/v1/templates/${templateId}/create-document`,
{
method: "POST",
headers: {
Authorization: `Bearer ${process.env.DOCUMENSO_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
title: "Service Agreement — Acme Corp",
recipients: [
{
email: "ceo@acme.com",
name: "Alice CEO",
role: "SIGNER",
},
],
// Optionally prefill fields by their IDs
prefillFields: [
{ id: "field_abc123", value: "2026-03-22" },
{ id: "field_def456", value: "Acme Corporation" },
],
}),
}
);
const document = await res.json();
console.log(`Created document ${document.documentId} from template ${templateId}`);
Step 3: Template Workflow Patterns
// Pattern: Batch document generation from template
async function generateContracts(
templateId: number,
clients: Array<{ email: string; name: string; company: string }>
) {
const results = [];
for (const client of clients) {
const res = await fetch(
`https://app.documenso.com/api/v1/templates/${templateId}/create-document`,
{
method: "POST",
headers: {
Authorization: `Bearer ${process.env.DOCUMENSO_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
title: `Service Agreement — ${client.company}`,
recipients: [
Optimize Documenso usage costs and manage subscription efficiency.
Documenso Cost Tuning
Overview
Optimize Documenso costs through plan selection, template reuse, self-hosting, and usage monitoring. Documenso's pricing is uniquely developer-friendly: paid plans include unlimited API usage and signing volume.
Prerequisites
- Documenso account with billing access
- Understanding of your document volume patterns
Documenso Pricing Model
| Plan | Price | Documents | API / Signing | Teams | Key Feature |
|---|---|---|---|---|---|
| Free | $0/mo | Limited | Fair use | No | Personal use |
| Individual | $30/mo (early adopter) | Unlimited | Unlimited | No | Full API access |
| Team | $30/mo+ | Unlimited | Unlimited | Yes, unlimited | Team management, webhooks |
| Enterprise | Custom ($30K+/yr self-hosted) | Unlimited | Unlimited | Yes | SSO, audit logs, compliance |
| Self-Hosted (AGPL) | Free | Unlimited | No limits | Community | Full control, no SLA |
Key insight: Documenso does not charge per API call or per document on paid plans. Cost optimization is about choosing the right plan tier, not reducing API usage.
Instructions
Step 1: Right-Size Your Plan
Decision tree:
1. Personal use, < 5 docs/month? → Free tier
2. Individual developer, unlimited docs? → Individual ($30/mo)
3. Multiple team members collaborating? → Team plan
4. Need SSO, audit logs, or compliance? → Enterprise
5. Want full control, have DevOps capacity? → Self-host (AGPL, free)
Step 2: Template Reuse to Save Time (Not Money)
Templates don't save money (paid plans are unlimited), but they save developer time and reduce errors:
// WITHOUT templates: rebuild every time (slow, error-prone)
async function createContractManual(client: Documenso, signer: Signer) {
const doc = await client.documents.createV0({ title: `Contract — ${signer.name}` });
// Upload PDF, add recipient, add 6 fields... every time
// 7+ API calls per document
}
// WITH templates: one API call + send
async function createContractFromTemplate(templateId: number, signer: Signer) {
const res = await fetch(
`https://app.documenso.com/api/v1/templates/${templateId}/create-document`,
{
method: "POST",
headers: {
Authorization: `Bearer ${process.env.DOCUMENSO_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
title: `Contract — ${signer.name}`,
recipients: [{ email: signer.email, name: signer.name, role: "SIGNER" }],
}),
}
);
Handle document data, signatures, and PII in Documenso integrations.
Documenso Data Handling
Overview
Best practices for handling documents, signatures, and PII in Documenso integrations. Covers downloading signed PDFs, data retention, GDPR compliance, and secure storage. Note: Documenso cloud stores documents in PostgreSQL by default; self-hosted gives you full control.
Prerequisites
- Understanding of data protection regulations (GDPR, CCPA)
- Secure storage infrastructure (S3, GCS, or local encrypted storage)
- Completed
documenso-install-authsetup
Document Lifecycle
DRAFT ──send()──→ PENDING ──all sign──→ COMPLETED
│
├──reject()──→ REJECTED
└──cancel()──→ CANCELLED
Data handling implications:
- DRAFT: mutable, can delete freely
- PENDING: immutable document, but status changes
- COMPLETED: signed PDF available for download, archive
- REJECTED/CANCELLED: cleanup candidate
Instructions
Step 1: Download Signed Documents
import { Documenso } from "@documenso/sdk-typescript";
import { writeFile } from "node:fs/promises";
const client = new Documenso({ apiKey: process.env.DOCUMENSO_API_KEY! });
async function downloadSignedPdf(documentId: number, outputPath: string) {
// Verify document is completed
const doc = await client.documents.getV0(documentId);
if (doc.status !== "COMPLETED") {
throw new Error(`Document ${documentId} is ${doc.status}, not COMPLETED`);
}
// Download via v1 REST API (SDK may not expose download directly)
const res = await fetch(
`https://app.documenso.com/api/v1/documents/${documentId}/download`,
{ headers: { Authorization: `Bearer ${process.env.DOCUMENSO_API_KEY}` } }
);
if (!res.ok) throw new Error(`Download failed: ${res.status}`);
const buffer = Buffer.from(await res.arrayBuffer());
await writeFile(outputPath, buffer);
console.log(`Saved signed PDF: ${outputPath} (${buffer.length} bytes)`);
}
Step 2: PII Handling
// Identify PII in Documenso data
interface RecipientPII {
email: string; // PII — must be protected
name: string; // PII — must be protected
role: string; // Not PII
signingStatus: string; // Not PII
}
// Sanitize before logging
function sanitizeForLogging(payload: any): any {
const sanitized = { ...payload };
if (sanitized.recipients) {
sanitized.recipients = sanitized.recipients.map((r: any) => ({
...r,
email: r.email.replace(/^(.{2}).*(@.*)$/, "$1***$2"),
name: "[REDACTED]",
}));
}
return sanitized;
}
// Usage: safe to log
console.log("Webhook received:", JSON.stringify(sanitizeForLogging(payload)));
// Output: { email: "ja***@example.com", name: "[REDACTED]" }
Step 3: Data Retention Policy
Comprehensive debugging toolkit for Documenso integrations.
Documenso Debug Bundle
Current State
!node --version 2>/dev/null || echo 'N/A'
!python3 --version 2>/dev/null || echo 'N/A'
!uname -a
Overview
Comprehensive debugging tools for Documenso integration issues. Includes diagnostic scripts, curl debug commands, environment verification, and support ticket templates.
Prerequisites
- Documenso SDK installed
- Access to logs and configuration
curlandjqavailable
Instructions
Step 1: Quick Connectivity Test
#!/bin/bash
set -euo pipefail
echo "=== Documenso Connectivity Test ==="
# 1. Check API key is set
if [ -z "${DOCUMENSO_API_KEY:-}" ]; then
echo "FAIL: DOCUMENSO_API_KEY not set"
exit 1
fi
echo "OK: API key set (${#DOCUMENSO_API_KEY} chars)"
# 2. Test authentication
BASE="${DOCUMENSO_BASE_URL:-https://app.documenso.com/api/v1}"
STATUS=$(curl -s -o /dev/null -w "%{http_code}" \
-H "Authorization: Bearer $DOCUMENSO_API_KEY" \
"$BASE/documents?page=1&perPage=1")
if [ "$STATUS" = "200" ]; then
echo "OK: API authentication successful"
elif [ "$STATUS" = "401" ]; then
echo "FAIL: Invalid API key (401)"
exit 1
elif [ "$STATUS" = "403" ]; then
echo "FAIL: Insufficient permissions (403) — try a team API key"
exit 1
else
echo "WARN: Unexpected status $STATUS"
fi
# 3. Check latency
LATENCY=$(curl -s -o /dev/null -w "%{time_total}" \
-H "Authorization: Bearer $DOCUMENSO_API_KEY" \
"$BASE/documents?page=1&perPage=1")
echo "Latency: ${LATENCY}s"
# 4. List recent documents
echo "=== Recent Documents ==="
curl -s -H "Authorization: Bearer $DOCUMENSO_API_KEY" \
"$BASE/documents?page=1&perPage=5" | jq '.documents[] | {id, title, status, createdAt}'
Step 2: TypeScript Diagnostic Script
// scripts/documenso-diagnose.ts
import { Documenso } from "@documenso/sdk-typescript";
async function diagnose() {
const results: Array<{ test: string; status: "PASS" | "FAIL"; detail: string }> = [];
// Test 1: API key
const apiKey = process.env.DOCUMENSO_API_KEY;
if (!apiKey) {
results.push({ test: "API Key", status: "FAIL", detail: "DOCUMENSO_API_KEY not set" });
return results;
}
results.push({ test: "API Key", status: "PASS", detail: `Set (${apiKey.length} chars)` });
// Test 2: Connection
const client = new Documenso({
apiKey,
...(process.env.DOCUMENSO_BASE_URL && { serverURL: process.env.DOCUMENSO_BASE_URL }),
});
try {
const start = DDeploy Documenso integrations across different platforms and environments.
Documenso Deploy Integration
Overview
Deploy Documenso-integrated applications and self-hosted Documenso instances to Docker, Kubernetes, serverless, and cloud platforms. Covers both app deployment (your code that uses the Documenso API) and self-hosted Documenso deployment.
Prerequisites
- Application ready for deployment
- Cloud platform account (AWS, GCP, Azure)
- Docker installed locally
- Completed
documenso-multi-env-setup
Instructions
Step 1: Dockerize Your Documenso Integration
# Dockerfile
FROM node:20-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build
FROM node:20-alpine AS runtime
WORKDIR /app
RUN addgroup -S app && adduser -S app -G app
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/package.json .
USER app
EXPOSE 3000
CMD ["node", "dist/server.js"]
# Note: DOCUMENSO_API_KEY injected at runtime, never baked into image
Step 2: Self-Hosted Documenso (Docker Compose)
# docker-compose.prod.yml
services:
documenso:
image: documenso/documenso:latest
ports:
- "3000:3000"
environment:
- NEXTAUTH_URL=https://sign.yourcompany.com
- NEXTAUTH_SECRET=${NEXTAUTH_SECRET} # openssl rand -hex 32
- NEXT_PRIVATE_ENCRYPTION_KEY=${ENCRYPTION_KEY}
- NEXT_PRIVATE_ENCRYPTION_SECONDARY_KEY=${ENCRYPTION_SECONDARY_KEY}
- NEXT_PUBLIC_WEBAPP_URL=https://sign.yourcompany.com
- NEXT_PRIVATE_DATABASE_URL=postgresql://documenso:${DB_PASS}@db:5432/documenso
- NEXT_PRIVATE_DIRECT_DATABASE_URL=postgresql://documenso:${DB_PASS}@db:5432/documenso
# SMTP
- NEXT_PRIVATE_SMTP_TRANSPORT=smtp-auth
- NEXT_PRIVATE_SMTP_HOST=${SMTP_HOST}
- NEXT_PRIVATE_SMTP_PORT=587
- NEXT_PRIVATE_SMTP_USERNAME=${SMTP_USER}
- NEXT_PRIVATE_SMTP_PASSWORD=${SMTP_PASS}
- NEXT_PRIVATE_SMTP_FROM_ADDRESS=signing@yourcompany.com
- NEXT_PRIVATE_SMTP_FROM_NAME=YourCompany Signing
# Signing certificate
- NEXT_PRIVATE_SIGNING_PASSPHRASE=${CERT_PASSPHRASE}
volumes:
- ./certs/signing-cert.p12:/opt/documenso/cert.p12:ro
depends_on:
db:
condition: service_healthy
restart: unless-stopped
db:
image: postgres:16-alpine
environment:
POSTGRES_USER: documenso
POSTGRES_PASSWORD: ${DB_PASS}
POSTGRES_DB: documenso
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U documenso"]
interval: 5s
retries: 5
volumes:
pgdata:
Important notes:
- Documenso container runs as non-root (UID 1001) -- ensure mounted files are readable
- Prisma migrations run automatically on contai
Configure Documenso enterprise role-based access control and team management.
Documenso Enterprise RBAC
Overview
Configure team-based access control and enterprise features in Documenso. The Team plan enables multi-user collaboration with shared documents. Enterprise adds SSO (OIDC), audit logging, and organization-level management.
Prerequisites
- Documenso Team or Enterprise plan
- Understanding of RBAC concepts
- For SSO: OIDC-compatible identity provider (Okta, Azure AD, Google Workspace, Auth0)
Documenso Team Model
Organization
├── Team A
│ ├── Owner (full control)
│ ├── Admin (manage members, settings)
│ └── Member (create, view, sign team documents)
├── Team B
│ └── ...
└── Personal Accounts (separate from teams)
Key concepts:
- Teams are separate from personal accounts -- team documents are owned by the team
- Team API keys access all team documents; personal keys only access personal documents
- Each team member can have Owner, Admin, or Member role
- Unlimited teams and users on Team/Enterprise plans (early adopter pricing)
Instructions
Step 1: Team API Key Scoping
import { Documenso } from "@documenso/sdk-typescript";
// Personal key: only YOUR documents
const personalClient = new Documenso({
apiKey: process.env.DOCUMENSO_PERSONAL_KEY!,
});
// Team key: all documents in the team
const teamClient = new Documenso({
apiKey: process.env.DOCUMENSO_TEAM_KEY!,
});
// Common mistake: using personal key for team operations
// Results in 403 Forbidden on team resources
Step 2: Application-Level RBAC
Documenso handles team membership internally. For finer-grained control in your app, implement an authorization layer:
// src/auth/documenso-rbac.ts
type Role = "viewer" | "editor" | "admin" | "owner";
interface TeamMember {
userId: string;
teamId: string;
role: Role;
}
const PERMISSIONS: Record<Role, string[]> = {
viewer: ["documents:read"],
editor: ["documents:read", "documents:create", "documents:send"],
admin: ["documents:read", "documents:create", "documents:send", "documents:delete", "members:manage"],
owner: ["documents:read", "documents:create", "documents:send", "documents:delete", "members:manage", "team:settings", "team:billing"],
};
function hasPermission(member: TeamMember, permission: string): boolean {
return PERMISSIONS[member.role]?.includes(permission) ?? false;
}
// Middleware
function requirePermission(permission: string) {
return (req: Request, res: Response, next: NextFunction) => {
const member = req.teamMember; // Set by auth middleware
if (!hasPermission(member, permCreate a minimal working Documenso example.
Documenso Hello World
Overview
Minimal working example that creates a document, adds a recipient with a signature field, and sends it for signing — all in one script. Uses the Documenso TypeScript SDK (v2 API) with a Python equivalent.
Prerequisites
- Completed
documenso-install-authsetup - Valid API key in
DOCUMENSOAPIKEYenvironment variable - A PDF file to upload (or generate a test one below)
Instructions
Step 1: Generate a Test PDF (Optional)
If you don't have a PDF handy:
npm install pdf-lib
// generate-test-pdf.ts
import { PDFDocument, StandardFonts } from "pdf-lib";
import { writeFileSync } from "fs";
async function createTestPdf() {
const pdf = PDFDocument.create();
const page = (await pdf).addPage([612, 792]); // US Letter
const font = await (await pdf).embedFont(StandardFonts.Helvetica);
page.drawText("Please sign below:", { x: 50, y: 700, size: 16, font });
const bytes = await (await pdf).save();
writeFileSync("test-contract.pdf", bytes);
console.log("Created test-contract.pdf");
}
createTestPdf();
Step 2: Complete Signing Workflow (TypeScript)
// documenso-hello.ts
import { Documenso } from "@documenso/sdk-typescript";
import { readFileSync } from "fs";
async function main() {
const client = new Documenso({
apiKey: process.env.DOCUMENSO_API_KEY!,
});
// 1. Create a document
const doc = await client.documents.createV0({
title: "Hello World Contract",
});
console.log(`Document created: ID ${doc.documentId}`);
// 2. Upload the PDF
const pdfBuffer = readFileSync("test-contract.pdf");
await client.documents.setFileV0(doc.documentId, {
file: new Blob([pdfBuffer], { type: "application/pdf" }),
});
// 3. Add a recipient (signer)
const recipient = await client.documentsRecipients.createV0(doc.documentId, {
email: "signer@example.com",
name: "Jane Doe",
role: "SIGNER",
});
console.log(`Recipient added: ${recipient.recipientId}`);
// 4. Add a signature field at specific coordinates
await client.documentsFields.createV0(doc.documentId, {
recipientId: recipient.recipientId,
type: "SIGNATURE",
pageNumber: 1,
pageX: 50, // X position (left offset, percentage-based 0-100)
pageY: 80, // Y position (top offset, percentage-based 0-100)
pageWidth: 30, // Width as percentage of page
pageHeight: 5, // Height as percentage of page
});
// 5. Send for signing
await client.documents.sendV0(doc.documentId);
console.log("Document sent for signing!");
}
main().catch(console.error);
Run: npx tsx documenso-hello.ts
Manage incident response for Documenso integration issues.
Documenso Incident Runbook
Overview
Step-by-step procedures for responding to Documenso integration incidents. Covers cloud outages, self-hosted issues, and integration failures.
Prerequisites
- Access to monitoring dashboards
- Documenso dashboard access
- Application log access
- On-call escalation contacts defined
Severity Levels
| Level | Description | Examples | Response Time |
|---|---|---|---|
| P1 | Complete signing outage | All API calls failing, no documents can be sent | < 15 min |
| P2 | Degraded functionality | Slow responses, intermittent errors, webhooks delayed | < 1 hour |
| P3 | Minor issue, workaround available | Single document stuck, UI glitch | < 4 hours |
| P4 | Non-urgent | Feature request, documentation gap | Next business day |
Quick Diagnostic Commands
#!/bin/bash
set -euo pipefail
echo "=== Documenso Incident Diagnostic ==="
# 1. Check Documenso cloud status
echo "--- Cloud Status ---"
curl -s https://status.documenso.com/api/v2/status.json 2>/dev/null | jq '.status' || echo "Status page unreachable"
# 2. Check our API connectivity
echo "--- API Connectivity ---"
BASE="${DOCUMENSO_BASE_URL:-https://app.documenso.com/api/v1}"
HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" \
-H "Authorization: Bearer $DOCUMENSO_API_KEY" \
"$BASE/documents?page=1&perPage=1" 2>/dev/null || echo "000")
echo "API Status: $HTTP_CODE"
# 3. Check latency (5 samples)
echo "--- Latency Check ---"
for i in $(seq 1 5); do
LATENCY=$(curl -s -o /dev/null -w "%{time_total}" \
-H "Authorization: Bearer $DOCUMENSO_API_KEY" \
"$BASE/documents?page=1&perPage=1" 2>/dev/null || echo "timeout")
echo " Request $i: ${LATENCY}s"
done
# 4. Self-hosted: check container status
echo "--- Self-Hosted Container (if applicable) ---"
docker ps --filter "name=documenso" --format "{{.Names}}: {{.Status}}" 2>/dev/null || echo "Docker not available or Documenso not self-hosted"
Incident Response Procedures
Scenario 1: Documenso Cloud Outage (5xx Errors)
Symptoms: High error rate, 500/502/503 from Documenso API.
Actions:
- Check status page: https://status.documenso.com
- If Documenso confirms outage:
- Enable degraded mode in your app
- Queue signing requests for later
- Show user-facing message: "Document signing temporarily unavailable"
- Monitor status page for res
Install and configure Documenso SDK/API authentication.
Documenso Install & Auth
Overview
Set up the Documenso SDK and configure API authentication for document signing. Covers the TypeScript SDK (@documenso/sdk-typescript), the Python SDK (documenso-sdk-python), and raw REST API usage. Documenso exposes two API versions: v1 (legacy, documents only) and v2 (envelopes, multi-document, recommended for new work).
Prerequisites
- Node.js 18+ or Python 3.10+
- Package manager (npm, pnpm, yarn, pip, or uv)
- Documenso account — cloud at
app.documenso.comor self-hosted instance - API key generated from the Documenso dashboard
Instructions
Step 1: Install the SDK
TypeScript / Node.js:
npm install @documenso/sdk-typescript
# or
pnpm add @documenso/sdk-typescript
Python:
pip install documenso-sdk-python
# or
uv pip install documenso-sdk-python
Step 2: Generate an API Key
- Log in to your Documenso dashboard (
https://app.documenso.comor your self-hosted URL). - Click your avatar (top-right) and select User settings (or Team settings for team-scoped keys).
- Navigate to the API tokens tab.
- Click Create API Key, give it a descriptive name (e.g.
ci-pipeline-prod). - Copy the key immediately — it is shown only once.
Team API keys inherit the team's document and template access. Personal keys only access your own documents.
Step 3: Store the Key Securely
# .env (never commit this file)
DOCUMENSO_API_KEY=api_xxxxxxxxxxxxxxxxxxxxxxxxxx
Add .env to .gitignore:
echo ".env" >> .gitignore
Step 4: Initialize the Client
TypeScript — v2 API (recommended):
import { Documenso } from "@documenso/sdk-typescript";
const documenso = new Documenso({
apiKey: process.env.DOCUMENSO_API_KEY!,
// For self-hosted, override the server URL:
// serverURL: "https://sign.yourcompany.com/api/v2",
});
TypeScript — v1 REST (legacy):
const BASE = process.env.DOCUMENSO_BASE_URL ?? "https://app.documenso.com/api/v1";
const headers = { Authorization: `Bearer ${process.env.DOCUMENSO_API_KEY}` };
const res = await fetch(`${BASE}/documents`, { headers });
const docs = await res.json();
Python:
from documenso_sdk_python import Documenso
import os
client = Documenso(api_key=os.environ["DOCUMENSO_API_KEY"])
Set up local development environment and testing workflow for Documenso.
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-authsetup - 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
// src/documenso/client.ts
import { Documenso } from "@documenso/sdk-typescript";
let _client: Documenso | null = null;
export function getClient(): Documenso {
if (!_client) {
_client = new Documenso({
apiKey: process.env.DOCUMENSO_API_KEY!,
...(process.env.DOCUMENSO_BASE_URL && {
serverURL: process.env.DOCUMENSO_BASE_URL,
}),
});
}
return _client;
}
// Dev helper: list recent documents for debugging
export async function listRecentDocs(limit = 5) {
const client = getClient();
const { documents } = await client.documents.findV0({
page: 1,
perPage: limit,
orderByColumn: "createdAt",
orderByDirection: "desc",
});
return documents;
}
Step 4: Self-Hosted Local Documenso (Docker)
# Pull the official Documenso Docker image
docker pull documenso/documenso:latest
# Create docker-compose.local.yml
# docker-compose.local.yml
services:
documenso:
image: documenso/documenso:latest
ports:
- "3000:3000"
environment:
- NEXTAUTH_URL=http://localhost:3000
- NEXTAUTH_SECRET=local-dev-secret-change-me
- NEXT_PRIVATE_ENCRYPTION_KEY=local-encryption-key
Execute comprehensive Documenso migration strategies for platform switches.
Documenso Migration Deep Dive
Current State
!npm list 2>/dev/null | head -10
Overview
Comprehensive guide for migrating to Documenso from other e-signature platforms (DocuSign, HelloSign, PandaDoc, Adobe Sign). Uses the Strangler Fig pattern for zero-downtime migration with feature flags and rollback support.
Prerequisites
- Current signing platform documented (APIs, templates, webhooks)
- Documenso account configured (see
documenso-install-auth) - Feature flag infrastructure (LaunchDarkly, environment variables, etc.)
- Parallel run capability (both platforms active during migration)
Migration Strategy: Strangler Fig Pattern
Phase 1: Parallel Systems (Week 1-2)
┌──────────┐ ┌─────────────┐
│ Your App │────▶│ Old Platform │ (100% traffic)
│ │ └─────────────┘
│ │────▶│ Documenso │ (shadow: log only, don't send)
└──────────┘ └─────────────┘
Phase 2: Gradual Cutover (Week 3-4)
┌──────────┐ ┌─────────────┐
│ Your App │────▶│ Old Platform │ (50% traffic via feature flag)
│ │ └─────────────┘
│ │────▶│ Documenso │ (50% traffic)
└──────────┘ └─────────────┘
Phase 3: Full Migration (Week 5+)
┌──────────┐ ┌─────────────┐
│ Your App │────▶│ Documenso │ (100% traffic)
└──────────┘ └─────────────┘
Old platform decommissioned
Instructions
Step 1: Pre-Migration Assessment
// scripts/assess-current-system.ts
// Inventory your current signing platform usage
interface MigrationAssessment {
platform: string;
activeTemplates: number;
documentsPerMonth: number;
webhookEndpoints: string[];
recipientRoles: string[];
fieldTypes: string[];
integrations: string[]; // CRM, database, etc.
}
async function assessCurrentSystem(): Promise<MigrationAssessment> {
// Example for DocuSign
return {
platform: "DocuSign",
activeTemplates: 15,
documentsPerMonth: 200,
webhookEndpoints: [
"https://api.yourapp.com/webhooks/docusign",
],
recipientRoles: ["Signer", "CC", "In Person Signer"],
fieldTypes: ["Signature", "Date", "Text", "Checkbox", "Initial"],
integrations: ["Salesforce", "PostgreSQL"],
};
}
Step 2: Feature Mapping
| DocuSign | HelloSign | Documenso | Notes | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Envelope | Signature Request | Document | Documenso v2 also has Envelopes | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Template | Template | Template | Create via UI, use via API | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Signer | Signer | SIGNER role | Same concept | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| CC | CC | CC role |
Configure Documenso across multiple environments (dev, staging, production).
ReadWriteEdit
Documenso Multi-Environment SetupOverviewConfigure Documenso across development, staging, and production with environment isolation, secret management, and promotion workflows. Documenso cloud offers a staging environment at Prerequisites
Environment Architecture
InstructionsStep 1: Environment Configuration Files
Step 2: Environment-Aware Client FactoryImplement monitoring, logging, and tracing for Documenso integrations.
ReadWriteEdit
Documenso ObservabilityOverviewImplement monitoring, structured logging, and health checks for Documenso integrations. Since Documenso does not expose rate limit headers or usage metrics via API, observability is built around your API call patterns, latency, error rates, and webhook delivery. Prerequisites
InstructionsStep 1: Instrumented Client Wrapper
Step 2: Structured LoggingOptimize Documenso integration performance with caching, batching, and efficient patterns.
ReadWriteEdit
Documenso Performance TuningOverviewOptimize Documenso integrations for speed and efficiency. Key strategies: reduce API round-trips with templates, cache document metadata, batch operations with concurrency control, and use async processing for bulk signing workflows. Prerequisites
InstructionsStep 1: Reduce API Calls with TemplatesThe biggest performance win: templates reduce a multi-step document creation (create + upload + add recipients + add fields + send = 5+ calls) to just 2 calls (create from template + send).
Step 2: Cache Document MetadataExecute Documenso production deployment checklist and rollback procedures.
ReadBash(kubectl:*)Bash(curl:*)Grep
Documenso Production ChecklistOverviewComplete checklist for deploying Documenso integrations to production, covering security, reliability, monitoring, and compliance readiness. Prerequisites
Production Checklist1. Authentication & Secrets
2. Error Handling
3. Performance
4. Monitoring & Alerting
5. Webhooks
6. Data & Compliance
7. Self-Hosted Production (if applicable)
Implement Documenso rate limiting, backoff, and request throttling patterns.
ReadWriteEdit
Documenso Rate LimitsOverviewDocumenso uses a fair-use rate limiting model. There are no published per-minute request quotas -- instead, limits are based on your plan's document allowance and general API fair use. The paid plans (Individual and Team) include unlimited signing and API volume. The free plan has a document limit. If you hit a 429, implement exponential backoff and request queuing. Prerequisites
Documenso Fair Use Model
Documenso explicitly does not price API usage -- they want developers to build on the platform without API cost concerns. The practical limit is abusive traffic patterns (thousands of requests per second). InstructionsStep 1: Exponential Backoff with Jitter
Step 2: Request Queue for Bulk OperationsImplement Documenso reference architecture with best-practice project layout.
ReadGrep
Documenso Reference ArchitectureOverviewProduction-ready architecture for Documenso document signing integrations. Covers project layout, layered service architecture, webhook processing, and data flow. Prerequisites
Recommended Project Structure
Layer Architecture
Rules:
Apply production-ready Documenso SDK patterns for TypeScript and Python.
ReadWriteEdit
Documenso SDK PatternsOverviewProduction-ready patterns for the Documenso TypeScript SDK ( Prerequisites
InstructionsPattern 1: Singleton Client with Configuration
Pattern 2: Typed Document ServiceImplement security best practices for Documenso document signing integrations.
ReadWriteEdit
Documenso Security BasicsOverviewEssential security practices for Documenso integrations: API key management, webhook verification, document access control, and self-hosted signing certificate configuration. Prerequisites
InstructionsStep 1: API Key Security
Key management rules:
Step 2: Key Rotation with Zero Downtime
Step 3: Webhook Secret Verification
Step 4: Document Access ControlManage Documenso API version upgrades and SDK migrations.
ReadWriteEditBash(npm:*)
Documenso Upgrade & MigrationCurrent State! ! OverviewGuide for upgrading between Documenso API versions and SDK updates. Documenso has two API versions: v1 (legacy, document-centric) and v2 (recommended, envelope-based with multi-document support). The TypeScript and Python SDKs use the v2 API by default. Prerequisites
API Version Comparison
InstructionsStep 1: Upgrade SDK to Latest
Step 2: v1 REST to v2 SDK Migration
Step 3: Gradual Migration with Feature FlagsImplement Documenso webhook configuration and event handling.
ReadWriteEditBash(curl:*)Bash(ngrok:*)
Documenso Webhooks & EventsOverviewConfigure and handle Documenso webhooks for real-time document lifecycle notifications. Webhooks require a Teams plan or higher. The webhook secret is sent via the Prerequisites
Supported Events
InstructionsStep 1: Create Webhook via Dashboard
Step 2: Webhook Handler (Express)Ready to use documenso-pack?Related Pluginsexcel-analyst-proProfessional financial modeling toolkit for Claude Code with auto-invoked Skills and Excel MCP integration. Build DCF models, LBO analysis, variance reports, and pivot tables using natural language. brand-strategy-frameworkA 7-part brand strategy framework for building comprehensive brand foundations - the same methodology top agencies use with Fortune 500 clients. clay-packComplete Clay integration skill pack with 30 skills covering data enrichment, waterfall workflows, AI agents, and GTM automation. Flagship+ tier vendor pack. instantly-packComplete Instantly integration skill pack with 24 skills covering cold email, outreach automation, and lead generation. Flagship tier vendor pack. apollo-packComplete Apollo integration skill pack with 24 skills covering sales engagement, prospecting, sequencing, analytics, and outbound automation. Flagship tier vendor pack. juicebox-packComplete Juicebox integration skill pack with 24 skills covering people data, enrichment, contact search, and AI-powered discovery. Flagship tier vendor pack.
Tags
documensodocument-signinge-signaturetemplatesworkflowscontractsopen-source
|