DO

documenso-upgrade-migration

Helper for upgrading Documenso integrations from legacy v1 to v2 API and updating SDK dependencies.

Install

mkdir -p .claude/skills/documenso-upgrade-migration && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/5454" && unzip -o skill.zip -d .claude/skills/documenso-upgrade-migration && rm skill.zip

Installs to .claude/skills/documenso-upgrade-migration

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Manage Documenso API version upgrades and SDK migrations.
57 charsno explicit “when” trigger
Intermediate

Key capabilities

  • Upgrade TypeScript and Python SDKs to latest versions
  • Migrate legacy v1 REST API calls to v2 SDK methods
  • Implement feature flags for gradual v1 to v2 transition
  • Execute self-hosted Documenso container upgrades
  • Verify API parity between v1 and v2 implementations

How it works

The process involves installing the latest SDK, mapping legacy REST endpoints to v2 SDK client methods, and using feature flags to toggle between versions during a gradual rollout. Self-hosted instances are updated by pulling the latest Docker image and restarting the container to trigger automatic database migrations.

Inputs & outputs

You give it
Legacy v1 REST API code or outdated SDK version
You get back
v2 SDK-based implementation with feature flag support

When to use documenso-upgrade-migration

  • Upgrade Documenso SDK
  • Migrate from API v1 to v2
  • Switch to envelope-based documents

About this skill

Documenso Upgrade & Migration

Current State

!npm list @documenso/sdk-typescript 2>/dev/null || echo 'SDK not installed' !npm list documenso-sdk-python 2>/dev/null || pip show documenso-sdk-python 2>/dev/null | head -3 || echo 'Python SDK not installed'

Overview

Guide 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

  • Current Documenso integration working
  • Test environment available
  • Feature flag system (recommended for gradual rollout)

API Version Comparison

Featurev1 (legacy)v2 (recommended)
Base path/api/v1//api/v2/
Document modelDocumentsEnvelopes (can contain multiple documents)
SDK supportREST onlyTypeScript + Python SDK
Template API/templates/{id}/create-documentVia envelope create
AuthenticationAuthorization: BearerAuthorization: Bearer (same)
StatusMaintained, not deprecatedActively developed

Instructions

Step 1: Upgrade SDK to Latest

# Check current version
npm list @documenso/sdk-typescript

# Upgrade
npm install @documenso/sdk-typescript@latest

# Check for breaking changes
npm info @documenso/sdk-typescript changelog

# Python
pip install --upgrade documenso-sdk-python

Step 2: v1 REST to v2 SDK Migration

// BEFORE: v1 REST API
const BASE = "https://app.documenso.com/api/v1";
const headers = { Authorization: `Bearer ${process.env.DOCUMENSO_API_KEY}` };

// Create document
const res = await fetch(`${BASE}/documents`, {
  method: "POST",
  headers: { ...headers, "Content-Type": "application/json" },
  body: JSON.stringify({ title: "Contract" }),
});
const doc = await res.json();

// List documents
const listRes = await fetch(`${BASE}/documents?page=1&perPage=20`, { headers });
const { documents } = await listRes.json();

// AFTER: v2 SDK
import { Documenso } from "@documenso/sdk-typescript";
const client = new Documenso({ apiKey: process.env.DOCUMENSO_API_KEY! });

// Create document
const doc = await client.documents.createV0({ title: "Contract" });

// List documents
const { documents } = await client.documents.findV0({ page: 1, perPage: 20 });

Step 3: Gradual Migration with Feature Flags

// src/documenso/migration.ts
import { Documenso } from "@documenso/sdk-typescript";

const USE_V2 = process.env.DOCUMENSO_USE_V2 === "true";

export async function createDocument(title: string) {
  if (USE_V2) {
    const client = new Documenso({ apiKey: process.env.DOCUMENSO_API_KEY! });
    return client.documents.createV0({ title });
  }

  // Legacy v1
  const res = await fetch("https://app.documenso.com/api/v1/documents", {
    method: "POST",
    headers: {
      Authorization: `Bearer ${process.env.DOCUMENSO_API_KEY}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({ title }),
  });
  return res.json();
}

// Enable gradually:
// 1. DOCUMENSO_USE_V2=true in staging → test
// 2. DOCUMENSO_USE_V2=true for 10% of production traffic
// 3. Monitor error rates
// 4. Roll to 100%
// 5. Remove v1 code

Step 4: Self-Hosted Version Upgrade

# Self-hosted Documenso upgrades are simple:
# 1. Pull new image
docker pull documenso/documenso:latest

# 2. Restart container (migrations run automatically on start)
docker compose -f docker-compose.prod.yml up -d documenso

# 3. Verify
docker logs documenso --tail 20 | grep "prisma migrate"
curl -s https://sign.yourcompany.com/api/health

# Rollback if needed:
docker compose -f docker-compose.prod.yml down documenso
docker pull documenso/documenso:previous-tag
docker compose -f docker-compose.prod.yml up -d documenso

Step 5: Migration Testing

// tests/migration/v1-v2-parity.test.ts
import { describe, it, expect } from "vitest";

describe("v1/v2 API Parity", () => {
  it("creates documents with same result shape", async () => {
    // Create via v1
    const v1Doc = await createDocumentV1("Parity Test");
    // Create via v2
    const v2Doc = await createDocumentV2("Parity Test");

    // Verify same essential fields
    expect(v1Doc.title).toBe(v2Doc.title);
    expect(typeof v1Doc.id).toBe("number");
    expect(typeof v2Doc.documentId).toBe("number");
  });

  it("lists documents consistently", async () => {
    const v1List = await listDocumentsV1();
    const v2List = await listDocumentsV2();

    // Same documents visible via both APIs
    expect(v1List.length).toBe(v2List.length);
  });
});

Migration Checklist

  • Current SDK version documented
  • Changelog reviewed for breaking changes
  • Feature branch created for migration
  • v2 SDK installed alongside v1 code
  • Feature flag for gradual rollout
  • Parity tests passing (v1 and v2 produce same results)
  • Staging fully tested on v2
  • Production rolled out gradually
  • v1 code removed after full rollout
  • Self-hosted: container upgraded and migrations verified

Error Handling

IssueCauseSolution
ID format mismatchv1 returns id, v2 returns documentIdUse adapter/mapping layer
Missing fieldAPI change in new versionUpdate to new field names
Enum case sensitivityv2 SDK uses uppercase enumsUse "SIGNER" not "signer"
Template API differencev1 templates vs v2 envelopesCheck API version for template operations

Resources

Next Steps

For CI/CD integration, see documenso-ci-integration.

When not to use it

  • Projects requiring legacy v1 document-centric models without envelope support
  • Environments lacking access to test infrastructure for parity verification

Prerequisites

Working Documenso integrationTest environmentFeature flag system

Limitations

  • v1 returns id while v2 returns documentId
  • v2 SDK requires uppercase enums
  • Template operations differ between v1 and v2

How it compares

Unlike manual API refactoring, this workflow provides a structured parity testing approach and a feature-flagged migration path to minimize production downtime.

Compared to similar skills

documenso-upgrade-migration side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
documenso-upgrade-migration (this skill)127dCautionIntermediate
mcp-builder1363moReviewAdvanced
stripe-integration482moNo flagsAdvanced
deepwiki-rs259moReviewIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

More by jeremylongshore

View all by jeremylongshore

analyzing-logs

jeremylongshore

Analyze application logs to detect performance issues, identify error patterns, and improve stability by extracting key insights.

14123

ollama-setup

jeremylongshore

Configure auto-configure Ollama when user needs local LLM deployment, free AI alternatives, or wants to eliminate hosted API costs. Trigger phrases: "install ollama", "local AI", "free LLM", "self-hosted AI", "replace OpenAI", "no API costs". Use when appropriate context detected. Trigger with relevant phrases based on skill purpose.

1167

backtesting-trading-strategies

jeremylongshore

Backtest crypto and traditional trading strategies against historical data. Calculates performance metrics (Sharpe, Sortino, max drawdown), generates equity curves, and optimizes strategy parameters. Use when user wants to test a trading strategy, validate signals, or compare approaches. Trigger with phrases like "backtest strategy", "test trading strategy", "historical performance", "simulate trades", "optimize parameters", or "validate signals".

1071

generating-database-seed-data

jeremylongshore

Process this skill enables AI assistant to generate realistic test data and database seed scripts for development and testing environments. it uses faker libraries to create realistic data, maintains relational integrity, and allows configurable data volumes. u... Use when working with databases or data models. Trigger with phrases like 'database', 'query', or 'schema'.

1033

cursor-codebase-indexing

jeremylongshore

Execute set up and optimize Cursor codebase indexing. Triggers on "cursor index setup", "codebase indexing", "index codebase", "cursor semantic search". Use when working with cursor codebase indexing functionality. Trigger with phrases like "cursor codebase indexing", "cursor indexing", "cursor".

885

testing-mobile-apps

jeremylongshore

Execute mobile app testing on iOS and Android devices/simulators. Use when performing specialized testing. Trigger with phrases like "test mobile app", "run iOS tests", or "validate Android functionality".

810

You might also like

mcp-builder

anthropics

Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).

136215

stripe-integration

wshobson

Implement Stripe payment processing for robust, PCI-compliant payment flows including checkout, subscriptions, and webhooks. Use when integrating Stripe payments, building subscription systems, or implementing secure checkout flows.

48165

deepwiki-rs

sopaco

AI-powered Rust documentation generation engine for comprehensive codebase analysis, C4 architecture diagrams, and automated technical documentation. Use when Claude needs to analyze source code, understand software architecture, generate technical specs, or create professional documentation from any programming language.

25170

langchain

zechenzhangAGI

Framework for building LLM-powered applications with agents, chains, and RAG. Supports multiple providers (OpenAI, Anthropic, Google), 500+ integrations, ReAct agents, tool calling, memory management, and vector store retrieval. Use for building chatbots, question-answering systems, autonomous agents, or RAG applications. Best for rapid prototyping and production deployments.

26138

copilot-sdk

github

Build agentic applications with GitHub Copilot SDK. Use when embedding AI agents in apps, creating custom tools, implementing streaming responses, managing sessions, connecting to MCP servers, or creating custom agents. Triggers on Copilot SDK, GitHub SDK, agentic app, embed Copilot, programmable agent, MCP server, custom agent.

763

langfuse

davila7

Expert in Langfuse - the open-source LLM observability platform. Covers tracing, prompt management, evaluation, datasets, and integration with LangChain, LlamaIndex, and OpenAI. Essential for debugging, monitoring, and improving LLM applications in production. Use when: langfuse, llm observability, llm tracing, prompt management, llm evaluation.

743

Search skills

Search the agent skills registry