The Open Source DocuSign Alternative.
TypeScript digital-signaturedocument-signingdocusign-alternativee-signatureesignesignaturenext-authnextjsopen-sourcepades-standardpdfpdf-signpdf-signaturepostgresqlprismaself-hostedsigningtypescript
feat: docs v2 (#2460)
Lucas Smithb92c53dbb23b
diff --git a/.agents/plans/pale-lemon-rock-pnpm-migration.md b/.agents/plans/pale-lemon-rock-pnpm-migration.mdnew file mode 100644index 000000000..7052cb7ba--- /dev/null+++ b/.agents/plans/pale-lemon-rock-pnpm-migration.md@@ -0,0 +1,312 @@+---+date: 2026-02-26+title: pnpm Migration+---++## Overview++Migrate from npm to pnpm to eliminate dependency resolution duplication issues that cause bundler problems. The current npm workspace setup results in nested `node_modules` copies that don't deduplicate reliably, requiring manual hoisting and `npm dedupe` cycles. pnpm's content-addressable store and strict symlink structure eliminates this class of problem entirely.++## Current State++- **Package manager:** [email protected] with `legacy-peer-deps=true` and `prefer-dedupe=true`+- **Workspaces:** 18 total (3 apps, 15 packages) declared in root `package.json` `workspaces` field+- **Lockfile:** `package-lock.json`+- **Patches:** `patch-package` with one patch (`@ai-sdk+google-vertex+3.0.81`)+- **Overrides:** `lodash`, `pdfjs-dist`, `typescript`, `zod` in root `package.json`+- **Syncpack:** installed but unconfigured (no `.syncpackrc`)+- **Heavy duplication:** `zod` in 7 workspaces, `ts-pattern` in 9, `luxon` in 8, `react` in 6, etc.+- **Docker:** `turbo prune` → `npm ci` → `npm ci --only=production` multi-stage build+- **Existing Dockerfiles:** `docker/Dockerfile` (primary, npm), `apps/remix/Dockerfile.pnpm` (already exists, needs review)++## Migration Steps++### Phase 1: Core Migration++#### Step 1: Enable pnpm via corepack++```bash+corepack enable pnpm+corepack use pnpm@latest+```++This adds a `"packageManager"` field to root `package.json` (e.g. `"packageManager": "[email protected]"`). Remove the existing `"engines"` npm constraint if present.++#### Step 2: Create `pnpm-workspace.yaml`++```yaml+packages:+ - apps/*+ - packages/*+```++Remove the `"workspaces"` field from root `package.json` — pnpm uses `pnpm-workspace.yaml` instead.++#### Step 3: Convert lockfile++```bash+pnpm import+```++This reads `package-lock.json` and generates `pnpm-lock.yaml`. After verifying, delete `package-lock.json`.++#### Step 4: Create `.npmrc` for pnpm++Replace the current `.npmrc` contents. The existing settings (`legacy-peer-deps=true`, `prefer-dedupe=true`) are npm-specific.++```ini+# Hoist packages that expect to be resolvable from any workspace.+# Start strict, add patterns here only as needed.+shamefully-hoist=true+```++> **Note:** `shamefully-hoist=true` is the pragmatic starting point. It mimics npm's flat `node_modules` layout. Once the migration is stable, this can be tightened to `hoist-pattern[]` entries for specific packages that need it, moving toward pnpm's strict isolation model.++#### Step 5: Clean install++```bash+rm -rf node_modules apps/*/node_modules packages/*/node_modules+pnpm install+```++Verify the install completes without errors. Fix any peer dependency warnings — pnpm is stricter than npm with `legacy-peer-deps=true`.++#### Step 6: Convert `overrides` to `pnpm.overrides`++In root `package.json`, move the `overrides` block under `pnpm`:++```json+{+ "pnpm": {+ "overrides": {+ "lodash": "4.17.23",+ "pdfjs-dist": "5.4.296",+ "typescript": "5.6.2",+ "zod": "^3.25.76"+ }+ }+}+```++Remove the top-level `overrides` field (that's npm-specific).++#### Step 7: Convert patch-package to pnpm patches++pnpm has native patching. Convert the existing `@ai-sdk+google-vertex+3.0.81` patch:++```bash+# Remove patch-package dependency and postinstall script+# Then use pnpm's native patching:+pnpm patch @ai-sdk/[email protected]+# Apply the same changes from patches/@ai-sdk+google-vertex+3.0.81.patch+pnpm patch-commit <temp-dir>+```++This adds a `pnpm.patchedDependencies` entry to root `package.json` and stores the patch in a `patches/` directory (pnpm's own format). Remove `patch-package` from dependencies and the `postinstall` script.++### Phase 2: Catalogs++#### Step 8: Identify catalog candidates++Packages duplicated across 3+ workspaces are prime candidates:++| Package | Workspaces | Catalog? |+| ----------------------------------------------- | ---------- | ---------------------- |+| `zod` | 7 | Yes |+| `ts-pattern` | 9 | Yes |+| `luxon` | 8 | Yes |+| `react` / `react-dom` | 6 / 3 | Yes |+| `typescript` | 6 | Yes |+| `nanoid` | 4 | Yes |+| `@lingui/core` / `macro` / `react` | 2-3 | Yes |+| `@simplewebauthn/server` | 3 | Yes |+| `@documenso/*` (internal) | varies | No (use `workspace:*`) |+| `@aws-sdk/*` | 2 | Yes |+| `hono` | 2 | Yes |+| `posthog-node` / `posthog-js` | 2 | Yes |+| `remeda` | 3 | Yes |+| `@tanstack/react-query` | 2 | Yes |+| `@trpc/*` | 2 | Yes |+| `superjson` | 2 | Yes |+| `kysely` | 2 | Yes |+| `@types/react` / `@types/node` / `@types/luxon` | 3-4 | Yes |++#### Step 9: Define catalogs in `pnpm-workspace.yaml`++```yaml+packages:+ - apps/*+ - packages/*++catalog:+ # Core+ react: ^18+ react-dom: ^18+ typescript: 5.6.2+ zod: ^3.25.76++ # Shared utilities+ ts-pattern: <current-version>+ luxon: ^3.7.2+ nanoid: ^5.1.6+ remeda: <current-version>+ superjson: ^2.2.5++ # AWS+ '@aws-sdk/client-s3': ^3.998.0+ '@aws-sdk/client-sesv2': ^3.998.0+ '@aws-sdk/cloudfront-signer': ^3.998.0+ '@aws-sdk/s3-request-presigner': ^3.998.0+ '@aws-sdk/signature-v4-crt': ^3.998.0++ # Framework+ hono: 4.12.2+ '@tanstack/react-query': <current-version>+ '@trpc/client': 11.8.1+ '@trpc/react-query': 11.8.1+ '@trpc/server': 11.8.1++ # i18n+ '@lingui/core': ^5.6.0+ '@lingui/macro': ^5.6.0+ '@lingui/react': ^5.6.0++ # Auth+ '@simplewebauthn/server': <current-version>++ # Observability+ posthog-node: 4.18.0+ posthog-js: <current-version>++ # Database+ kysely: <current-version>+ '@prisma/client': ^6.19.0+ prisma: ^6.19.0++ # Types+ '@types/react': <current-version>+ '@types/react-dom': <current-version>+ '@types/node': ^20+ '@types/luxon': <current-version>+```++#### Step 10: Update workspace `package.json` files++Replace pinned versions with `catalog:` protocol for all cataloged packages:++```json+{+ "dependencies": {+ "zod": "catalog:",+ "ts-pattern": "catalog:",+ "luxon": "catalog:"+ }+}+```++This is a mechanical find-and-replace across all workspace `package.json` files.++### Phase 3: Internal Workspace References++#### Step 11: Convert internal references to `workspace:*`++All `@documenso/*` internal package references currently use `"*"`. Convert to pnpm's `workspace:*` protocol:++```json+{+ "dependencies": {+ "@documenso/lib": "workspace:*",+ "@documenso/prisma": "workspace:*"+ }+}+```++This makes the workspace resolution explicit and prevents accidental resolution to a published version.++### Phase 4: Docker & CI++#### Step 12: Update primary Dockerfile (`docker/Dockerfile`)++The existing multi-stage build needs to change:++1. **base:** Add pnpm — `corepack enable pnpm` or install via `npm i -g pnpm`+2. **builder:** `turbo prune` still works with pnpm. Output structure is the same.+3. **installer:**+ - Replace `npm ci` with `pnpm install --frozen-lockfile`+ - Copy `pnpm-lock.yaml` and `pnpm-workspace.yaml` instead of `package-lock.json`+ - Remove `patch-package` from postinstall (pnpm patches are applied natively)+4. **runner:**+ - Replace `npm ci --only=production` with `pnpm install --frozen-lockfile --prod`+ - Or use `pnpm deploy` for standalone output (copies only production deps to a flat directory)++Review `apps/remix/Dockerfile.pnpm` — it already exists and may have most of this solved. Reconcile with the primary `docker/Dockerfile`.++#### Step 13: Update CI workflows++Search for all `npm ci`, `npm install`, `npm run` in CI config files (`.github/workflows/`, etc.) and replace with `pnpm install --frozen-lockfile`, `pnpm run`, etc.++Ensure corepack is enabled in CI runners:++```yaml+- run: corepack enable pnpm+```++#### Step 14: Update turborepo config++Turbo works with pnpm out of the box. The `turbo.json` should not need changes. Verify `turbo prune` generates correct output with pnpm lockfile.++### Phase 5: Cleanup & Tighten++#### Step 15: Remove npm-specific tooling++- Remove `syncpack` (catalogs replace its purpose)+- Remove `patch-package` (pnpm native patches replace it)+- Remove `"workspaces"` from root `package.json` if not already done+- Delete `package-lock.json`+- Update `.gitignore` if needed (pnpm store is outside the repo by default)++#### Step 16: Tighten hoisting (optional, future)++Once stable, replace `shamefully-hoist=true` with targeted hoist patterns:++```ini+shamefully-hoist=false+hoist-pattern[]=*eslint*+hoist-pattern[]=*prettier*+# Add others as discovered+```++This moves toward strict isolation where each package can only import what it declares. Catches phantom dependency issues. Do this incrementally — let the bundler tell you what breaks.++#### Step 17: Remove root-level dependency hoisting++With catalogs and strict resolution, dependencies currently hoisted to root `package.json` for deduplication purposes can be moved back to the workspaces that actually use them. The root `package.json` should only contain tooling deps (`turbo`, `prettier`, `eslint`, etc.) and `pnpm.overrides`.++## Risks and Mitigations++1. **Phantom dependencies surface:** pnpm's strict isolation will expose imports that work today only because npm hoisted them. `shamefully-hoist=true` defers this, but tightening later will reveal them.+ - **Mitigation:** Start with `shamefully-hoist=true`. Tighten incrementally after the migration is stable.++2. **Peer dependency strictness:** pnpm enforces peer deps by default. The current `.npmrc` has `legacy-peer-deps=true` which suppresses all peer dep errors.+ - **Mitigation:** Run `pnpm install` and address peer dep warnings. Most will be resolvable by adding missing peer deps to the relevant workspace.++3. **Docker build breakage:** The `turbo prune` + `npm ci` pipeline is battle-tested. Switching to pnpm changes the install semantics.+ - **Mitigation:** The existing `Dockerfile.pnpm` in `apps/remix/` provides a reference. Test the Docker build in CI before merging.++4. **CI cache invalidation:** Switching lockfiles invalidates all CI dependency caches.+ - **Mitigation:** Update cache keys to use `pnpm-lock.yaml` hash. First CI run will be slower, subsequent runs will cache normally.++5. **Turbo + pnpm compatibility:** Turbo has first-class pnpm support, but `turbo prune` output format may differ slightly.+ - **Mitigation:** Test `turbo prune --scope=@documenso/remix --docker` and verify output structure before updating Dockerfile.++## Verification Checklist++- [ ] `pnpm install` succeeds with no errors+- [ ] `pnpm run build` succeeds (all workspaces)+- [ ] `pnpm run lint` passes+- [ ] `pnpm run dev` starts correctly+- [ ] Docker build produces a working image+- [ ] E2E tests pass (`pnpm run test:e2e`)+- [ ] No duplicate package copies in `node_modules` for key deps (`zod`, `react`, `typescript`)+- [ ] `pnpm audit` shows same or better results than current npm audit+- [ ] CI pipeline passes end-to-enddiff --git a/.agents/skills/agent-browser/SKILL.md b/.agents/skills/agent-browser/SKILL.mdnew file mode 100644index 000000000..f07d3f70b--- /dev/null+++ b/.agents/skills/agent-browser/SKILL.md@@ -0,0 +1,207 @@+---+name: agent-browser+description: Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to "open a website", "fill out a form", "click a button", "take a screenshot", "scrape data from a page", "test this web app", "login to a site", "automate browser actions", or any task requiring programmatic web interaction.+allowed-tools: Bash(agent-browser:*)+---++# Browser Automation with agent-browser++## Core Workflow++Every browser automation follows this pattern:++1. **Navigate**: `agent-browser open <url>`+2. **Snapshot**: `agent-browser snapshot -i` (get element refs like `@e1`, `@e2`)+3. **Interact**: Use refs to click, fill, select+4. **Re-snapshot**: After navigation or DOM changes, get fresh refs++```bash+agent-browser open https://example.com/form+agent-browser snapshot -i+# Output: @e1 [input type="email"], @e2 [input type="password"], @e3 [button] "Submit"++agent-browser fill @e1 "[email protected]"+agent-browser fill @e2 "password123"+agent-browser click @e3+agent-browser wait --load networkidle+agent-browser snapshot -i # Check result+```++## Essential Commands++```bash+# Navigation+agent-browser open <url> # Navigate (aliases: goto, navigate)+agent-browser close # Close browser++# Snapshot+agent-browser snapshot -i # Interactive elements with refs (recommended)+agent-browser snapshot -s "#selector" # Scope to CSS selector++# Interaction (use @refs from snapshot)+agent-browser click @e1 # Click element+agent-browser fill @e2 "text" # Clear and type text+agent-browser type @e2 "text" # Type without clearing+agent-browser select @e1 "option" # Select dropdown option+agent-browser check @e1 # Check checkbox+agent-browser press Enter # Press key+agent-browser scroll down 500 # Scroll page++# Get information+agent-browser get text @e1 # Get element text+agent-browser get url # Get current URL+agent-browser get title # Get page title++# Wait+agent-browser wait @e1 # Wait for element+agent-browser wait --load networkidle # Wait for network idle+agent-browser wait --url "**/page" # Wait for URL pattern+agent-browser wait 2000 # Wait milliseconds++# Capture+agent-browser screenshot # Screenshot to temp dir+agent-browser screenshot --full # Full page screenshot+agent-browser pdf output.pdf # Save as PDF+```++## Common Patterns++### Form Submission++```bash+agent-browser open https://example.com/signup+agent-browser snapshot -i+agent-browser fill @e1 "Jane Doe"+agent-browser fill @e2 "[email protected]"+agent-browser select @e3 "California"+agent-browser check @e4+agent-browser click @e5+agent-browser wait --load networkidle+```++### Authentication with State Persistence++```bash+# Login once and save state+agent-browser open https://app.example.com/login+agent-browser snapshot -i+agent-browser fill @e1 "$USERNAME"+agent-browser fill @e2 "$PASSWORD"+agent-browser click @e3+agent-browser wait --url "**/dashboard"+agent-browser state save auth.json++# Reuse in future sessions+agent-browser state load auth.json+agent-browser open https://app.example.com/dashboard+```++### Data Extraction++```bash+agent-browser open https://example.com/products+agent-browser snapshot -i+agent-browser get text @e5 # Get specific element text+agent-browser get text body > page.txt # Get all page text++# JSON output for parsing+agent-browser snapshot -i --json+agent-browser get text @e1 --json+```++### Parallel Sessions++```bash+agent-browser --session site1 open https://site-a.com+agent-browser --session site2 open https://site-b.com++agent-browser --session site1 snapshot -i+agent-browser --session site2 snapshot -i++agent-browser session list+```++### Visual Browser (Debugging)++```bash+agent-browser --headed open https://example.com+agent-browser highlight @e1 # Highlight element+agent-browser record start demo.webm # Record session+```++### iOS Simulator (Mobile Safari)++```bash+# List available iOS simulators+agent-browser device list++# Launch Safari on a specific device+agent-browser -p ios --device "iPhone 16 Pro" open https://example.com++# Same workflow as desktop - snapshot, interact, re-snapshot+agent-browser -p ios snapshot -i+agent-browser -p ios tap @e1 # Tap (alias for click)+agent-browser -p ios fill @e2 "text"+agent-browser -p ios swipe up # Mobile-specific gesture++# Take screenshot+agent-browser -p ios screenshot mobile.png++# Close session (shuts down simulator)+agent-browser -p ios close+```++**Requirements:** macOS with Xcode, Appium (`npm install -g appium && appium driver install xcuitest`)++**Real devices:** Works with physical iOS devices if pre-configured. Use `--device "<UDID>"` where UDID is from `xcrun xctrace list devices`.++## Ref Lifecycle (Important)++Refs (`@e1`, `@e2`, etc.) are invalidated when the page changes. Always re-snapshot after:++- Clicking links or buttons that navigate+- Form submissions+- Dynamic content loading (dropdowns, modals)++```bash+agent-browser click @e5 # Navigates to new page+agent-browser snapshot -i # MUST re-snapshot+agent-browser click @e1 # Use new refs+```++## Semantic Locators (Alternative to Refs)++When refs are unavailable or unreliable, use semantic locators:++```bash+agent-browser find text "Sign In" click+agent-browser find label "Email" fill "[email protected]"+agent-browser find role button click --name "Submit"+agent-browser find placeholder "Search" type "query"+agent-browser find testid "submit-btn" click+```++## Deep-Dive Documentation++| Reference | When to Use |+|-----------|-------------|+| [references/commands.md](references/commands.md) | Full command reference with all options |+| [references/snapshot-refs.md](references/snapshot-refs.md) | Ref lifecycle, invalidation rules, troubleshooting |+| [references/session-management.md](references/session-management.md) | Parallel sessions, state persistence, concurrent scraping |+| [references/authentication.md](references/authentication.md) | Login flows, OAuth, 2FA handling, state reuse |+| [references/video-recording.md](references/video-recording.md) | Recording workflows for debugging and documentation |+| [references/proxy-support.md](references/proxy-support.md) | Proxy configuration, geo-testing, rotating proxies |++## Ready-to-Use Templates++| Template | Description |+|----------|-------------|+| [templates/form-automation.sh](templates/form-automation.sh) | Form filling with validation |+| [templates/authenticated-session.sh](templates/authenticated-session.sh) | Login once, reuse state |+| [templates/capture-workflow.sh](templates/capture-workflow.sh) | Content extraction with screenshots |++```bash+./templates/form-automation.sh https://example.com/form+./templates/authenticated-session.sh https://app.example.com/login+./templates/capture-workflow.sh https://example.com ./output+```diff --git a/.agents/skills/agent-browser/references/authentication.md b/.agents/skills/agent-browser/references/authentication.mdnew file mode 100644index 000000000..12ef5e41b--- /dev/null+++ b/.agents/skills/agent-browser/references/authentication.md@@ -0,0 +1,202 @@+# Authentication Patterns++Login flows, session persistence, OAuth, 2FA, and authenticated browsing.++**Related**: [session-management.md](session-management.md) for state persistence details, [SKILL.md](../SKILL.md) for quick start.++## Contents++- [Basic Login Flow](#basic-login-flow)+- [Saving Authentication State](#saving-authentication-state)+- [Restoring Authentication](#restoring-authentication)+- [OAuth / SSO Flows](#oauth--sso-flows)+- [Two-Factor Authentication](#two-factor-authentication)+- [HTTP Basic Auth](#http-basic-auth)+- [Cookie-Based Auth](#cookie-based-auth)+- [Token Refresh Handling](#token-refresh-handling)+- [Security Best Practices](#security-best-practices)++## Basic Login Flow++```bash+# Navigate to login page+agent-browser open https://app.example.com/login+agent-browser wait --load networkidle++# Get form elements+agent-browser snapshot -i+# Output: @e1 [input type="email"], @e2 [input type="password"], @e3 [button] "Sign In"++# Fill credentials+agent-browser fill @e1 "[email protected]"+agent-browser fill @e2 "password123"++# Submit+agent-browser click @e3+agent-browser wait --load networkidle++# Verify login succeeded+agent-browser get url # Should be dashboard, not login+```++## Saving Authentication State++After logging in, save state for reuse:++```bash+# Login first (see above)+agent-browser open https://app.example.com/login+agent-browser snapshot -i+agent-browser fill @e1 "[email protected]"+agent-browser fill @e2 "password123"+agent-browser click @e3+agent-browser wait --url "**/dashboard"++# Save authenticated state+agent-browser state save ./auth-state.json+```++## Restoring Authentication++Skip login by loading saved state:++```bash+# Load saved auth state+agent-browser state load ./auth-state.json++# Navigate directly to protected page+agent-browser open https://app.example.com/dashboard++# Verify authenticated+agent-browser snapshot -i+```++## OAuth / SSO Flows++For OAuth redirects:++```bash+# Start OAuth flow+agent-browser open https://app.example.com/auth/google++# Handle redirects automatically+agent-browser wait --url "**/accounts.google.com**"+agent-browser snapshot -i++# Fill Google credentials+agent-browser fill @e1 "[email protected]"+agent-browser click @e2 # Next button+agent-browser wait 2000+agent-browser snapshot -i+agent-browser fill @e3 "password"+agent-browser click @e4 # Sign in++# Wait for redirect back+agent-browser wait --url "**/app.example.com**"+agent-browser state save ./oauth-state.json+```++## Two-Factor Authentication++Handle 2FA with manual intervention:++```bash+# Login with credentials+agent-browser open https://app.example.com/login --headed # Show browser+agent-browser snapshot -i+agent-browser fill @e1 "[email protected]"+agent-browser fill @e2 "password123"+agent-browser click @e3++# Wait for user to complete 2FA manually+echo "Complete 2FA in the browser window..."+agent-browser wait --url "**/dashboard" --timeout 120000++# Save state after 2FA+agent-browser state save ./2fa-state.json+```++## HTTP Basic Auth++For sites using HTTP Basic Authentication:++```bash+# Set credentials before navigation+agent-browser set credentials username password++# Navigate to protected resource+agent-browser open https://protected.example.com/api+```++## Cookie-Based Auth++Manually set authentication cookies:++```bash+# Set auth cookie+agent-browser cookies set session_token "abc123xyz"++# Navigate to protected page+agent-browser open https://app.example.com/dashboard+```++## Token Refresh Handling++For sessions with expiring tokens:++```bash+#!/bin/bash+# Wrapper that handles token refresh++STATE_FILE="./auth-state.json"++# Try loading existing state+if [[ -f "$STATE_FILE" ]]; then+ agent-browser state load "$STATE_FILE"+ agent-browser open https://app.example.com/dashboard++ # Check if session is still valid+ URL=$(agent-browser get url)+ if [[ "$URL" == *"/login"* ]]; then+ echo "Session expired, re-authenticating..."+ # Perform fresh login+ agent-browser snapshot -i+ agent-browser fill @e1 "$USERNAME"+ agent-browser fill @e2 "$PASSWORD"+ agent-browser click @e3+ agent-browser wait --url "**/dashboard"+ agent-browser state save "$STATE_FILE"+ fi+else+ # First-time login+ agent-browser open https://app.example.com/login+ # ... login flow ...+fi+```++## Security Best Practices++1. **Never commit state files** - They contain session tokens+ ```bash+ echo "*.auth-state.json" >> .gitignore+ ```++2. **Use environment variables for credentials**+ ```bash+ agent-browser fill @e1 "$APP_USERNAME"+ agent-browser fill @e2 "$APP_PASSWORD"+ ```++3. **Clean up after automation**+ ```bash+ agent-browser cookies clear+ rm -f ./auth-state.json+ ```++4. **Use short-lived sessions for CI/CD**+ ```bash+ # Don't persist state in CI+ agent-browser open https://app.example.com/login+ # ... login and perform actions ...+ agent-browser close # Session ends, nothing persisted+ ```diff --git a/.agents/skills/agent-browser/references/commands.md b/.agents/skills/agent-browser/references/commands.mdnew file mode 100644index 000000000..8744accf7--- /dev/null+++ b/.agents/skills/agent-browser/references/commands.md@@ -0,0 +1,259 @@+# Command Reference++Complete reference for all agent-browser commands. For quick start and common patterns, see SKILL.md.++## Navigation++```bash+agent-browser open <url> # Navigate to URL (aliases: goto, navigate)+ # Supports: https://, http://, file://, about:, data://+ # Auto-prepends https:// if no protocol given+agent-browser back # Go back+agent-browser forward # Go forward+agent-browser reload # Reload page+agent-browser close # Close browser (aliases: quit, exit)+agent-browser connect 9222 # Connect to browser via CDP port+```++## Snapshot (page analysis)++```bash+agent-browser snapshot # Full accessibility tree+agent-browser snapshot -i # Interactive elements only (recommended)+agent-browser snapshot -c # Compact output+agent-browser snapshot -d 3 # Limit depth to 3+agent-browser snapshot -s "#main" # Scope to CSS selector+```++## Interactions (use @refs from snapshot)++```bash+agent-browser click @e1 # Click+agent-browser dblclick @e1 # Double-click+agent-browser focus @e1 # Focus element+agent-browser fill @e2 "text" # Clear and type+agent-browser type @e2 "text" # Type without clearing+agent-browser press Enter # Press key (alias: key)+agent-browser press Control+a # Key combination+agent-browser keydown Shift # Hold key down+agent-browser keyup Shift # Release key+agent-browser hover @e1 # Hover+agent-browser check @e1 # Check checkbox+agent-browser uncheck @e1 # Uncheck checkbox+agent-browser select @e1 "value" # Select dropdown option+agent-browser select @e1 "a" "b" # Select multiple options+agent-browser scroll down 500 # Scroll page (default: down 300px)+agent-browser scrollintoview @e1 # Scroll element into view (alias: scrollinto)+agent-browser drag @e1 @e2 # Drag and drop+agent-browser upload @e1 file.pdf # Upload files+```++## Get Information++```bash+agent-browser get text @e1 # Get element text+agent-browser get html @e1 # Get innerHTML+agent-browser get value @e1 # Get input value+agent-browser get attr @e1 href # Get attribute+agent-browser get title # Get page title+agent-browser get url # Get current URL+agent-browser get count ".item" # Count matching elements+agent-browser get box @e1 # Get bounding box+agent-browser get styles @e1 # Get computed styles (font, color, bg, etc.)+```++## Check State++```bash+agent-browser is visible @e1 # Check if visible+agent-browser is enabled @e1 # Check if enabled+agent-browser is checked @e1 # Check if checked+```++## Screenshots and PDF++```bash+agent-browser screenshot # Save to temporary directory+agent-browser screenshot path.png # Save to specific path+agent-browser screenshot --full # Full page+agent-browser pdf output.pdf # Save as PDF+```++## Video Recording++```bash+agent-browser record start ./demo.webm # Start recording+agent-browser click @e1 # Perform actions+agent-browser record stop # Stop and save video+agent-browser record restart ./take2.webm # Stop current + start new+```++## Wait++```bash+agent-browser wait @e1 # Wait for element+agent-browser wait 2000 # Wait milliseconds+agent-browser wait --text "Success" # Wait for text (or -t)+agent-browser wait --url "**/dashboard" # Wait for URL pattern (or -u)+agent-browser wait --load networkidle # Wait for network idle (or -l)+agent-browser wait --fn "window.ready" # Wait for JS condition (or -f)+```++## Mouse Control++```bash+agent-browser mouse move 100 200 # Move mouse+agent-browser mouse down left # Press button+agent-browser mouse up left # Release button+agent-browser mouse wheel 100 # Scroll wheel+```++## Semantic Locators (alternative to refs)++```bash+agent-browser find role button click --name "Submit"+agent-browser find text "Sign In" click+agent-browser find text "Sign In" click --exact # Exact match only+agent-browser find label "Email" fill "[email protected]"+agent-browser find placeholder "Search" type "query"+agent-browser find alt "Logo" click+agent-browser find title "Close" click+agent-browser find testid "submit-btn" click+agent-browser find first ".item" click+agent-browser find last ".item" click+agent-browser find nth 2 "a" hover+```++## Browser Settings++```bash+agent-browser set viewport 1920 1080 # Set viewport size+agent-browser set device "iPhone 14" # Emulate device+agent-browser set geo 37.7749 -122.4194 # Set geolocation (alias: geolocation)+agent-browser set offline on # Toggle offline mode+agent-browser set headers '{"X-Key":"v"}' # Extra HTTP headers+agent-browser set credentials user pass # HTTP basic auth (alias: auth)+agent-browser set media dark # Emulate color scheme+agent-browser set media light reduced-motion # Light mode + reduced motion+```++## Cookies and Storage++```bash+agent-browser cookies # Get all cookies+agent-browser cookies set name value # Set cookie+agent-browser cookies clear # Clear cookies+agent-browser storage local # Get all localStorage+agent-browser storage local key # Get specific key+agent-browser storage local set k v # Set value+agent-browser storage local clear # Clear all+```++## Network++```bash+agent-browser network route <url> # Intercept requests+agent-browser network route <url> --abort # Block requests+agent-browser network route <url> --body '{}' # Mock response+agent-browser network unroute [url] # Remove routes+agent-browser network requests # View tracked requests+agent-browser network requests --filter api # Filter requests+```++## Tabs and Windows++```bash+agent-browser tab # List tabs+agent-browser tab new [url] # New tab+agent-browser tab 2 # Switch to tab by index+agent-browser tab close # Close current tab+agent-browser tab close 2 # Close tab by index+agent-browser window new # New window+```++## Frames++```bash+agent-browser frame "#iframe" # Switch to iframe+agent-browser frame main # Back to main frame+```++## Dialogs++```bash+agent-browser dialog accept [text] # Accept dialog+agent-browser dialog dismiss # Dismiss dialog+```++## JavaScript++```bash+agent-browser eval "document.title" # Simple expressions only+agent-browser eval -b "<base64>" # Any JavaScript (base64 encoded)+agent-browser eval --stdin # Read script from stdin+```++Use `-b`/`--base64` or `--stdin` for reliable execution. Shell escaping with nested quotes and special characters is error-prone.++```bash+# Base64 encode your script, then:+agent-browser eval -b "ZG9jdW1lbnQucXVlcnlTZWxlY3RvcignW3NyYyo9Il9uZXh0Il0nKQ=="++# Or use stdin with heredoc for multiline scripts:+cat <<'EOF' | agent-browser eval --stdin+const links = document.querySelectorAll('a');+Array.from(links).map(a => a.href);+EOF+```++## State Management++```bash+agent-browser state save auth.json # Save cookies, storage, auth state+agent-browser state load auth.json # Restore saved state+```++## Global Options++```bash+agent-browser --session <name> ... # Isolated browser session+agent-browser --json ... # JSON output for parsing+agent-browser --headed ... # Show browser window (not headless)+agent-browser --full ... # Full page screenshot (-f)+agent-browser --cdp <port> ... # Connect via Chrome DevTools Protocol+agent-browser -p <provider> ... # Cloud browser provider (--provider)+agent-browser --proxy <url> ... # Use proxy server+agent-browser --headers <json> ... # HTTP headers scoped to URL's origin+agent-browser --executable-path <p> # Custom browser executable+agent-browser --extension <path> ... # Load browser extension (repeatable)+agent-browser --ignore-https-errors # Ignore SSL certificate errors+agent-browser --help # Show help (-h)+agent-browser --version # Show version (-V)+agent-browser <command> --help # Show detailed help for a command+```++## Debugging++```bash+agent-browser --headed open example.com # Show browser window+agent-browser --cdp 9222 snapshot # Connect via CDP port+agent-browser connect 9222 # Alternative: connect command+agent-browser console # View console messages+agent-browser console --clear # Clear console+agent-browser errors # View page errors+agent-browser errors --clear # Clear errors+agent-browser highlight @e1 # Highlight element+agent-browser trace start # Start recording trace+agent-browser trace stop trace.zip # Stop and save trace+```++## Environment Variables++```bash+AGENT_BROWSER_SESSION="mysession" # Default session name+AGENT_BROWSER_EXECUTABLE_PATH="/path/chrome" # Custom browser path+AGENT_BROWSER_EXTENSIONS="/ext1,/ext2" # Comma-separated extension paths+AGENT_BROWSER_PROVIDER="browserbase" # Cloud browser provider+AGENT_BROWSER_STREAM_PORT="9223" # WebSocket streaming port+AGENT_BROWSER_HOME="/path/to/agent-browser" # Custom install location+```diff --git a/.agents/skills/agent-browser/references/proxy-support.md b/.agents/skills/agent-browser/references/proxy-support.mdnew file mode 100644index 000000000..05cc9d538--- /dev/null+++ b/.agents/skills/agent-browser/references/proxy-support.md@@ -0,0 +1,188 @@+# Proxy Support++Proxy configuration for geo-testing, rate limiting avoidance, and corporate environments.++**Related**: [commands.md](commands.md) for global options, [SKILL.md](../SKILL.md) for quick start.++## Contents++- [Basic Proxy Configuration](#basic-proxy-configuration)+- [Authenticated Proxy](#authenticated-proxy)+- [SOCKS Proxy](#socks-proxy)+- [Proxy Bypass](#proxy-bypass)+- [Common Use Cases](#common-use-cases)+- [Verifying Proxy Connection](#verifying-proxy-connection)+- [Troubleshooting](#troubleshooting)+- [Best Practices](#best-practices)++## Basic Proxy Configuration++Set proxy via environment variable before starting:++```bash+# HTTP proxy+export HTTP_PROXY="http://proxy.example.com:8080"+agent-browser open https://example.com++# HTTPS proxy+export HTTPS_PROXY="https://proxy.example.com:8080"+agent-browser open https://example.com++# Both+export HTTP_PROXY="http://proxy.example.com:8080"+export HTTPS_PROXY="http://proxy.example.com:8080"+agent-browser open https://example.com+```++## Authenticated Proxy++For proxies requiring authentication:++```bash+# Include credentials in URL+export HTTP_PROXY="http://username:[email protected]:8080"+agent-browser open https://example.com+```++## SOCKS Proxy++```bash+# SOCKS5 proxy+export ALL_PROXY="socks5://proxy.example.com:1080"+agent-browser open https://example.com++# SOCKS5 with auth+export ALL_PROXY="socks5://user:[email protected]:1080"+agent-browser open https://example.com+```++## Proxy Bypass++Skip proxy for specific domains:++```bash+# Bypass proxy for local addresses+export NO_PROXY="localhost,127.0.0.1,.internal.company.com"+agent-browser open https://internal.company.com # Direct connection+agent-browser open https://external.com # Via proxy+```++## Common Use Cases++### Geo-Location Testing++```bash+#!/bin/bash+# Test site from different regions using geo-located proxies++PROXIES=(+ "http://us-proxy.example.com:8080"+ "http://eu-proxy.example.com:8080"+ "http://asia-proxy.example.com:8080"+)++for proxy in "${PROXIES[@]}"; do+ export HTTP_PROXY="$proxy"+ export HTTPS_PROXY="$proxy"++ region=$(echo "$proxy" | grep -oP '^\w+-\w+')+ echo "Testing from: $region"++ agent-browser --session "$region" open https://example.com+ agent-browser --session "$region" screenshot "./screenshots/$region.png"+ agent-browser --session "$region" close+done+```++### Rotating Proxies for Scraping++```bash+#!/bin/bash+# Rotate through proxy list to avoid rate limiting++PROXY_LIST=(+ "http://proxy1.example.com:8080"+ "http://proxy2.example.com:8080"+ "http://proxy3.example.com:8080"+)++URLS=(+ "https://site.com/page1"+ "https://site.com/page2"+ "https://site.com/page3"+)++for i in "${!URLS[@]}"; do+ proxy_index=$((i % ${#PROXY_LIST[@]}))+ export HTTP_PROXY="${PROXY_LIST[$proxy_index]}"+ export HTTPS_PROXY="${PROXY_LIST[$proxy_index]}"++ agent-browser open "${URLS[$i]}"+ agent-browser get text body > "output-$i.txt"+ agent-browser close++ sleep 1 # Polite delay+done+```++### Corporate Network Access++```bash+#!/bin/bash+# Access internal sites via corporate proxy++export HTTP_PROXY="http://corpproxy.company.com:8080"+export HTTPS_PROXY="http://corpproxy.company.com:8080"+export NO_PROXY="localhost,127.0.0.1,.company.com"++# External sites go through proxy+agent-browser open https://external-vendor.com++# Internal sites bypass proxy+agent-browser open https://intranet.company.com+```++## Verifying Proxy Connection++```bash+# Check your apparent IP+agent-browser open https://httpbin.org/ip+agent-browser get text body+# Should show proxy's IP, not your real IP+```++## Troubleshooting++### Proxy Connection Failed++```bash+# Test proxy connectivity first+curl -x http://proxy.example.com:8080 https://httpbin.org/ip++# Check if proxy requires auth+export HTTP_PROXY="http://user:[email protected]:8080"+```++### SSL/TLS Errors Through Proxy++Some proxies perform SSL inspection. If you encounter certificate errors:++```bash+# For testing only - not recommended for production+agent-browser open https://example.com --ignore-https-errors+```++### Slow Performance++```bash+# Use proxy only when necessary+export NO_PROXY="*.cdn.com,*.static.com" # Direct CDN access+```++## Best Practices++1. **Use environment variables** - Don't hardcode proxy credentials+2. **Set NO_PROXY appropriately** - Avoid routing local traffic through proxy+3. **Test proxy before automation** - Verify connectivity with simple requests+4. **Handle proxy failures gracefully** - Implement retry logic for unstable proxies+5. **Rotate proxies for large scraping jobs** - Distribute load and avoid bansdiff --git a/.agents/skills/agent-browser/references/session-management.md b/.agents/skills/agent-browser/references/session-management.mdnew file mode 100644index 000000000..bb5312dbd--- /dev/null+++ b/.agents/skills/agent-browser/references/session-management.md@@ -0,0 +1,193 @@+# Session Management++Multiple isolated browser sessions with state persistence and concurrent browsing.++**Related**: [authentication.md](authentication.md) for login patterns, [SKILL.md](../SKILL.md) for quick start.++## Contents++- [Named Sessions](#named-sessions)+- [Session Isolation Properties](#session-isolation-properties)+- [Session State Persistence](#session-state-persistence)+- [Common Patterns](#common-patterns)+- [Default Session](#default-session)+- [Session Cleanup](#session-cleanup)+- [Best Practices](#best-practices)++## Named Sessions++Use `--session` flag to isolate browser contexts:++```bash+# Session 1: Authentication flow+agent-browser --session auth open https://app.example.com/login++# Session 2: Public browsing (separate cookies, storage)+agent-browser --session public open https://example.com++# Commands are isolated by session+agent-browser --session auth fill @e1 "[email protected]"+agent-browser --session public get text body+```++## Session Isolation Properties++Each session has independent:+- Cookies+- LocalStorage / SessionStorage+- IndexedDB+- Cache+- Browsing history+- Open tabs++## Session State Persistence++### Save Session State++```bash+# Save cookies, storage, and auth state+agent-browser state save /path/to/auth-state.json+```++### Load Session State++```bash+# Restore saved state+agent-browser state load /path/to/auth-state.json++# Continue with authenticated session+agent-browser open https://app.example.com/dashboard+```++### State File Contents++```json+{+ "cookies": [...],+ "localStorage": {...},+ "sessionStorage": {...},+ "origins": [...]+}+```++## Common Patterns++### Authenticated Session Reuse++```bash+#!/bin/bash+# Save login state once, reuse many times++STATE_FILE="/tmp/auth-state.json"++# Check if we have saved state+if [[ -f "$STATE_FILE" ]]; then+ agent-browser state load "$STATE_FILE"+ agent-browser open https://app.example.com/dashboard+else+ # Perform login+ agent-browser open https://app.example.com/login+ agent-browser snapshot -i+ agent-browser fill @e1 "$USERNAME"+ agent-browser fill @e2 "$PASSWORD"+ agent-browser click @e3+ agent-browser wait --load networkidle++ # Save for future use+ agent-browser state save "$STATE_FILE"+fi+```++### Concurrent Scraping++```bash+#!/bin/bash+# Scrape multiple sites concurrently++# Start all sessions+agent-browser --session site1 open https://site1.com &+agent-browser --session site2 open https://site2.com &+agent-browser --session site3 open https://site3.com &+wait++# Extract from each+agent-browser --session site1 get text body > site1.txt+agent-browser --session site2 get text body > site2.txt+agent-browser --session site3 get text body > site3.txt++# Cleanup+agent-browser --session site1 close+agent-browser --session site2 close+agent-browser --session site3 close+```++### A/B Testing Sessions++```bash+# Test different user experiences+agent-browser --session variant-a open "https://app.com?variant=a"+agent-browser --session variant-b open "https://app.com?variant=b"++# Compare+agent-browser --session variant-a screenshot /tmp/variant-a.png+agent-browser --session variant-b screenshot /tmp/variant-b.png+```++## Default Session++When `--session` is omitted, commands use the default session:++```bash+# These use the same default session+agent-browser open https://example.com+agent-browser snapshot -i+agent-browser close # Closes default session+```++## Session Cleanup++```bash+# Close specific session+agent-browser --session auth close++# List active sessions+agent-browser session list+```++## Best Practices++### 1. Name Sessions Semantically++```bash+# GOOD: Clear purpose+agent-browser --session github-auth open https://github.com+agent-browser --session docs-scrape open https://docs.example.com++# AVOID: Generic names+agent-browser --session s1 open https://github.com+```++### 2. Always Clean Up++```bash+# Close sessions when done+agent-browser --session auth close+agent-browser --session scrape close+```++### 3. Handle State Files Securely++```bash+# Don't commit state files (contain auth tokens!)+echo "*.auth-state.json" >> .gitignore++# Delete after use+rm /tmp/auth-state.json+```++### 4. Timeout Long Sessions++```bash+# Set timeout for automated scripts+timeout 60 agent-browser --session long-task get text body+```diff --git a/.agents/skills/agent-browser/references/snapshot-refs.md b/.agents/skills/agent-browser/references/snapshot-refs.mdnew file mode 100644index 000000000..c13d53a89--- /dev/null+++ b/.agents/skills/agent-browser/references/snapshot-refs.md@@ -0,0 +1,194 @@+# Snapshot and Refs++Compact element references that reduce context usage dramatically for AI agents.++**Related**: [commands.md](commands.md) for full command reference, [SKILL.md](../SKILL.md) for quick start.++## Contents++- [How Refs Work](#how-refs-work)+- [Snapshot Command](#the-snapshot-command)+- [Using Refs](#using-refs)+- [Ref Lifecycle](#ref-lifecycle)+- [Best Practices](#best-practices)+- [Ref Notation Details](#ref-notation-details)+- [Troubleshooting](#troubleshooting)++## How Refs Work++Traditional approach:+```+Full DOM/HTML → AI parses → CSS selector → Action (~3000-5000 tokens)+```++agent-browser approach:+```+Compact snapshot → @refs assigned → Direct interaction (~200-400 tokens)+```++## The Snapshot Command++```bash+# Basic snapshot (shows page structure)+agent-browser snapshot++# Interactive snapshot (-i flag) - RECOMMENDED+agent-browser snapshot -i+```++### Snapshot Output Format++```+Page: Example Site - Home+URL: https://example.com++@e1 [header]+ @e2 [nav]+ @e3 [a] "Home"+ @e4 [a] "Products"+ @e5 [a] "About"+ @e6 [button] "Sign In"++@e7 [main]+ @e8 [h1] "Welcome"+ @e9 [form]+ @e10 [input type="email"] placeholder="Email"+ @e11 [input type="password"] placeholder="Password"+ @e12 [button type="submit"] "Log In"++@e13 [footer]+ @e14 [a] "Privacy Policy"+```++## Using Refs++Once you have refs, interact directly:++```bash+# Click the "Sign In" button+agent-browser click @e6++# Fill email input+agent-browser fill @e10 "[email protected]"++# Fill password+agent-browser fill @e11 "password123"++# Submit the form+agent-browser click @e12+```++## Ref Lifecycle++**IMPORTANT**: Refs are invalidated when the page changes!++```bash+# Get initial snapshot+agent-browser snapshot -i+# @e1 [button] "Next"++# Click triggers page change+agent-browser click @e1++# MUST re-snapshot to get new refs!+agent-browser snapshot -i+# @e1 [h1] "Page 2" ← Different element now!+```++## Best Practices++### 1. Always Snapshot Before Interacting++```bash+# CORRECT+agent-browser open https://example.com+agent-browser snapshot -i # Get refs first+agent-browser click @e1 # Use ref++# WRONG+agent-browser open https://example.com+agent-browser click @e1 # Ref doesn't exist yet!+```++### 2. Re-Snapshot After Navigation++```bash+agent-browser click @e5 # Navigates to new page+agent-browser snapshot -i # Get new refs+agent-browser click @e1 # Use new refs+```++### 3. Re-Snapshot After Dynamic Changes++```bash+agent-browser click @e1 # Opens dropdown+agent-browser snapshot -i # See dropdown items+agent-browser click @e7 # Select item+```++### 4. Snapshot Specific Regions++For complex pages, snapshot specific areas:++```bash+# Snapshot just the form+agent-browser snapshot @e9+```++## Ref Notation Details++```+@e1 [tag type="value"] "text content" placeholder="hint"+│ │ │ │ │+│ │ │ │ └─ Additional attributes+│ │ │ └─ Visible text+│ │ └─ Key attributes shown+│ └─ HTML tag name+└─ Unique ref ID+```++### Common Patterns++```+@e1 [button] "Submit" # Button with text+@e2 [input type="email"] # Email input+@e3 [input type="password"] # Password input+@e4 [a href="/page"] "Link Text" # Anchor link+@e5 [select] # Dropdown+@e6 [textarea] placeholder="Message" # Text area+@e7 [div class="modal"] # Container (when relevant)+@e8 [img alt="Logo"] # Image+@e9 [checkbox] checked # Checked checkbox+@e10 [radio] selected # Selected radio+```++## Troubleshooting++### "Ref not found" Error++```bash+# Ref may have changed - re-snapshot+agent-browser snapshot -i+```++### Element Not Visible in Snapshot++```bash+# Scroll to reveal element+agent-browser scroll --bottom+agent-browser snapshot -i++# Or wait for dynamic content+agent-browser wait 1000+agent-browser snapshot -i+```++### Too Many Elements++```bash+# Snapshot specific container+agent-browser snapshot @e5++# Or use get text for content-only extraction+agent-browser get text @e5+```diff --git a/.agents/skills/agent-browser/references/video-recording.md b/.agents/skills/agent-browser/references/video-recording.mdnew file mode 100644index 000000000..e6a9fb4e2--- /dev/null+++ b/.agents/skills/agent-browser/references/video-recording.md@@ -0,0 +1,173 @@+# Video Recording++Capture browser automation as video for debugging, documentation, or verification.++**Related**: [commands.md](commands.md) for full command reference, [SKILL.md](../SKILL.md) for quick start.++## Contents++- [Basic Recording](#basic-recording)+- [Recording Commands](#recording-commands)+- [Use Cases](#use-cases)+- [Best Practices](#best-practices)+- [Output Format](#output-format)+- [Limitations](#limitations)++## Basic Recording++```bash+# Start recording+agent-browser record start ./demo.webm++# Perform actions+agent-browser open https://example.com+agent-browser snapshot -i+agent-browser click @e1+agent-browser fill @e2 "test input"++# Stop and save+agent-browser record stop+```++## Recording Commands++```bash+# Start recording to file+agent-browser record start ./output.webm++# Stop current recording+agent-browser record stop++# Restart with new file (stops current + starts new)+agent-browser record restart ./take2.webm+```++## Use Cases++### Debugging Failed Automation++```bash+#!/bin/bash+# Record automation for debugging++agent-browser record start ./debug-$(date +%Y%m%d-%H%M%S).webm++# Run your automation+agent-browser open https://app.example.com+agent-browser snapshot -i+agent-browser click @e1 || {+ echo "Click failed - check recording"+ agent-browser record stop+ exit 1+}++agent-browser record stop+```++### Documentation Generation++```bash+#!/bin/bash+# Record workflow for documentation++agent-browser record start ./docs/how-to-login.webm++agent-browser open https://app.example.com/login+agent-browser wait 1000 # Pause for visibility++agent-browser snapshot -i+agent-browser fill @e1 "[email protected]"+agent-browser wait 500++agent-browser fill @e2 "password"+agent-browser wait 500++agent-browser click @e3+agent-browser wait --load networkidle+agent-browser wait 1000 # Show result++agent-browser record stop+```++### CI/CD Test Evidence++```bash+#!/bin/bash+# Record E2E test runs for CI artifacts++TEST_NAME="${1:-e2e-test}"+RECORDING_DIR="./test-recordings"+mkdir -p "$RECORDING_DIR"++agent-browser record start "$RECORDING_DIR/$TEST_NAME-$(date +%s).webm"++# Run test+if run_e2e_test; then+ echo "Test passed"+else+ echo "Test failed - recording saved"+fi++agent-browser record stop+```++## Best Practices++### 1. Add Pauses for Clarity++```bash+# Slow down for human viewing+agent-browser click @e1+agent-browser wait 500 # Let viewer see result+```++### 2. Use Descriptive Filenames++```bash+# Include context in filename+agent-browser record start ./recordings/login-flow-2024-01-15.webm+agent-browser record start ./recordings/checkout-test-run-42.webm+```++### 3. Handle Recording in Error Cases++```bash+#!/bin/bash+set -e++cleanup() {+ agent-browser record stop 2>/dev/null || true+ agent-browser close 2>/dev/null || true+}+trap cleanup EXIT++agent-browser record start ./automation.webm+# ... automation steps ...+```++### 4. Combine with Screenshots++```bash+# Record video AND capture key frames+agent-browser record start ./flow.webm++agent-browser open https://example.com+agent-browser screenshot ./screenshots/step1-homepage.png++agent-browser click @e1+agent-browser screenshot ./screenshots/step2-after-click.png++agent-browser record stop+```++## Output Format++- Default format: WebM (VP8/VP9 codec)+- Compatible with all modern browsers and video players+- Compressed but high quality++## Limitations++- Recording adds slight overhead to automation+- Large recordings can consume significant disk space+- Some headless environments may have codec limitationsdiff --git a/.agents/skills/agent-browser/templates/authenticated-session.sh b/.agents/skills/agent-browser/templates/authenticated-session.shnew file mode 100755index 000000000..ebbfc1fae--- /dev/null+++ b/.agents/skills/agent-browser/templates/authenticated-session.sh@@ -0,0 +1,97 @@+#!/bin/bash+# Template: Authenticated Session Workflow+# Purpose: Login once, save state, reuse for subsequent runs+# Usage: ./authenticated-session.sh <login-url> [state-file]+#+# Environment variables:+# APP_USERNAME - Login username/email+# APP_PASSWORD - Login password+#+# Two modes:+# 1. Discovery mode (default): Shows form structure so you can identify refs+# 2. Login mode: Performs actual login after you update the refs+#+# Setup steps:+# 1. Run once to see form structure (discovery mode)+# 2. Update refs in LOGIN FLOW section below+# 3. Set APP_USERNAME and APP_PASSWORD+# 4. Delete the DISCOVERY section++set -euo pipefail++LOGIN_URL="${1:?Usage: $0 <login-url> [state-file]}"+STATE_FILE="${2:-./auth-state.json}"++echo "Authentication workflow: $LOGIN_URL"++# ================================================================+# SAVED STATE: Skip login if valid saved state exists+# ================================================================+if [[ -f "$STATE_FILE" ]]; then+ echo "Loading saved state from $STATE_FILE..."+ agent-browser state load "$STATE_FILE"+ agent-browser open "$LOGIN_URL"+ agent-browser wait --load networkidle++ CURRENT_URL=$(agent-browser get url)+ if [[ "$CURRENT_URL" != *"login"* ]] && [[ "$CURRENT_URL" != *"signin"* ]]; then+ echo "Session restored successfully"+ agent-browser snapshot -i+ exit 0+ fi+ echo "Session expired, performing fresh login..."+ rm -f "$STATE_FILE"+fi++# ================================================================+# DISCOVERY MODE: Shows form structure (delete after setup)+# ================================================================+echo "Opening login page..."+agent-browser open "$LOGIN_URL"+agent-browser wait --load networkidle++echo ""+echo "Login form structure:"+echo "---"+agent-browser snapshot -i+echo "---"+echo ""+echo "Next steps:"+echo " 1. Note the refs: username=@e?, password=@e?, submit=@e?"+echo " 2. Update the LOGIN FLOW section below with your refs"+echo " 3. Set: export APP_USERNAME='...' APP_PASSWORD='...'"+echo " 4. Delete this DISCOVERY MODE section"+echo ""+agent-browser close+exit 0++# ================================================================+# LOGIN FLOW: Uncomment and customize after discovery+# ================================================================+# : "${APP_USERNAME:?Set APP_USERNAME environment variable}"+# : "${APP_PASSWORD:?Set APP_PASSWORD environment variable}"+#+# agent-browser open "$LOGIN_URL"+# agent-browser wait --load networkidle+# agent-browser snapshot -i+#+# # Fill credentials (update refs to match your form)+# agent-browser fill @e1 "$APP_USERNAME"+# agent-browser fill @e2 "$APP_PASSWORD"+# agent-browser click @e3+# agent-browser wait --load networkidle+#+# # Verify login succeeded+# FINAL_URL=$(agent-browser get url)+# if [[ "$FINAL_URL" == *"login"* ]] || [[ "$FINAL_URL" == *"signin"* ]]; then+# echo "Login failed - still on login page"+# agent-browser screenshot /tmp/login-failed.png+# agent-browser close+# exit 1+# fi+#+# # Save state for future runs+# echo "Saving state to $STATE_FILE"+# agent-browser state save "$STATE_FILE"+# echo "Login successful"+# agent-browser snapshot -idiff --git a/.agents/skills/agent-browser/templates/capture-workflow.sh b/.agents/skills/agent-browser/templates/capture-workflow.shnew file mode 100755index 000000000..3bc93ad0c--- /dev/null+++ b/.agents/skills/agent-browser/templates/capture-workflow.sh@@ -0,0 +1,69 @@+#!/bin/bash+# Template: Content Capture Workflow+# Purpose: Extract content from web pages (text, screenshots, PDF)+# Usage: ./capture-workflow.sh <url> [output-dir]+#+# Outputs:+# - page-full.png: Full page screenshot+# - page-structure.txt: Page element structure with refs+# - page-text.txt: All text content+# - page.pdf: PDF version+#+# Optional: Load auth state for protected pages++set -euo pipefail++TARGET_URL="${1:?Usage: $0 <url> [output-dir]}"+OUTPUT_DIR="${2:-.}"++echo "Capturing: $TARGET_URL"+mkdir -p "$OUTPUT_DIR"++# Optional: Load authentication state+# if [[ -f "./auth-state.json" ]]; then+# echo "Loading authentication state..."+# agent-browser state load "./auth-state.json"+# fi++# Navigate to target+agent-browser open "$TARGET_URL"+agent-browser wait --load networkidle++# Get metadata+TITLE=$(agent-browser get title)+URL=$(agent-browser get url)+echo "Title: $TITLE"+echo "URL: $URL"++# Capture full page screenshot+agent-browser screenshot --full "$OUTPUT_DIR/page-full.png"+echo "Saved: $OUTPUT_DIR/page-full.png"++# Get page structure with refs+agent-browser snapshot -i > "$OUTPUT_DIR/page-structure.txt"+echo "Saved: $OUTPUT_DIR/page-structure.txt"++# Extract all text content+agent-browser get text body > "$OUTPUT_DIR/page-text.txt"+echo "Saved: $OUTPUT_DIR/page-text.txt"++# Save as PDF+agent-browser pdf "$OUTPUT_DIR/page.pdf"+echo "Saved: $OUTPUT_DIR/page.pdf"++# Optional: Extract specific elements using refs from structure+# agent-browser get text @e5 > "$OUTPUT_DIR/main-content.txt"++# Optional: Handle infinite scroll pages+# for i in {1..5}; do+# agent-browser scroll down 1000+# agent-browser wait 1000+# done+# agent-browser screenshot --full "$OUTPUT_DIR/page-scrolled.png"++# Cleanup+agent-browser close++echo ""+echo "Capture complete:"+ls -la "$OUTPUT_DIR"diff --git a/.agents/skills/agent-browser/templates/form-automation.sh b/.agents/skills/agent-browser/templates/form-automation.shnew file mode 100755index 000000000..6784fcd3a--- /dev/null+++ b/.agents/skills/agent-browser/templates/form-automation.sh@@ -0,0 +1,62 @@+#!/bin/bash+# Template: Form Automation Workflow+# Purpose: Fill and submit web forms with validation+# Usage: ./form-automation.sh <form-url>+#+# This template demonstrates the snapshot-interact-verify pattern:+# 1. Navigate to form+# 2. Snapshot to get element refs+# 3. Fill fields using refs+# 4. Submit and verify result+#+# Customize: Update the refs (@e1, @e2, etc.) based on your form's snapshot output++set -euo pipefail++FORM_URL="${1:?Usage: $0 <form-url>}"++echo "Form automation: $FORM_URL"++# Step 1: Navigate to form+agent-browser open "$FORM_URL"+agent-browser wait --load networkidle++# Step 2: Snapshot to discover form elements+echo ""+echo "Form structure:"+agent-browser snapshot -i++# Step 3: Fill form fields (customize these refs based on snapshot output)+#+# Common field types:+# agent-browser fill @e1 "John Doe" # Text input+# agent-browser fill @e2 "[email protected]" # Email input+# agent-browser fill @e3 "SecureP@ss123" # Password input+# agent-browser select @e4 "Option Value" # Dropdown+# agent-browser check @e5 # Checkbox+# agent-browser click @e6 # Radio button+# agent-browser fill @e7 "Multi-line text" # Textarea+# agent-browser upload @e8 /path/to/file.pdf # File upload+#+# Uncomment and modify:+# agent-browser fill @e1 "Test User"+# agent-browser fill @e2 "[email protected]"+# agent-browser click @e3 # Submit button++# Step 4: Wait for submission+# agent-browser wait --load networkidle+# agent-browser wait --url "**/success" # Or wait for redirect++# Step 5: Verify result+echo ""+echo "Result:"+agent-browser get url+agent-browser snapshot -i++# Optional: Capture evidence+agent-browser screenshot /tmp/form-result.png+echo "Screenshot saved: /tmp/form-result.png"++# Cleanup+agent-browser close+echo "Done"diff --git a/.gitignore b/.gitignoreindex 961230226..29c50622f 100644--- a/.gitignore+++ b/.gitignore@@ -67,3 +67,6 @@ scripts/output*# license.documenso-license.json.documenso-license-backup.json++# tmp+tmp/diff --git a/.opencode/skills/agent-browser b/.opencode/skills/agent-browsernew file mode 120000index 000000000..e298b7be3--- /dev/null+++ b/.opencode/skills/agent-browser@@ -0,0 +1 @@+../../.agents/skills/agent-browser\ No newline at end of filediff --git a/.prettierignore b/.prettierignoreindex 15f517b75..f5c70c1d5 100644--- a/.prettierignore+++ b/.prettierignore@@ -15,3 +15,6 @@ packages/lib/translations/**/*.js.prettierignore.DS_Store.eslintignore++# Docs MDX - Prettier strips indentation from code blocks inside components+apps/docs/content/**/*.mdxdiff --git a/ARCHITECTURE.md b/ARCHITECTURE.mdnew file mode 100644index 000000000..b3710da55--- /dev/null+++ b/ARCHITECTURE.md@@ -0,0 +1,359 @@+# Documenso Architecture++This document provides a high-level overview of the Documenso codebase to help humans and agents understand how the application is structured.++## Overview++Documenso is an open-source document signing platform built as a **monorepo** using npm workspaces and Turborepo. The application enables users to create, send, and sign documents electronically.++```+┌─────────────────────────────────────────────────────────────────────────────┐+│ Remix App (Hono Server) │+│ apps/remix │+├─────────────┬─────────────┬─────────────┬─────────────┬─────────────────────┤+│ /api/v1/* │ /api/v2/* │ /api/trpc/* │ /api/jobs/* │ React Router UI │+│ (ts-rest) │ (tRPC) │ (tRPC) │ (Jobs API) │ │+├─────────────┴─────────────┴─────────────┴─────────────┴─────────────────────┤+│ │+│ ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────────────┐ │+│ │ @api │ │ @trpc │ │ @lib │ │ @email │ │ @signing │ │+│ │ (REST) │ │ (RPC) │ │ (CORE) │ │ │ │ │ │+│ └─────────┘ └─────────┘ └────┬────┘ └─────────┘ └─────────────────┘ │+│ │ │+│ ┌──────────────────┼──────────────────┐ │+│ │ │ │ │+│ ┌────▼────┐ ┌─────▼─────┐ ┌─────▼─────┐ │+│ │ Storage │ │ Jobs │ │ PDF │ │+│ │Provider │ │ Provider │ │ Signing │ │+│ └────┬────┘ └─────┬─────┘ └─────┬─────┘ │+│ │ │ │ │+└──────────────┼──────────────────┼──────────────────┼────────────────────────┘+ │ │ │+ ┌──────┴──────┐ ┌──────┴──────┐ ┌──────┴──────┐+ │ Database │ │ Inngest/ │ │ Google KMS/ │+ │ S3 │ │ Local │ │ Local │+ └─────────────┘ └─────────────┘ └─────────────┘+```++## Monorepo Structure++### Applications (`apps/`)++| Package | Description | Port |+| -------------------------- | -------------------------------------------------------- | ---- |+| `@documenso/remix` | Main application - React Router (Remix) with Hono server | 3000 |+| `@documenso/documentation` | Documentation site (Next.js + Nextra) | 3002 |+| `@documenso/openpage-api` | Public analytics API | 3003 |++### Core Packages (`packages/`)++| Package | Description |+| -------------------- | --------------------------------------------------------- |+| `@documenso/lib` | Core business logic (server-only, client-only, universal) |+| `@documenso/trpc` | tRPC API layer with OpenAPI support (API V2) |+| `@documenso/api` | REST API layer using ts-rest (API V1) |+| `@documenso/prisma` | Database layer (Prisma ORM + Kysely) |+| `@documenso/ui` | UI component library (Shadcn + Radix + Tailwind) |+| `@documenso/email` | Email templates and mailer (React Email) |+| `@documenso/auth` | Authentication (OAuth via Arctic, WebAuthn/Passkeys) |+| `@documenso/signing` | PDF signing (Local P12, Google Cloud KMS) |+| `@documenso/ee` | Enterprise Edition features |+| `@documenso/assets` | Static assets |++### Supporting Packages++| Package | Description |+| ---------------------------- | ------------------------- |+| `@documenso/app-tests` | E2E tests (Playwright) |+| `@documenso/eslint-config` | Shared ESLint config |+| `@documenso/prettier-config` | Shared Prettier config |+| `@documenso/tailwind-config` | Shared Tailwind config |+| `@documenso/tsconfig` | Shared TypeScript configs |++## Tech Stack++| Category | Technology |+| -------- | --------------------------------- |+| Frontend | React 18, React Router v7 (Remix) |+| Server | Hono |+| Database | PostgreSQL 15, Prisma, Kysely |+| API | tRPC, ts-rest, OpenAPI |+| Styling | Tailwind CSS, Radix UI, Shadcn UI |+| Auth | Arctic (OAuth), WebAuthn/Passkeys |+| Email | React Email, Nodemailer |+| Jobs | Inngest / Local |+| Storage | S3-compatible / Database |+| PDF | @libpdf/core, pdfjs-dist |+| i18n | Lingui |+| Build | Turborepo, Vite |+| Testing | Playwright |++## API Architecture++### API V1 (Deprecated)++- **Location**: `packages/api/v1/`+- **Framework**: ts-rest (contract-based REST)+- **Mount**: `/api/v1/*`+- **Auth**: API Token (Bearer header)+- **Status**: Deprecated but maintained++**Routes** (RESTful pattern):++- `GET/POST/DELETE /api/v1/documents/*`+- `GET/POST/DELETE /api/v1/templates/*`+- Recipients and fields nested under documents++### API V2 (Current)++- **Location**: `packages/trpc/server/`+- **Framework**: tRPC with trpc-to-openapi+- **Mount**: `/api/v2/*`, `/api/v2-beta/*`+- **Auth**: API Token or Session Cookie+- **Status**: Active++**Routes** (action-based pattern):++- `GET/POST /api/v2/document/*` - Document operations+- `GET/POST /api/v2/template/*` - Template operations+- `GET/POST /api/v2/envelope/*` - Envelope operations (multi-document)+- `GET/POST /api/v2/folder/*` - Folder management++**Route Organization**:++```+packages/trpc/server/+├── document-router/+│ ├── get-document.ts+│ ├── get-document.types.ts+│ └── ...+├── template-router/+├── envelope-router/+├── recipient-router/+├── field-router/+└── ...+```++### Internal tRPC API++- **Mount**: `/api/trpc/*`+- **Usage**: Frontend-to-backend communication+- **Auth**: Session-based++## Background Jobs++Jobs handle async operations like email sending, document sealing, and webhooks.++### Architecture++```+┌─────────────────┐ ┌───────────────────────────────────────┐+│ triggerJob() │────▶│ Job Provider │+│ │ │ ┌─────────────┬─────────────────┐ │+│ - name │ │ │ Inngest │ Local │ │+│ - payload │ │ │ (Cloud) │ (Database) │ │+└─────────────────┘ │ └─────────────┴─────────────────┘ │+ │ │ │+ │ ▼ │+ │ ┌─────────────────────┐ │+ │ │ Job Handler │ │+ │ │ (async processing) │ │+ │ └─────────────────────┘ │+ └───────────────────────────────────────┘+```++### Location++- `packages/lib/jobs/client/` - Provider implementations+- `packages/lib/jobs/definitions/` - Job definitions++### Job Types++**Email Jobs**:++- `send.signing.requested.email` - Signing invitation+- `send-confirmation-email` - Email verification+- `send-recipient-signed-email` - Notify on signature+- `send-rejection-emails` - Rejection notifications+- `send-document-cancelled-emails` - Cancellation notices++**Internal Jobs**:++- `internal.seal-document` - Finalize signed documents+- `internal.bulk-send-template` - Bulk document sending+- `internal.execute-webhook` - External webhook calls++## Swappable Providers++The codebase uses a **strategy pattern** with `ts-pattern` for provider selection via environment variables.++### Storage Provider++Handles file uploads and downloads.++| Provider | Description | Env Value |+| -------- | ------------------------------------ | ---------- |+| Database | Store files as Base64 in DB | `database` |+| S3 | S3-compatible storage (+ CloudFront) | `s3` |++**Config**: `NEXT_PUBLIC_UPLOAD_TRANSPORT`++**Location**: `packages/lib/universal/upload/`++### PDF Signing Provider++Cryptographically signs PDF documents.++| Provider | Description | Env Value |+| ---------------- | -------------------- | ------------ |+| Local | P12 certificate file | `local` |+| Google Cloud HSM | Google Cloud KMS | `gcloud-hsm` |++**Config**: `NEXT_PRIVATE_SIGNING_TRANSPORT`++**Location**: `packages/signing/`++### Email Provider++Sends transactional emails.++| Provider | Description | Env Value |+| ------------ | ------------------------------ | -------------- |+| SMTP Auth | Standard SMTP with credentials | `smtp-auth` |+| SMTP API | SMTP with API key | `smtp-api` |+| Resend | Resend API | `resend` |+| MailChannels | MailChannels API | `mailchannels` |++**Config**: `NEXT_PRIVATE_SMTP_TRANSPORT`++**Location**: `packages/email/mailer.ts`++### Background Jobs Provider++Processes async jobs.++| Provider | Description | Env Value |+| -------- | --------------------- | ----------------- |+| Local | Database-backed queue | `local` (default) |+| Inngest | Managed cloud service | `inngest` |++**Config**: `NEXT_PRIVATE_JOBS_PROVIDER`++**Location**: `packages/lib/jobs/client/`++## Request Flow++### Web Application Request++```+Browser+ │+ ▼+Hono Server (apps/remix/server/)+ │+ ├──▶ /api/v1/* ──▶ ts-rest handlers (packages/api/)+ │+ ├──▶ /api/v2/* ──▶ tRPC OpenAPI handlers (packages/trpc/)+ │+ ├──▶ /api/trpc/* ──▶ tRPC handlers (packages/trpc/)+ │+ ├──▶ /api/jobs/* ──▶ Job handlers (packages/lib/jobs/)+ │+ └──▶ /* ──▶ React Router (apps/remix/app/routes/)+ │+ ▼+ React Components (packages/ui/)+```++### Document Signing Flow++```+1. Upload Document ──▶ Storage Provider (DB/S3)+ │+2. Add Recipients ────────────────┤+ │+3. Add Fields ────────────────────┤+ │+4. Send Document ─────────────────┤+ │ │+ ▼ │+ Email Job ──▶ Email Provider |+ │ |+5. Recipient Signs ───────────────┤+ │ │+ ▼ │+ seal-document Job │+ │ │+ ▼ │+ Signing Provider ◀─────────────┘+ │+ ▼+ Signed PDF ──▶ Storage Provider+```++## Key Directories++```+documenso/+├── apps/+│ └── remix/+│ ├── app/+│ │ └── routes/ # React Router routes+│ │ ├── _authenticated+/ # Protected routes+│ │ ├── _unauthenticated+/ # Public routes+│ │ └── _recipient+/ # Signing routes+│ └── server/+│ ├── router.ts # Hono route mounting+│ └── main.js # Entry point+├── packages/+│ ├── api/v1/ # API V1 (ts-rest)+│ ├── trpc/server/ # API V2 + Internal (tRPC)+│ ├── lib/+│ │ ├── server-only/ # Server business logic+│ │ ├── client-only/ # Client utilities+│ │ ├── universal/ # Shared code+│ │ └── jobs/ # Background jobs+│ ├── prisma/ # Database schema & client+│ ├── signing/ # PDF signing+│ ├── email/ # Email templates+│ └── ui/ # Component library+└── docker/ # Docker configs+```++## Development++```bash+# Full setup (install, docker, migrate, seed, dev)+npm run d++# Start development server+npm run dev++# Database GUI+npm run prisma:studio++# Type checking (faster than build)+npx tsc --noEmit++# E2E tests+npm run test:e2e+```++### Docker Services (Development)++| Service | Port |+| --------------- | ---------- |+| PostgreSQL | 54320 |+| Inbucket (Mail) | 9000 |+| MinIO (S3) | 9001, 9002 |++## Environment Variables Summary++| Variable | Purpose | Options |+| -------------------------------- | ---------------- | ------------------------------------------------- |+| `NEXT_PUBLIC_UPLOAD_TRANSPORT` | Storage provider | `database`, `s3` |+| `NEXT_PRIVATE_SIGNING_TRANSPORT` | Signing provider | `local`, `gcloud-hsm` |+| `NEXT_PRIVATE_SMTP_TRANSPORT` | Email provider | `smtp-auth`, `smtp-api`, `resend`, `mailchannels` |+| `NEXT_PRIVATE_JOBS_PROVIDER` | Jobs provider | `local`, `inngest` |++See `.env.example` for the complete list of configuration options.diff --git a/WRITING_STYLE.md b/WRITING_STYLE.mdnew file mode 100644index 000000000..cc9c21419--- /dev/null+++ b/WRITING_STYLE.md@@ -0,0 +1,343 @@+# Documentation Writing Style Guide++This document defines the writing conventions for Documenso documentation.++Documentation lives in `apps/docs/` as MDX files and uses [Fumadocs](https://fumadocs.dev).++## Core Principles++1. **Task-based navigation** - Organize by what users want to do, not by feature hierarchy+2. **Progressive examples** - Start simple, build to complex+3. **Explicit limitations** - List what's NOT supported clearly+4. **Real-world context** - Explain document signing concepts with familiar comparisons++## Tone++- Direct and action-oriented+- Second person ("you") with imperative voice+- Technical but accessible+- Acknowledge complexity without condescension+- No emojis or excessive personality++## Anti-Patterns to Avoid++- Assuming document signing domain knowledge+- Hiding default values+- Separate "TypeScript" sections (types integrated throughout)+- Monolithic single-page references+- Examples that don't work with current API++## Documentation Audiences++The docs serve three distinct audiences:++1. **Users** - People using the Documenso web application to send and sign documents+2. **Developers** - Building integrations with the API or SDKs+3. **Self-hosters** - Running their own Documenso instance++Tailor content to the audience:++- User docs: Focus on UI workflows, no code required+- Developer docs: API/SDK examples, authentication, webhooks+- Self-hosting docs: Deployment, configuration, infrastructure++## File Structure++```+apps/docs/+├── index.mdx # Landing page with audience navigation+├── getting-started/ # Quick starts for each audience+├── users/ # Application usage guides+│ ├── documents/ # Creating and managing documents+│ ├── templates/ # Working with templates+│ ├── signing/ # Signing documents+│ └── settings/ # Account and team settings+├── developers/ # API and SDK documentation+│ ├── api/ # REST API reference+│ ├── sdk/ # SDK guides+│ ├── webhooks/ # Webhook integration+│ └── examples/ # Code examples and recipes+├── self-hosting/ # Self-hosting documentation+│ ├── deployment/ # Deployment guides+│ ├── configuration/ # Environment and settings+│ └── maintenance/ # Upgrades and backups+├── concepts/ # Shared concepts across audiences+└── migration/ # Migration guides+```++Each directory has a `meta.json` controlling navigation order:++```json+{+ "title": "Section Title",+ "pages": ["index", "page-one", "page-two"]+}+```++Use `---Label---` for section dividers in `meta.json`.++## MDX Frontmatter++Every page needs frontmatter for search and SEO:++```yaml+---+title: Working with Pages+description: Add, remove, reorder, copy, and merge PDF pages.+---+```++## Page Structure++### User Documentation++```mdx+---+title: Feature Name+description: Brief description for SEO and previews.+---++# Feature Name++Brief description of what this does and when to use it.++## Steps++1. Navigate to **Settings > Feature**+2. Click **Add New**+3. Fill in the required fields++---++## See Also++- [Related Guide](/docs/users/related)+```++### Developer Documentation++```mdx+---+title: Feature Name+description: Brief description for SEO and previews.+---++# Feature Name++Brief description of what this does and when to use it.++## Quick Start++\`\`\`typescript+// Minimal working example+\`\`\`++---++## Section Name++Content organized by task or concept.++---++## See Also++- [Related Guide](/docs/developers/related)+```++### Self-Hosting Documentation++```mdx+---+title: Configuration Topic+description: Brief description for SEO and previews.+---++# Configuration Topic++Brief description of what this configures.++## Environment Variables++| Variable | Required | Default | Description |+| ---------- | -------- | ------- | ------------ |+| `VAR_NAME` | Yes | - | What it does |++---++## See Also++- [Related Guide](/docs/self-hosting/related)+```++## Parameter Tables++Use Sharp-style nested parameter tables for developer documentation (API/SDK):++```markdown+### methodName(param, options?)++Description of what the method does.++| Param | Type | Default | Description |+| ------------------- | --------- | -------- | --------------------- |+| `param` | `string` | required | What it does |+| `[options]` | `Options` | | |+| `[options.setting]` | `boolean` | `false` | Nested option |+| `[options.timeout]` | `number` | `5000` | Another nested option |++**Returns**: `Promise<Result>`++**Throws**:++- `SpecificError` - When something goes wrong+```++Key conventions:++- Square brackets `[param]` indicate optional parameters+- Nested options indented with `[options.name]` pattern+- Always show default values+- Group related options under their parent++## Code Examples++For developer documentation, use progressive complexity:++```typescript+// Basic usage+const document = await documenso.documents.create({+ title: "Contract",+ file: pdfBuffer,+});++// With recipients+const document = await documenso.documents.create({+ title: "Contract",+ file: pdfBuffer,+ recipients: [{ email: "[email protected]", name: "John Doe" }],+});++// Full example with error handling+try {+ const document = await documenso.documents.create({+ title: "Contract",+ file: pdfBuffer,+ recipients: [{ email: "[email protected]", name: "John Doe" }],+ });+} catch (error) {+ if (error instanceof DocumentError) {+ // Handle document creation error+ }+}+```++### Example Guidelines++- All examples must be valid TypeScript+- Show imports when not obvious+- Include expected output in comments where helpful+- Use realistic values, not `foo`/`bar`++## UI Instructions++For user documentation, use clear step-by-step instructions:++- Bold UI elements: **Settings**, **Save**, **Documents**+- Use `>` for navigation paths: **Settings > Team > Members**+- Number sequential steps+- Include screenshots sparingly for complex workflows+- Describe what the user should see after each action++## Callouts++Use Fumadocs callouts sparingly for important information:++```mdx+<Callout type="info">Informational note about behavior.</Callout>++<Callout type="warn">Warning about potential issues or breaking changes.</Callout>++<Callout type="error">Critical warning about data loss or security.</Callout>+```++Reserve callouts for:++- Beta/unstable features+- Security considerations+- Common mistakes+- Breaking changes++## Tables++Use tables for:++- Feature matrices+- Parameter documentation+- Comparison charts+- Error catalogs++```markdown+| Feature | Status | Notes |+| ---------------- | ------ | ------------------------ |+| Email signing | Full | All recipient types |+| Embedded signing | Full | Via SDK or direct links |+| Templates | Full | Create and use templates |+```++## Linking++- Link to related docs: `[Documents](/docs/api/documents)`+- Use relative paths within docs+- Add "See Also" sections for discoverability++## Error Documentation++Categorize errors by when they occur:++```markdown+## Document Errors++Thrown when creating or updating documents.++### InvalidDocumentError++Document could not be processed.++**Common causes:**++- File is not a valid PDF+- File exceeds size limits++**Solution:** Verify the file is a valid PDF within size limits.+```++## Concept Explanations++Use analogies for document signing concepts:++```markdown+Think of a **signing workflow** like passing a physical document around an office.++Each recipient gets the document in turn, adds their signature or initials,+and passes it to the next person. The **document status** tracks where it+is in this journey.+```++## Self-Hosting Specific++For self-hosting documentation:++- Always specify required vs optional environment variables+- Include example `.env` snippets+- Document Docker and non-Docker approaches where applicable+- Link to troubleshooting for common deployment issues+- Specify minimum system requirements++## Maintenance++- Include types inline so docs don't get stale+- Reference source file locations for complex behavior+- Update examples when API changes+- Test all code examples work+- Keep environment variable documentation in sync with actual defaultsdiff --git a/apps/docs/.gitignore b/apps/docs/.gitignorenew file mode 100644index 000000000..9e429e498--- /dev/null+++ b/apps/docs/.gitignore@@ -0,0 +1,26 @@+# deps+/node_modules++# generated content+.source++# test & build+/coverage+/.next/+/out/+/build+*.tsbuildinfo++# misc+.DS_Store+*.pem+/.pnp+.pnp.js+npm-debug.log*+yarn-debug.log*+yarn-error.log*++# others+.env*.local+.vercel+next-env.d.ts\ No newline at end of filediff --git a/apps/docs/README.md b/apps/docs/README.mdnew file mode 100644index 000000000..9b7bba9e0--- /dev/null+++ b/apps/docs/README.md@@ -0,0 +1,45 @@+# docs++This is a Next.js application generated with+[Create Fumadocs](https://github.com/fuma-nama/fumadocs).++Run development server:++```bash+npm run dev+# or+pnpm dev+# or+yarn dev+```++Open http://localhost:3000 with your browser to see the result.++## Explore++In the project, you can see:++- `lib/source.ts`: Code for content source adapter, [`loader()`](https://fumadocs.dev/docs/headless/source-api) provides the interface to access your content.+- `lib/layout.shared.tsx`: Shared options for layouts, optional but preferred to keep.++| Route | Description |+| ------------------------- | ------------------------------------------------------ |+| `app/(home)` | The route group for your landing page and other pages. |+| `app/docs` | The documentation layout and pages. |+| `app/api/search/route.ts` | The Route Handler for search. |++### Fumadocs MDX++A `source.config.ts` config file has been included, you can customise different options like frontmatter schema.++Read the [Introduction](https://fumadocs.dev/docs/mdx) for further details.++## Learn More++To learn more about Next.js and Fumadocs, take a look at the following+resources:++- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js+ features and API.+- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.+- [Fumadocs](https://fumadocs.dev) - learn about Fumadocsdiff --git a/apps/docs/cli.json b/apps/docs/cli.jsonnew file mode 100644index 000000000..89d51513d--- /dev/null+++ b/apps/docs/cli.json@@ -0,0 +1,13 @@+{+ "$schema": "node_modules/@fumadocs/cli/dist/schema/src.json",+ "aliases": {+ "uiDir": "./components/ui",+ "componentsDir": "./components",+ "blockDir": "./components",+ "cssDir": "./styles",+ "libDir": "./lib"+ },+ "baseDir": "src",+ "uiLibrary": "radix-ui",+ "commands": {}+}\ No newline at end of filediff --git a/apps/docs/content/docs/compliance/certifications.mdx b/apps/docs/content/docs/compliance/certifications.mdxnew file mode 100644index 000000000..5c6f936b9--- /dev/null+++ b/apps/docs/content/docs/compliance/certifications.mdx@@ -0,0 +1,57 @@+---+title: Certifications & Regulatory Compliance+description: Documenso's compliance status for industry certifications and regulatory frameworks.+---++import { Callout } from 'fumadocs-ui/components/callout';++### Compliance Status Overview++| Certification | Status |+| -------------- | ---------------------- |+| 21 CFR Part 11 | Compliant (Enterprise) |+| SOC 2 | Compliant |+| ISO 27001 | Planned |+| HIPAA | Planned |++## 21 CFR Part 11++<Callout type="info">Status: Compliant (Enterprise License)</Callout>++21 CFR Part 11 is a regulation by the FDA that establishes the criteria for electronic records and electronic signatures to ensure their authenticity, integrity, and confidentiality in the pharmaceutical, medical device, and other FDA-regulated industries.++Read more about [21 CFR Part 11 with Documenso](https://documen.so/21-CFR-Part-11).++### Main Requirements++- Strong Identity Checks for each Signature+- Signature and Audit Trails+- User Access Management+- Quality Assurance Documentation++## SOC 2++<Callout type="info">Status: [Compliant](https://documen.so/trust)</Callout>++SOC 2 is a framework for managing and auditing the security, availability, processing integrity, confidentiality, and data privacy in cloud and IT service organizations, established by the American Institute of Certified Public Accountants (AICPA).++## ISO 27001++<Callout type="warn">Status: [Planned](https://github.com/documenso/backlog/issues/26)</Callout>++ISO 27001 is an international standard for managing information security, specifying requirements for establishing, implementing, maintaining, and continually improving an information security management system (ISMS).++## HIPAA++<Callout type="warn">Status: [Planned](https://github.com/documenso/backlog/issues/25)</Callout>++The HIPAA (Health Insurance Portability and Accountability Act) is a U.S. law designed to protect patient health information's privacy and security and improve the healthcare system's efficiency and effectiveness.++---++## See Also++- [Standards](/docs/compliance/standards) - Technical signing standards (PDF/A, PAdES, X.509)+- [Signature Levels](/docs/compliance/signature-levels) - eIDAS and other signature level compliance+- [Enterprise Edition](/docs/policies/enterprise-edition) - Enterprise licensing for compliance features+- [GDPR](/docs/compliance/gdpr) - Data protection compliancediff --git a/apps/docs/content/docs/compliance/esign.mdx b/apps/docs/content/docs/compliance/esign.mdxnew file mode 100644index 000000000..c4f503d88--- /dev/null+++ b/apps/docs/content/docs/compliance/esign.mdx@@ -0,0 +1,187 @@+---+title: E-Sign Compliance+description: Understand ESIGN, UETA, eIDAS, and other electronic signature laws that govern digital documents.+---++## ESIGN Act (United States)++The Electronic Signatures in Global and National Commerce Act (ESIGN Act) is a U.S. federal law enacted in 2000. It ensures that electronic signatures and records have the same legal validity as paper documents and handwritten signatures in interstate and foreign commerce.++### Key Requirements++| Requirement | Description |+| ----------------------- | ----------------------------------------------------------------------------------------- |+| **Intent to Sign** | Signers must demonstrate clear intent to sign the document |+| **Consent** | All parties must agree to conduct the transaction electronically |+| **Consumer Disclosure** | For consumer transactions, specific disclosures must be provided before obtaining consent |+| **Record Retention** | Electronic records must be accurately preserved and accessible for later reference |+| **Association** | The signature must be associated with the record being signed |++### Exclusions++The ESIGN Act does not apply to certain document types, including:++- Wills, codicils, and testamentary trusts+- Family law documents (adoption, divorce)+- Court orders and official court documents+- Cancellation of utility services+- Documents related to hazardous materials transportation++---++## UETA (United States)++The Uniform Electronic Transactions Act (UETA) is a model law adopted by 49 U.S. states (all except New York, which has its own Electronic Signatures and Records Act). UETA provides a legal framework for electronic signatures and records at the state level.++### Relationship to ESIGN++UETA and the ESIGN Act have similar requirements and purposes. The federal ESIGN Act allows states to modify or supersede certain ESIGN provisions if they adopt UETA or an equivalent law. In practice, the requirements for electronic signatures under both laws align closely.++### Key Requirements++- Intent to sign demonstrated by the signer+- Consent to conduct transactions electronically+- Retention of records in their original electronic form+- Attribution of the signature to the signer++---++## eIDAS (European Union)++The Electronic Identification, Authentication and Trust Services (eIDAS) regulation governs electronic signatures across all EU member states. eIDAS establishes three levels of electronic signatures, each with different requirements and legal effects.++### Signature Levels++| Level | Description | Legal Effect |+| ------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------- |+| **Simple (SES)** | Basic electronic signature with no specific technical requirements | Admissible as evidence; legal effect varies by use |+| **Advanced (AES)** | Uniquely linked to signer, capable of identifying signer, under sole control | Higher evidentiary weight than SES |+| **Qualified (QES)** | AES created by a qualified signature creation device, based on a qualified certificate | Equivalent to handwritten signature across the EU |++### Simple Electronic Signatures (SES)++SES is the baseline level. Any data in electronic form attached to or logically associated with other electronic data, used by the signatory to sign, qualifies as an SES. There are no specific technical requirements beyond demonstrating intent to sign.++### Advanced Electronic Signatures (AES)++AES must meet additional criteria:++- Uniquely linked to the signatory+- Capable of identifying the signatory+- Created using signature creation data under the signatory's sole control+- Linked to the signed data in a way that detects subsequent changes++### Qualified Electronic Signatures (QES)++QES requires:++- A qualified certificate issued by a qualified trust service provider+- Creation using a qualified electronic signature creation device+- Identity verification compliant with eIDAS requirements++QES carries the same legal standing as a handwritten signature in all EU member states.++---++## Other Jurisdictions++Electronic signature laws exist in most countries. Below are selected examples:++| Jurisdiction | Framework | Notes |+| ------------------ | --------------------------------------------- | ------------------------------------------------------------ |+| **United Kingdom** | UK eIDAS / Electronic Communications Act 2000 | Post-Brexit, UK maintains eIDAS-like framework |+| **Canada** | PIPEDA, provincial laws | Federal and provincial laws govern e-signatures |+| **Australia** | Electronic Transactions Act 1999 | Generally technology-neutral approach |+| **Switzerland** | ZertES | Swiss federal law with qualified signature requirements |+| **Brazil** | MP 2200-2, ICP-Brasil | PKI-based framework for digital signatures |+| **India** | IT Act 2000, Aadhaar e-KYC | Recognizes electronic signatures; Aadhaar-based verification |+| **China** | Electronic Signature Law | Requires reliable electronic signatures for certain uses |+| **Japan** | Electronic Signatures Act | Three-tier system similar to eIDAS |++Requirements vary significantly by jurisdiction. Some transactions may require specific signature types or have exclusions similar to the ESIGN Act.++---++## How Documenso Supports Compliance++Documenso provides features that support compliance with e-signature laws across jurisdictions:++### Intent to Sign++- Signers must actively interact with signature fields to apply their signature+- The signing interface clearly indicates the document being signed+- Signers receive a copy of the completed document++### Consent++- Recipients receive clear notification that they are being asked to sign electronically+- The signing process requires affirmative action from the signer++### Record Retention++- Signed documents are stored and accessible to all parties+- Original documents and audit trails are preserved+- Documents can be downloaded in their signed form at any time++### Document Integrity++- All completed documents are cryptographically sealed+- Any modification after signing invalidates the digital signature+- PDF readers can verify the document has not been altered++### Signer Identification++- Email-based delivery establishes signer identity+- Optional access codes add verification+- Signing activity is logged with timestamps and metadata++---++## Audit Trails++Documenso maintains an audit trail for each document, recording:++| Event | Recorded Data |+| ------------------ | -------------------------------------- |+| Document creation | Timestamp, creator identity |+| Recipient addition | Recipient details, assigned fields |+| Document sent | Timestamp, delivery method |+| Document viewed | Timestamp, viewer identity, IP address |+| Field completed | Timestamp, field type, signer identity |+| Document completed | Timestamp, final document hash |++The audit trail provides evidence of the signing process, including who signed, when they signed, and the sequence of events. This information supports the legal enforceability of the signed document.++---++## What Documenso Does NOT Provide++Documenso supports compliance with Simple Electronic Signature (SES) requirements. The following are not currently provided:++| Capability | Status |+| ----------------------------------------- | ------------------------------------------------------------------------------------- |+| **Qualified Electronic Signatures (QES)** | Not supported; requires integration with qualified trust service providers |+| **Advanced Electronic Signatures (AES)** | Partial support; full AES requires identity verification services |+| **Identity Verification (KYC)** | Not built-in; optional integrations may be available |+| **Qualified Certificates** | Not issued; would require becoming a qualified trust service provider |+| **Industry-Specific Compliance** | Features for specific regulations (e.g., healthcare, finance) depend on configuration |++For transactions requiring AES or QES, consult with legal counsel about appropriate solutions.++---++## Disclaimer++This page provides general information about electronic signature laws for educational purposes. It does not constitute legal advice.++Electronic signature requirements vary by jurisdiction, transaction type, and specific circumstances. Some documents may have specific legal requirements that electronic signatures cannot satisfy.++Consult qualified legal counsel in your jurisdiction to determine whether electronic signatures are appropriate for your specific use case and what requirements must be met.++---++## Related++- [Signature Levels](/docs/compliance/signature-levels) - Simple, Advanced, and Qualified electronic signatures explained+- [Standards & Regulations](/docs/compliance/standards) - SOC 2, 21 CFR Part 11, and other compliance frameworks+- [Signing Certificates](/docs/concepts/signing-certificates) - How documents are digitally signed and verifieddiff --git a/apps/docs/content/docs/compliance/gdpr.mdx b/apps/docs/content/docs/compliance/gdpr.mdxnew file mode 100644index 000000000..7b5502bf3--- /dev/null+++ b/apps/docs/content/docs/compliance/gdpr.mdx@@ -0,0 +1,174 @@+---+title: GDPR+description: Understand how Documenso handles GDPR compliance for data processing and storage.+---++import { Accordion, Accordions } from 'fumadocs-ui/components/accordion';+import { Tab, Tabs } from 'fumadocs-ui/components/tabs';++## Documenso's Role++When using Documenso for document signing, two distinct data processing roles apply:++| Role | Description |+| ------------------- | ------------------------------------------------------------------------------------- |+| **Data Controller** | You (the organisation using Documenso) determine the purposes and means of processing |+| **Data Processor** | Documenso processes personal data on your behalf according to your instructions |++As the data controller, you are responsible for:++- Obtaining appropriate consent or legal basis for processing+- Informing data subjects about how their data is used+- Responding to data subject access requests+- Ensuring compliance with GDPR requirements++As the data processor, Documenso:++- Processes data only according to your instructions+- Implements appropriate security measures+- Assists with data subject requests when needed+- Maintains records of processing activities++## Data Processing++Documenso processes personal data necessary to provide document signing services:++| Data Category | Examples | Purpose |+| ------------------ | ---------------------------------------------- | --------------------------------------- |+| **Identity Data** | Name, email address | User accounts, recipient identification |+| **Document Data** | Uploaded PDFs, field values | Document storage and signing |+| **Signature Data** | Signature images, signing timestamps | Recording signing actions |+| **Audit Data** | IP addresses, browser information, action logs | Audit trail and verification |++Data is processed for the following purposes:++- Delivering documents to recipients+- Recording signatures and other recipient actions+- Generating signed documents with audit trails+- Sending email notifications++## Data Storage Locations++Where your data is stored depends on how you use Documenso:++<Tabs items={['Documenso Cloud', 'Self-Hosted']}>+<Tab value="Documenso Cloud">++For the hosted cloud service:++- Application data is stored in data centres within the European Union+- Document storage uses EU-based infrastructure+- Backups are maintained in geographically separate EU locations++Contact Documenso for specific information about sub-processors and data centre locations.++</Tab>+<Tab value="Self-Hosted">++When you self-host Documenso:++- You control all data storage locations+- No data is transmitted to Documenso's infrastructure+- You choose your own database, file storage, and backup locations++Self-hosting provides complete control over data residency, which may be required for certain compliance scenarios.++</Tab>+</Tabs>++## Data Subject Rights++GDPR grants individuals specific rights regarding their personal data. As the data controller, you are responsible for fulfilling these requests:++| Right | Description |+| ----------------- | -------------------------------------------------------------------------- |+| **Access** | Data subjects can request a copy of their personal data |+| **Rectification** | Data subjects can request correction of inaccurate data |+| **Erasure** | Data subjects can request deletion of their data ("right to be forgotten") |+| **Portability** | Data subjects can request their data in a machine-readable format |+| **Restriction** | Data subjects can request limited processing of their data |+| **Objection** | Data subjects can object to certain types of processing |++When you receive a data subject request, you can:++- Export user and document data from your Documenso account+- Delete user accounts and associated documents+- Contact Documenso support for assistance with cloud-hosted data++## Data Deletion++Documenso supports data deletion to help fulfill erasure requests:++<Accordions type="multiple">+ <Accordion title="User Account Deletion">+ - Users can delete their own accounts+ - Account deletion removes profile data and authentication credentials+ - Team owners can remove members from teams+ </Accordion>+ <Accordion title="Document Deletion">+ - Document owners can delete documents in draft state+ - Completed documents can be deleted by the owner+ - Deletion removes the document, recipient data, and associated audit logs+ </Accordion>+ <Accordion title="Retention Considerations">+ For signed documents, you may need to balance deletion requests against:++ - Legal requirements to retain signed contracts+ - Your organisation's record-keeping policies+ - The rights of other parties to the signed document++ Consult with legal counsel to establish appropriate retention policies.++ </Accordion>+</Accordions>++## Self-Hosting for GDPR Compliance++Self-hosting Documenso can simplify GDPR compliance:++- **Data residency** - Store all data in your chosen jurisdiction+- **Sub-processor control** - No third-party data processors beyond your own infrastructure+- **Direct access** - Full database access for data subject requests+- **Retention control** - Implement custom data retention and deletion policies++See the [Self-Hosting Guide](/docs/self-hosting) for deployment options.++## Data Processing Agreement++A Data Processing Agreement (DPA) is a contract required by GDPR when a data controller engages a data processor.++<Tabs items={['Documenso Cloud', 'Self-Hosted']}>+<Tab value="Documenso Cloud">++- A DPA is available upon request+- Contact [[email protected]](mailto:[email protected]) to request a DPA+- The DPA covers Documenso's obligations as a data processor++</Tab>+<Tab value="Self-Hosted">++No DPA with Documenso is required since no personal data is processed by Documenso.++</Tab>+</Tabs>++---++## Disclaimer++This documentation is provided for informational purposes only and does not constitute legal advice. GDPR compliance depends on your specific circumstances, including how you use Documenso, what data you process, and your organisation's obligations.++Consult with qualified legal counsel to:++- Determine your GDPR obligations+- Draft appropriate privacy notices+- Establish lawful bases for processing+- Implement compliant data handling procedures++---++## Related++- [Standards & Regulations](/docs/compliance/standards) - eIDAS, ESIGN Act, and other compliance frameworks+- [Self-Hosting Guide](/docs/self-hosting) - Deploy Documenso on your own infrastructure+- [Security Settings](/docs/users/settings/security) - Configure authentication and security optionsdiff --git a/apps/docs/content/docs/compliance/index.mdx b/apps/docs/content/docs/compliance/index.mdxnew file mode 100644index 000000000..5364c5854--- /dev/null+++ b/apps/docs/content/docs/compliance/index.mdx@@ -0,0 +1,58 @@+---+title: Compliance+description: Legal and regulatory compliance information for electronic signatures.+---++## Overview++<Cards>+ <Card+ title="E-Sign Compliance"+ description="ESIGN Act, UETA, eIDAS, and electronic signature laws by jurisdiction."+ href="/docs/compliance/esign"+ />+ <Card+ title="GDPR"+ description="Data protection requirements for processing personal data in the EU."+ href="/docs/compliance/gdpr"+ />+</Cards>++## Additional Topics++<Cards>+ <Card+ title="Standards & Regulations"+ description="SOC 2, 21 CFR Part 11, and other compliance frameworks."+ href="/docs/compliance/standards"+ />+ <Card+ title="Signature Levels"+ description="Simple, Advanced, and Qualified electronic signatures under eIDAS."+ href="/docs/compliance/signature-levels"+ />+ <Card+ title="Certifications"+ description="Compliance status for industry certifications and regulatory frameworks."+ href="/docs/compliance/certifications"+ />+</Cards>++## Disclaimer++This documentation is provided for informational purposes only. It does not constitute legal advice and should not be relied upon as such.++Compliance requirements vary based on:++- Your jurisdiction and applicable laws+- The type of documents being signed+- Industry-specific regulations+- The parties involved in the transaction++Consult with qualified legal counsel to determine the specific requirements for your use case.++## Related++- [Privacy Policy](/docs/policies/privacy) - How Documenso handles personal data+- [Security](/docs/policies/security) - Security practices and measures+- [Terms of Service](/docs/policies/terms) - Terms governing use of Documensodiff --git a/apps/docs/content/docs/compliance/meta.json b/apps/docs/content/docs/compliance/meta.jsonnew file mode 100644index 000000000..efc47b54e--- /dev/null+++ b/apps/docs/content/docs/compliance/meta.json@@ -0,0 +1,4 @@+{+ "title": "Compliance",+ "pages": ["esign", "standards", "signature-levels", "gdpr", "certifications"]+}diff --git a/apps/docs/content/docs/compliance/signature-levels.mdx b/apps/docs/content/docs/compliance/signature-levels.mdxnew file mode 100644index 000000000..8fc89f59f--- /dev/null+++ b/apps/docs/content/docs/compliance/signature-levels.mdx@@ -0,0 +1,284 @@+---+title: Signature Levels+description: Understand the three eIDAS signature levels — SES, AES, and QES — their requirements, legal effect, and when to use each.+---++import { Accordion, Accordions } from 'fumadocs-ui/components/accordion';+import { Callout } from 'fumadocs-ui/components/callout';++<Callout type="info">+ Documenso seals all signed documents cryptographically, regardless of signature level, to prevent+ any alterations after signing.+</Callout>++### Compliance Status Overview++| Regulation | Status |+| ------------ | --------- |+| ESIGN / UETA | Compliant |+| eIDAS SES | Compliant |+| eIDAS AES | Planned |+| eIDAS QES | Planned |+| ZertES | Planned |++## U.S. ESIGN Act++<Callout type="info">Status: Compliant</Callout>++The Electronic Signatures in Global and National Commerce Act (ESIGN Act) is a U.S. federal law that ensures the legal validity and enforceability of electronic signatures and records in commerce.++### Main Requirements++- **Intent to Sign** - Parties must demonstrate their intent to sign+- **Consent** - All parties must consent to the use of electronic signatures and records+- **Consumer Disclosures** - Financial institutions must provide clear statements informing consumers before obtaining consent+- **Record Retention** - Electronic records must be maintained for later access by signers+- **Security** - Parties must take reasonable steps to ensure the security and integrity of electronic signatures and records++## UETA (Uniform Electronic Transactions Act)++<Callout type="info">Status: Compliant</Callout>++The Uniform Electronic Transactions Act provides a legal framework for the use of electronic signatures and records in electronic transactions, ensuring they have the same validity and enforceability as paper documents and handwritten signatures.++UETA shares the same core requirements as the [ESIGN Act](#us-esign-act).++## Simple Electronic Signatures (SES)++A Simple Electronic Signature is the most basic form of electronic signature. It includes any data in electronic form that is attached to or logically associated with other electronic data and used by the signatory to sign.++### Characteristics++| Aspect | Description |+| -------------------------- | ------------------------------------------------------------------------------------- |+| **Technical Requirements** | No specific technical requirements beyond demonstrating intent to sign |+| **Identity Verification** | None required; relies on email delivery or other indirect identification |+| **Legal Status** | Admissible as evidence; cannot be denied legal effect solely because it is electronic |+| **Examples** | Typed name, scanned signature image, checkbox acceptance, click-to-sign |++### When SES Is Appropriate++SES is suitable for many common business transactions:++- Standard contracts and agreements+- Internal approvals and sign-offs+- Terms of service acceptance+- Non-disclosure agreements+- Purchase orders and invoices+- Employment documents (in most jurisdictions)++The legal validity of SES depends on the specific transaction and jurisdiction. Many everyday business documents do not require higher signature levels.++---++## Advanced Electronic Signatures (AES)++An Advanced Electronic Signature meets additional technical and procedural requirements that provide stronger evidence of the signer's identity and the document's integrity.++### Requirements++Under eIDAS, an AES must satisfy four criteria:++1. **Uniquely linked to the signatory** - The signature is associated with a specific individual+2. **Capable of identifying the signatory** - The signature data reveals who signed+3. **Created using signature creation data under the signatory's sole control** - Only the signer can create the signature (e.g., private key, secure device)+4. **Linked to the data in such a way that any subsequent change is detectable** - Tampering invalidates the signature++### Characteristics++| Aspect | Description |+| -------------------------- | -------------------------------------------------------------------------- |+| **Technical Requirements** | Cryptographic signature with signer identification |+| **Identity Verification** | Required; must establish signer identity through verification process |+| **Legal Status** | Higher evidentiary weight than SES; stronger presumption of validity |+| **Implementation** | Typically requires identity verification service and personal certificates |++### Compliance Status++<Callout type="warn">+ Status: [Planned](https://github.com/documenso/backlog/issues/9) via third party until [Let's+ Sign](https://github.com/documenso/backlog/issues/21) is realized.+</Callout>++Current AES progress:++- Cryptographic signature sealing the document against tampering+- Signing using dedicated hardware (Hardware Security Module)+- Embedding signer identity in the cryptographic signature (planned)+- Being a government-audited trusted qualified services provider (planned)++### When AES Is Appropriate++AES is used when stronger proof of identity and intent is needed:++- Financial services agreements+- Real estate transactions (in some jurisdictions)+- Healthcare consent forms+- Government submissions+- High-value contracts+- Cross-border agreements within the EU++---++## Qualified Electronic Signatures (QES)++A Qualified Electronic Signature is the highest level of electronic signature under eIDAS. It is legally equivalent to a handwritten signature in all EU member states and carries a presumption of validity.++### Requirements++QES must meet all AES requirements plus:++1. **Qualified Certificate** - Issued by a Qualified Trust Service Provider (QTSP) that is accredited by an EU member state+2. **Qualified Electronic Signature Creation Device (QSCD)** - The signature is created using hardware or software that meets specific security standards+3. **Identity Verification** - In-person or equivalent remote verification compliant with eIDAS requirements++### Characteristics++| Aspect | Description |+| -------------------------- | --------------------------------------------------------------------- |+| **Technical Requirements** | Qualified certificate + qualified signature creation device |+| **Identity Verification** | Strict verification by a Qualified Trust Service Provider |+| **Legal Status** | Equivalent to handwritten signature across all EU member states |+| **Implementation** | Requires integration with a QTSP; typically involves external service |++### Compliance Status++<Callout type="warn">+ Status: [Planned](https://github.com/documenso/backlog/issues/32) via third party until [Let's+ Sign](https://github.com/documenso/backlog/issues/21) is realized.+</Callout>++### When QES Is Required++Certain transactions require or benefit from QES:++- Documents that legally require a handwritten signature under national law+- Court filings and legal documents+- Company formation documents+- Land registry transactions+- Notarized documents+- Regulated financial transactions+- Cross-border transactions requiring guaranteed recognition++---++## Comparison of Signature Levels++| Aspect | SES | AES | QES |+| ------------------------- | ------------ | ------------------------ | --------------------- |+| **Technical Complexity** | Low | Medium | High |+| **Identity Verification** | None | Required | Strict (QTSP) |+| **Legal Effect (EU)** | Admissible | Higher evidentiary value | Equal to handwritten |+| **Cost** | Low | Medium | Higher |+| **User Experience** | Simple | More steps | Most steps |+| **Signer Requirements** | Email access | Identity verification | Certificate from QTSP |++### Legal Recognition++| Jurisdiction | SES | AES | QES |+| ------------------ | ------------------------------- | -------------------------- | ------------------------------------ |+| **European Union** | Valid, evidentiary value varies | Enhanced evidentiary value | Equivalent to handwritten |+| **United States** | Valid under ESIGN/UETA | No formal distinction | No formal distinction |+| **United Kingdom** | Valid | Enhanced value | Equivalent to handwritten (UK eIDAS) |+| **Switzerland** | Valid | Valid | Equivalent to handwritten (ZertES) |++---++## What Documenso Provides++Documenso supports Simple Electronic Signatures (SES) with features that enhance evidentiary value:++### SES Features++- **Intent to Sign** - Signers actively interact with signature fields+- **Email-Based Delivery** - Documents sent to specific email addresses+- **Audit Trail** - Complete record of signing events, timestamps, and IP addresses+- **Document Integrity** - Cryptographic sealing detects any post-signing modifications+- **Record Retention** - Signed documents stored and accessible to all parties++### Additional Verification Options++- **Access Codes** - Require signers to enter a code before accessing documents+- **Signing Order** - Control the sequence of signatures++### What Documenso Does Not Provide++| Capability | Status |+| ----------------------------------------- | --------------------------------------------------------- |+| **Qualified Electronic Signatures (QES)** | Not supported; requires QTSP integration |+| **Advanced Electronic Signatures (AES)** | Partial; full AES requires identity verification services |+| **Identity Verification (KYC)** | Not built-in |+| **Qualified Certificates** | Not issued; would require QTSP status |++For transactions requiring AES or QES, you would need to integrate with external identity verification services or Qualified Trust Service Providers.++---++## ZertES (Swiss Federal Law)++<Callout type="warn">Status: [Planned](https://github.com/documenso/backlog/issues/34)</Callout>++ZertES is a Swiss federal law that regulates electronic signature compliance. It defines requirements similar to eIDAS for qualified electronic signatures within Switzerland.++---++## When You Need Higher Signature Levels++Consider using AES or QES when:++<Accordions type="multiple">+ <Accordion title="Legal Requirements">+ - National law requires a handwritten signature (QES may substitute)+ - Regulations specify signature requirements (e.g., certain financial or healthcare documents)+ - Cross-border enforceability is critical+ </Accordion>+ <Accordion title="Risk Factors">+ - High contract value or significant liability+ - Higher likelihood of disputes+ - Need for stronger non-repudiation+ - Counterparty or regulatory requirements specify higher levels+ </Accordion>+ <Accordion title="Industry Standards">+ - Financial services with regulatory oversight+ - Healthcare with patient consent requirements+ - Government or public sector contracts+ - Real estate transactions in regulated markets+ </Accordion>+ <Accordion title="Evaluating Your Needs">+ Most business transactions do not require AES or QES. Consider:++ 1. What does your jurisdiction require for this document type?+ 2. What do your counterparties or customers expect?+ 3. What is the risk if the signature is disputed?+ 4. Does your industry have specific requirements?++ When in doubt, consult with legal counsel to determine the appropriate signature level for your specific use case.++ </Accordion>+</Accordions>++---++## Disclaimer++This documentation is provided for informational purposes only and does not constitute legal advice.++The appropriate signature level for your documents depends on:++- Your jurisdiction and applicable laws+- The type of document being signed+- Industry-specific regulations+- Contractual requirements from counterparties+- Risk tolerance and dispute likelihood++Electronic signature requirements vary significantly across jurisdictions and document types. Some transactions have specific legal requirements that may mandate particular signature levels or exclude electronic signatures entirely.++Consult with qualified legal counsel to determine the signature level requirements for your specific use case.++---++## Related++- [E-Sign Compliance](/docs/compliance/esign) - ESIGN Act, UETA, eIDAS, and electronic signature laws+- [Signing Certificates](/docs/concepts/signing-certificates) - How documents are digitally signed and verified+- [Standards & Regulations](/docs/compliance/standards) - SOC 2, 21 CFR Part 11, and other frameworksdiff --git a/apps/docs/content/docs/compliance/standards.mdx b/apps/docs/content/docs/compliance/standards.mdxnew file mode 100644index 000000000..e2e30f887--- /dev/null+++ b/apps/docs/content/docs/compliance/standards.mdx@@ -0,0 +1,108 @@+---+title: Standards & Regulations+description: Key technical standards that ensure digital signatures are secure, interoperable, and valid long-term.+---++## PDF/A for Archival++PDF/A is an ISO-standardized version of PDF designed for long-term archival of electronic documents. Unlike standard PDFs, PDF/A files are self-contained and do not rely on external resources.++Key characteristics:++- All fonts must be embedded+- No external content references allowed+- No encryption that would prevent future access+- Metadata must be embedded in XMP format+- Color spaces must be device-independent or include ICC profiles++PDF/A has several conformance levels (PDF/A-1, PDF/A-2, PDF/A-3) with increasing capabilities. PDF/A-3, for example, allows embedding of arbitrary file formats as attachments.++For signed documents intended for long-term storage, PDF/A ensures the document remains readable and verifiable years or decades after signing.++## PAdES (PDF Advanced Electronic Signatures)++PAdES is a set of standards (ETSI EN 319 142) that defines profiles for electronic signatures in PDF documents. It builds on the PDF signature capabilities defined in ISO 32000 and adds requirements for long-term validity.++PAdES defines several signature profiles:++| Profile | Description |+| --------- | ---------------------------------------------------- |+| PAdES-B | Basic signature with signing certificate |+| PAdES-T | Adds a trusted timestamp |+| PAdES-LT | Adds validation data (certificates, revocation info) |+| PAdES-LTA | Adds long-term archival timestamps |++Each level builds upon the previous, with PAdES-LTA providing the strongest guarantees for long-term signature validity. The inclusion of validation data and archival timestamps allows signatures to be verified even after certificates expire or CAs cease operations.++## ISO 32000 (PDF Standard)++ISO 32000 is the international standard that defines the PDF format. It specifies the technical foundation for digital signatures in PDF documents.++Relevant signature capabilities defined in ISO 32000:++- Signature field dictionaries and appearance streams+- Cryptographic signature handlers+- Certificate and timestamp embedding+- Incremental updates for signature preservation+- Document modification detection++ISO 32000-2 (PDF 2.0) introduced additional features including support for more signature algorithms and improved encryption options.++## X.509 Certificates++X.509 is the standard format for public key certificates used in digital signatures. These certificates bind a public key to an identity and are issued by Certificate Authorities (CAs).++A typical X.509 certificate contains:++- Subject (identity information)+- Issuer (the CA that issued the certificate)+- Public key+- Validity period (not before / not after dates)+- Serial number+- Signature algorithm+- Extensions (key usage, policies, etc.)++For document signing, certificates typically include the "digital signature" key usage extension. Qualified certificates under eIDAS regulations have additional requirements and provide higher levels of assurance.++Certificate validation involves checking:++1. The certificate chain up to a trusted root CA+2. That no certificate in the chain has expired+3. Revocation status via CRL or OCSP++## RFC 3161 (Timestamping)++RFC 3161 defines the Internet X.509 Public Key Infrastructure Time-Stamp Protocol (TSP). Timestamps prove that a document existed in a specific state at a particular point in time.++A timestamp token contains:++- Hash of the signed data+- Time of issuance (from a trusted time source)+- Identifier of the Time Stamping Authority (TSA)+- TSA's digital signature++Timestamps serve two purposes in document signing:++1. **Proof of existence**: Demonstrates the document was signed before a certain time+2. **Signature validity extension**: Allows signature verification after the signing certificate expires++Without a trusted timestamp, a signature can only be verified while the signing certificate remains valid. With a timestamp, the signature remains verifiable as long as the timestamp can be validated.++## What Documenso Implements++Documenso implements digital signatures with the following characteristics:++- **PDF signatures**: Documents are signed using the PDF signature capabilities defined in ISO 32000+- **X.509 certificates**: Signatures use X.509 certificates for signer identification+- **Timestamps**: RFC 3161 timestamps can be applied to signatures+- **Signature visualization**: Signed documents include visual signature representations++For specific implementation details and configuration options, refer to the [signing certificates](/signing-certificates/overview) documentation.++Self-hosted deployments can configure their own signing certificates and timestamp authorities to meet specific compliance requirements.++## Related++- [Legal Validity](/compliance/legal-validity) - Legal frameworks for electronic signatures+- [Signing Certificates Overview](/signing-certificates/overview) - Certificate configuration+- [Audit Log](/features/audit-log) - Document activity trackingdiff --git a/apps/docs/content/docs/concepts/document-lifecycle.mdx b/apps/docs/content/docs/concepts/document-lifecycle.mdxnew file mode 100644index 000000000..b642c2138--- /dev/null+++ b/apps/docs/content/docs/concepts/document-lifecycle.mdx@@ -0,0 +1,97 @@+---+title: Document Lifecycle+description: Track document progress through draft, pending, completed, and rejected states.+---++import { Callout } from 'fumadocs-ui/components/callout';++## Document States++A document can be in one of four states:++| State | Description |+| ------------- | ----------------------------------------------------------------- |+| **Draft** | Document is being prepared and has not been sent |+| **Pending** | Document has been sent and is awaiting recipient actions |+| **Completed** | All recipients have completed their required actions |+| **Rejected** | A recipient has rejected the document (when rejection is enabled) |++## How a Document Moves Through States++```mermaid+flowchart LR+ Draft -- Send --> Pending+ Pending -- All recipients complete --> Completed+ Pending -- Recipient rejects --> Rejected+```++## Draft++When you upload a document or create one from a template, it starts in the **Draft** state. In this state, you can:++- Add and remove recipients+- Assign roles to recipients (signer, approver, viewer, CC)+- Add, move, and configure fields+- Set signing order+- Configure document settings (expiration, reminders, rejection)+- Delete the document++A draft document is only visible to you (the owner) and team members with appropriate permissions. Recipients cannot see or access the document until you send it.++**Transition:** A draft becomes **Pending** when you send it to recipients.++## Pending++Once sent, a document enters the **Pending** state. Recipients receive email notifications with links to view and complete their assigned actions.++While pending, you can:++- View recipient progress+- Resend notifications to recipients+- Void the document (cancels all pending actions)++<Callout type="info">+ You cannot modify the document content, recipients, or fields while it is pending.+</Callout>++**Transitions:**++- Becomes **Completed** when all recipients finish their required actions+- Becomes **Rejected** if any recipient rejects the document (requires rejection to be enabled)++## Completed++A document reaches the **Completed** state when all recipients have fulfilled their roles:++- Signers have signed+- Approvers have approved+- Viewers have viewed (if view confirmation is required)++At completion:++- All parties receive a copy of the signed document+- The document is sealed with a digital certificate+- An audit log is attached showing all actions taken++<Callout type="info">+ Completed documents cannot be modified. You can download the signed PDF or view the audit trail.+</Callout>++## Rejected++If you enable document rejection in settings, recipients can reject instead of signing. When any recipient rejects:++- The document immediately moves to **Rejected** state+- Other pending recipients can no longer act on the document+- The document owner is notified++<Callout type="info">+ Rejected documents cannot be modified or reactivated. To proceed, you need to create a new+ document.+</Callout>++## Related Concepts++- [Recipient Roles](/docs/concepts/recipient-roles) - The different roles recipients can have+- [Field Types](/docs/concepts/field-types) - Fields you can add to documents+- [Signing Workflow](/docs/concepts/signing-workflow) - How the signing process works for recipientsdiff --git a/apps/docs/content/docs/concepts/field-types.mdx b/apps/docs/content/docs/concepts/field-types.mdxnew file mode 100644index 000000000..54516d90b--- /dev/null+++ b/apps/docs/content/docs/concepts/field-types.mdx@@ -0,0 +1,314 @@+---+title: Field Types+description: Placeholder types for capturing signatures, text, dates, and selections during signing.+---++import { Callout } from 'fumadocs-ui/components/callout';++## Field Types Overview++| Field Type | Description | Auto-filled |+| ---------- | ------------------------------------------------- | ----------- |+| Signature | Recipient's signature (drawn, typed, or uploaded) | No |+| Initials | Recipient's initials | No |+| Email | Recipient's email address | Yes |+| Name | Recipient's full name | Yes |+| Date | Date the field was completed | Yes |+| Text | Free-form text input | No |+| Number | Numeric input with optional validation | No |+| Radio | Single selection from a list of options | No |+| Checkbox | Multiple selections from a list of options | No |+| Dropdown | Single selection from a dropdown menu | No |++## Signature++++The signature field captures the recipient's legally binding signature. Recipients can:++- **Draw** their signature using a mouse or touchscreen+- **Type** their name and select a font style+- **Upload** an image of their signature++### Configuration Options++| Option | Description |+| --------- | -------------------------------------------------- |+| Required | Whether the field must be completed before signing |+| Read-only | Lock the field with a pre-filled value |+| Label | Display text shown above the field |++### Common Use Cases++- Contract execution+- Agreement acceptance+- Authorization approvals++<Callout type="info">Each signer must have at least one Signature field assigned to them.</Callout>++## Initials++The initials field captures abbreviated signatures, typically used to acknowledge individual pages or clauses.++### Configuration Options++| Option | Description |+| -------------- | -------------------------------------- |+| Required | Whether the field must be completed |+| Read-only | Lock the field with a pre-filled value |+| Label | Display text shown above the field |+| Text alignment | Left, center, or right alignment |++### Common Use Cases++- Page acknowledgment+- Clause acceptance+- Change or amendment approval+++The email field displays the recipient's email address. This field is automatically populated with the email address used to send the signing request.++### Configuration Options++| Option | Description |+| -------------- | --------------------------------------------------- |+| Required | Whether the field must be completed |+| Read-only | Lock the field (recommended for auto-filled values) |+| Label | Display text shown above the field |+| Text alignment | Left, center, or right alignment |++### Common Use Cases++- Contact information sections+- Identity verification+- Record keeping++## Name++The name field captures the recipient's full name. When the recipient has a name on file, the field can be auto-populated.++### Configuration Options++| Option | Description |+| -------------- | -------------------------------------- |+| Required | Whether the field must be completed |+| Read-only | Lock the field with a pre-filled value |+| Label | Display text shown above the field |+| Text alignment | Left, center, or right alignment |++### Common Use Cases++- Signature blocks+- Party identification+- Contact details++## Date++The date field records when the recipient completed the field or signed the document. By default, it auto-fills with the current date.++### Configuration Options++| Option | Description |+| -------------- | -------------------------------------- |+| Required | Whether the field must be completed |+| Read-only | Lock the field with a pre-filled value |+| Label | Display text shown above the field |+| Text alignment | Left, center, or right alignment |++### Common Use Cases++- Signature date+- Agreement effective date+- Timestamp records++## Text++++The text field accepts free-form text input from recipients. Use this for any information that doesn't fit other field types.++### Configuration Options++| Option | Description |+| --------------- | ------------------------------------------ |+| Required | Whether the field must be completed |+| Read-only | Lock the field with a pre-filled value |+| Label | Display text shown above the field |+| Placeholder | Hint text shown when the field is empty |+| Default value | Pre-filled text that recipients can modify |+| Character limit | Maximum number of characters allowed |+| Text alignment | Left, center, or right alignment |+| Line height | Spacing between lines of text |+| Letter spacing | Spacing between characters |++### Rules++- A field cannot be both required and read-only at the same time+- A read-only field must have a default text value (it cannot be empty)+- The field is inserted automatically into the document if there is a default text value+- The text field character count cannot exceed the character limit+- The signer cannot modify a read-only field++### Common Use Cases++- Address input+- Company names+- Job titles+- Custom information++## Number++The number field accepts numeric input with optional validation constraints.++### Configuration Options++| Option | Description |+| -------------- | -------------------------------------------- |+| Required | Whether the field must be completed |+| Read-only | Lock the field with a pre-filled value |+| Label | Display text shown above the field |+| Placeholder | Hint text shown when the field is empty |+| Default value | Pre-filled number that recipients can modify |+| Minimum value | Lowest allowed number |+| Maximum value | Highest allowed number |+| Number format | Display format for the number |+| Text alignment | Left, center, or right alignment |++### Rules++- The value must be a number+- A field cannot be both required and read-only at the same time+- A read-only field must have a default number value+- If a default number and a maximum value are set, the default must be less than the maximum+- If a default number and a minimum value are set, the default must be greater than the minimum+- The value must match the number format if a number format is set++### Common Use Cases++- Quantities+- Pricing+- Phone numbers+- Employee IDs++## Radio++The radio field presents a list of options where the recipient can select exactly one.++### Configuration Options++| Option | Description |+| ----------------- | ---------------------------------------- |+| Required | Whether a selection must be made |+| Read-only | Lock the field with a pre-selected value |+| Label | Display text shown above the field |+| Options | List of selectable values |+| Default selection | Pre-selected option |+| Direction | Vertical or horizontal layout |++### Rules++- A field cannot be both required and read-only at the same time+- A read-only field must have at least one option+- The field auto-signs if there is a default value+- The signer cannot select a value that's not in the options list+- Only one option can be selected at a time++### Common Use Cases++- Yes/No questions+- Single-choice selections+- Status indicators+- Plan or tier selection++## Checkbox++++The checkbox field presents a list of options where the recipient can select multiple items.++### Configuration Options++| Option | Description |+| ------------------ | ------------------------------------------- |+| Required | Whether at least one selection must be made |+| Read-only | Lock the field with pre-selected values |+| Label | Display text shown above the field |+| Options | List of selectable values |+| Default selections | Pre-selected options |+| Validation rule | Rules for minimum/maximum selections |+| Direction | Vertical or horizontal layout |++### Rules++- A field cannot be both required and read-only at the same time+- A read-only field must have at least one checked option+- The field auto-signs if there are default values+- The validation rule enforces selection counts: "At least", "At most", or "Exactly" a specified number of options+- The signer cannot select a value that's not in the options list++### Common Use Cases++- Terms and conditions acceptance+- Multiple acknowledgments+- Feature selection+- Preference lists++## Dropdown++++The dropdown field presents a list of options in a collapsible menu. Recipients select one option from the list.++### Configuration Options++| Option | Description |+| ------------- | ---------------------------------------- |+| Required | Whether a selection must be made |+| Read-only | Lock the field with a pre-selected value |+| Label | Display text shown above the field |+| Options | List of selectable values |+| Default value | Pre-selected option |++### Rules++- A field cannot be both required and read-only at the same time+- A read-only field must have a default value+- The default value must be one of the options+- The field auto-signs if there is a default value+- The signer cannot select a value that's not in the options list++### Common Use Cases++- Country or state selection+- Department selection+- Category classification+- Status selection++## Common Configuration Options++All field types share these base configuration options:++| Option | Description | Default |+| --------- | --------------------------------------------------- | ------- |+| Required | Recipient must complete the field to finish signing | `false` |+| Read-only | Field value cannot be changed by the recipient | `false` |+| Label | Text displayed above or near the field | None |+| Font size | Size of the text in the field (8-96px) | 12px |++## Validation++Fields validate input based on their type and configuration:++- **Required fields** must be completed before the recipient can finish signing+- **Read-only fields** display pre-filled values that cannot be modified+- **Number fields** validate against minimum and maximum values when configured+- **Checkbox fields** can enforce a minimum or maximum number of selections++If validation fails, the recipient sees an error message and must correct the input before proceeding.++## Related++- [Add Fields to Documents](/docs/users/documents/add-fields) - Learn how to place fields on your documents+- [Recipient Roles](/docs/concepts/recipient-roles) - Understand who can be assigned fields+- [Fields API](/docs/developers/api/fields) - Programmatically add fields via the APIdiff --git a/apps/docs/content/docs/concepts/index.mdx b/apps/docs/content/docs/concepts/index.mdxnew file mode 100644index 000000000..4b0b1453d--- /dev/null+++ b/apps/docs/content/docs/concepts/index.mdx@@ -0,0 +1,70 @@+---+title: Concepts+description: Foundational concepts behind document signing, recipient roles, field types, and certificates.+---++## Core Concepts++<Cards>+ <Card+ title="Document Lifecycle"+ description="How documents move from draft to pending to completed or rejected."+ href="/docs/concepts/document-lifecycle"+ />+ <Card+ title="Recipient Roles"+ description="Signers, approvers, viewers, assistants, and CC recipients."+ href="/docs/concepts/recipient-roles"+ />+ <Card+ title="Field Types"+ description="Signatures, text, dates, checkboxes, dropdowns, and more."+ href="/docs/concepts/field-types"+ />+ <Card+ title="Signing Workflow"+ description="The complete process from preparing a document to collecting signatures and sealing the final PDF."+ href="/docs/concepts/signing-workflow"+ />+ <Card+ title="Signing Certificates"+ description="How documents are digitally signed and verified."+ href="/docs/concepts/signing-certificates"+ />+</Cards>++---++## How These Concepts Apply++These concepts work consistently across all ways you interact with Documenso:++- **Web application**: When you create documents in the UI, you'll select recipient roles, add fields, and track documents through their lifecycle states.++- **API integration**: The same concepts map directly to API endpoints. Documents have status fields, recipients have role properties, and fields have type configurations.++- **Self-hosting**: The signing certificate concept becomes particularly relevant when you deploy your own instance and configure your own certificates for document signing.++Understanding these fundamentals will make the rest of the documentation easier to follow.++---++## Related Sections++<Cards>+ <Card+ title="User Guide"+ description="Apply these concepts when sending documents."+ href="/docs/users"+ />+ <Card+ title="Developer Guide"+ description="Work with these concepts through the API."+ href="/docs/developers"+ />+ <Card+ title="Compliance"+ description="How these concepts relate to legal standards."+ href="/docs/compliance"+ />+</Cards>diff --git a/apps/docs/content/docs/concepts/meta.json b/apps/docs/content/docs/concepts/meta.jsonnew file mode 100644index 000000000..925998a98--- /dev/null+++ b/apps/docs/content/docs/concepts/meta.json@@ -0,0 +1,10 @@+{+ "title": "Concepts",+ "pages": [+ "document-lifecycle",+ "recipient-roles",+ "field-types",+ "signing-workflow",+ "signing-certificates"+ ]+}diff --git a/apps/docs/content/docs/concepts/recipient-roles.mdx b/apps/docs/content/docs/concepts/recipient-roles.mdxnew file mode 100644index 000000000..0841423c2--- /dev/null+++ b/apps/docs/content/docs/concepts/recipient-roles.mdx@@ -0,0 +1,171 @@+---+title: Recipient Roles+description: Signers, approvers, viewers, assistants, and CC recipients.+---++import { Callout } from 'fumadocs-ui/components/callout';+import { Tab, Tabs } from 'fumadocs-ui/components/tabs';++## Role Overview++| Role | Action Required | Can Sign | Description |+| --------- | --------------- | -------- | ---------------------------------------- |+| Signer | Yes | Yes | Must sign the document |+| Approver | Yes | Optional | Must approve the document |+| Viewer | Yes | No | Must view the document |+| Assistant | Yes | No | Can pre-fill fields for other recipients |+| CC | No | No | Receives a copy after completion |++## Role Details++<Tabs items={['Signer', 'Approver', 'Viewer', 'Assistant', 'CC']}>+ <Tab value="Signer">++Signers are the primary recipients of a document. They must complete all signature fields assigned to them before the document can be finalized.++**What they can do:**++- Sign signature fields assigned to them+- Fill out any other fields assigned to them (text, date, checkbox, etc.)+- Download the document after signing++**What they cannot do:**++- Sign on behalf of other recipients+- Modify fields assigned to other recipients++**When to use this role:**++- Contracts requiring a legally binding signature+- Agreements where the recipient must formally consent+- Any document that requires a signature to be valid++</Tab>+ <Tab value="Approver">++Approvers must review and approve the document, but signing is optional. The document cannot be completed until all approvers have given their approval.++**What they can do:**++- Approve or reject the document+- Optionally add a signature if signature fields are assigned+- Fill out fields assigned to them+- Download the document after approval++**What they cannot do:**++- Complete the document without explicitly approving it+- Modify fields assigned to other recipients++**When to use this role:**++- Documents requiring manager or supervisor approval+- Workflows where review is required before final signatures+- Compliance processes requiring sign-off from multiple parties++</Tab>+ <Tab value="Viewer">++Viewers must acknowledge that they have viewed the document. They cannot add signatures but must confirm they have reviewed the content.++**What they can do:**++- View the complete document+- Confirm they have viewed it+- Download the document after viewing++**What they cannot do:**++- Sign the document+- Fill out fields (no fields can be assigned to viewers)+- Modify the document in any way++**When to use this role:**++- Informational documents that require acknowledgment+- Policies or disclosures that recipients must review+- Documents where you need proof of receipt without a signature++</Tab>+ <Tab value="Assistant">++Assistants can prepare the document by pre-filling fields on behalf of other signers. This role is only available when sequential signing is enabled.++**What they can do:**++- Pre-fill suggested values in fields assigned to later signers+- Help prepare the document for the actual signers+- Fill out any fields specifically assigned to them++**What they cannot do:**++- Sign on behalf of other recipients+- Submit the document as complete+- Be used in parallel signing mode++**When to use this role:**++- Administrative staff preparing documents for executives to sign+- Workflows where one person gathers information and another signs+- Situations where you want to reduce the burden on the final signer++<Callout type="info">+ The Assistant role requires sequential signing to be enabled. You cannot use this role when+ recipients sign in parallel.+</Callout>++</Tab>+ <Tab value="CC">++CC recipients receive a copy of the completed document but do not need to take any action. They are notified when the document is fully signed.++**What they can do:**++- Receive a copy of the completed document+- Download the signed document++**What they cannot do:**++- Sign or approve the document+- View the document before it is completed+- Take any action that affects document completion++**When to use this role:**++- Keeping stakeholders informed about signed agreements+- Sending copies to legal or compliance teams+- Archiving completed documents with relevant parties++</Tab>+</Tabs>++## Signing Order++You can control the sequence in which recipients receive and act on a document by enabling signing order.++<Tabs items={['Parallel signing (default)', 'Sequential signing']}>+ <Tab value="Parallel signing (default)">++All recipients receive the document simultaneously and can act in any order. The document is completed when all required recipients have finished their actions.++</Tab>+ <Tab value="Sequential signing">++Recipients receive the document one at a time, in the order you specify. Each recipient must complete their action before the next recipient is notified.++To enable sequential signing:++1. When adding recipients, check the "Enable signing order" option+2. Assign an order number to each recipient+3. Recipients with the same order number can act simultaneously+4. The document proceeds to the next order number only when all recipients at the current level have completed their actions++<Callout type="info">Sequential signing is required if you want to use the Assistant role.</Callout>++</Tab>+</Tabs>++## Related++- [Add Recipients](/users/documents/add-recipients) - How to add recipients to a document+- [Field Types](/concepts/field-types) - Learn about the different field types you can assign to recipientsdiff --git a/apps/docs/content/docs/concepts/signing-certificates.mdx b/apps/docs/content/docs/concepts/signing-certificates.mdxnew file mode 100644index 000000000..7eb3e407e--- /dev/null+++ b/apps/docs/content/docs/concepts/signing-certificates.mdx@@ -0,0 +1,123 @@+---+title: Signing Certificates+description: Documenso digitally signs completed documents using X.509 certificates, providing cryptographic proof of authenticity and integrity.+---++import { Callout } from 'fumadocs-ui/components/callout';+import { Step, Steps } from 'fumadocs-ui/components/steps';+import { Tab, Tabs } from 'fumadocs-ui/components/tabs';++## How Documenso Signs Documents++Documenso applies a digital signature to the PDF when all recipients complete their actions.++{/* prettier-ignore */}+<Steps>+<Step>+### Create hash++Creates a cryptographic hash of the document content.++</Step>++<Step>+### Sign the hash++Signs the hash using the certificate's private key.++</Step>++<Step>+### Embed signature++Embeds the signature and certificate information into the PDF.++</Step>+</Steps>++The signature is applied at the platform level, not by individual signers. Each signer's actions (signature image, text, checkboxes) are recorded and sealed together in the final signed document.++## What the Signature Proves++The digital signature provides two guarantees:++| Guarantee | Description |+| ---------------- | -------------------------------------------------------------------------- |+| **Integrity** | The document has not been altered since signing |+| **Authenticity** | The document was signed by the certificate holder (the Documenso instance) |++If anyone modifies the PDF after signing, the signature becomes invalid. PDF readers will display a warning that the document has been changed.++## Timestamps++Documenso can include a trusted timestamp from a Time Stamping Authority (TSA) in the signature. This proves when the document was signed, independent of the signer's system clock. Timestamps are important for:++- Legal evidence of when signing occurred+- Long-term validation (LTV) of signatures+- Compliance with archival requirements++## Viewing the Signature in PDF Readers++You can verify a signed document's signature in any PDF reader that supports digital signatures.++<Tabs items={['Adobe Acrobat', 'Other PDF readers']}>+ <Tab value="Adobe Acrobat">++1. Open the signed PDF+2. Click the signature panel on the left, or click on a signature field+3. View certificate details, signing time, and validation status++</Tab>+ <Tab value="Other PDF readers">++Preview, Foxit, and other PDF readers also display signature information, though the interface varies. Look for a signatures or security panel in the application menu.++</Tab>+</Tabs>++The signature panel shows who signed (certificate subject), when it was signed, whether the document has been modified, and certificate trust status.++## Certificate Trust and Validation++PDF readers validate signatures against their list of trusted Certificate Authorities (CAs). You may see different validation results depending on the certificate type:++| Certificate Type | Validation Result |+| ---------------- | ---------------------------------------------------------------------- |+| **CA-issued** | Green checkmark in Adobe if the CA is on the Adobe Approved Trust List |+| **Self-signed** | Warning that the certificate is not from a trusted source |++<Callout type="info">+ A self-signed certificate still provides integrity verification. The document cannot be modified without invalidating the signature. The warning only indicates that a third-party CA has not verified the certificate issuer's identity.++For most use cases, self-signed certificates are sufficient. The signature still proves the document came from your Documenso instance and has not been tampered with.++</Callout>++## Using Custom Certificates++If you self-host Documenso, you can use your own signing certificate.++<Tabs items={['Self-signed', 'CA-issued']}>+ <Tab value="Self-signed">++Free and suitable for most use cases. The signature still proves document integrity and authenticity.++You may see a warning in PDF readers that the certificate is not from a trusted source, but the document cannot be modified without invalidating the signature.++</Tab>+ <Tab value="CA-issued">++Provides trusted validation in PDF readers (e.g. green checkmark in Adobe) when the CA is on the Adobe Approved Trust List.++Required for some compliance scenarios where third-party verification of the certificate issuer is needed.++</Tab>+</Tabs>++See [Signing Certificate Configuration](/docs/self-hosting/configuration/signing-certificate) for setup instructions.++## Related++- [Signature Levels](/docs/compliance/signature-levels) - Simple, Advanced, and Qualified electronic signatures+- [Standards and Regulations](/docs/compliance/standards) - ESIGN, eIDAS, and other compliance frameworks+- [Signing Certificate Configuration](/docs/self-hosting/configuration/signing-certificate) - Self-hosting certificate setupdiff --git a/apps/docs/content/docs/concepts/signing-workflow.mdx b/apps/docs/content/docs/concepts/signing-workflow.mdxnew file mode 100644index 000000000..adade3717--- /dev/null+++ b/apps/docs/content/docs/concepts/signing-workflow.mdx@@ -0,0 +1,260 @@+---+title: Signing Workflow+description: The complete process from preparing a document to collecting signatures and sealing the final PDF.+---++import { Callout } from 'fumadocs-ui/components/callout';+import { Step, Steps } from 'fumadocs-ui/components/steps';+import { Tab, Tabs } from 'fumadocs-ui/components/tabs';++## Workflow Overview++A typical signing workflow follows these steps:++```mermaid+flowchart LR+ A[Prepare Document] --> B[Send Document] --> C[Notify Recipients] --> D[Recipients Sign] --> E[Seal & Finalize] --> F[Document Completed]+```++1. **Prepare** - Upload the document, add recipients, and place fields+2. **Send** - Distribute the document to recipients+3. **Notify** - Recipients receive signing requests+4. **Sign** - Recipients complete their assigned fields+5. **Complete** - Document is sealed and distributed to all parties++{/* prettier-ignore */}+<Steps>+<Step>+### Prepare the document++Document preparation involves three main tasks: uploading, adding recipients, and placing fields.++**Upload the document**++Start by uploading a PDF. You can upload directly:++- from your device+- create from an existing template+- or duplicate a previously sent document.++Once uploaded, the document enters the **Draft** state.++**Add recipients**++Add the people who need to interact with the document. Each recipient needs:++- an email address+- a name+- a role++Available roles are:++| Role | Purpose |+| --------- | --------------------------------------------------- |+| Signer | Must sign the document |+| Approver | Must approve (signature optional) |+| Viewer | Must confirm they viewed the document |+| Assistant | Pre-fills fields for other recipients |+| CC | Receives a copy after completion (no action needed) |++**Place fields**++Add fields that recipients will complete. At minimum, each signer needs one signature field. You can also add:++- name+- date+- text+- number+- dropdown+- checkbox+- radio+- initials fields++Each field is assigned to a specific recipient, indicated by color coding in the editor.++<Callout type="info">+ The document cannot be sent until every signer has at least one signature field assigned to them.+</Callout>++</Step>++<Step>+### Send the document++When the document is ready, you send it to recipients. You have two distribution options:++<Tabs items={['Email distribution', 'Manual distribution']}>+ <Tab value="Email distribution">++Recipients receive an email notification with a link to sign.++You can customize the email:++- subject line+- message body with personalized variables+- reply-to address for recipient responses++</Tab>+ <Tab value="Manual distribution">++Generate signing links without sending emails.++Use this when you want to:++- send links via SMS or messaging apps+- embed links in your own application+- control notification timing yourself++</Tab>+</Tabs>++After sending, the document moves from **Draft** to **Pending** status.++</Step>++<Step>+### Recipients are notified++When you send a document via email, each recipient receives a notification containing:++- the document title+- your name and email (or team name)+- your custom message (or a role-specific default)+- a unique signing link++The signing link is specific to each recipient and cannot be used by others. Links remain active until the document is completed, deleted, or expired.++**Signing order**++By default, all recipients are notified simultaneously (parallel signing). If you enable sequential signing, only recipients in the first signing position receive notifications initially. When they complete their actions, the next group is notified.++This continues until all recipients have been notified and completed their actions.++</Step>++<Step>+### Recipients sign++When a recipient clicks their signing link, they see the document with their assigned fields highlighted. The signing experience depends on their role:++<Tabs items={['Signer', 'Approver', 'Viewer']}>+ <Tab value="Signer">++Signers must complete all required fields before they can finish. For signature fields, they can:++- draw a signature using mouse or touchscreen+- type their name and select a font style+- upload an image of their existing signature++After completing all fields, the signer clicks a button to submit. They receive a confirmation and can download a copy of the document showing their completed fields.++</Tab>+ <Tab value="Approver">++Approvers review the document and must explicitly approve it. If signature fields are assigned, they can optionally sign.++The document cannot proceed until all approvers have given approval.++</Tab>+ <Tab value="Viewer">++Viewers see the full document and must confirm they have viewed it. They cannot add signatures or modify any content.++</Tab>+</Tabs>++**Authentication**++You can require recipients to verify their identity before signing through:++- email verification (confirm access to the email address)+- access code (enter a code you provide separately)+- passkey (authenticate with a hardware or software passkey)++</Step>++<Step>+### Document is completed++Once all recipients with required actions have completed them, the document is finalized.++| Aspect | Description |+| ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |+| **Sealing** | The completed document is sealed with a digital certificate that cryptographically signs the PDF, prevents modification without detection, and provides proof of authenticity. |+| **Audit trail** | An audit log is generated and can be attached to the document. It records when the document was created and sent, when each recipient viewed and signed, IP addresses and timestamps for each action, and any authentication methods used. |+| **Distribution** | All parties receive the completed document: signers, approvers, and viewers receive their copy via email; CC recipients receive their first notification with the completed document; the document owner can download the signed PDF from their dashboard. |++</Step>+</Steps>++## Workflow Variations++Documenso supports several workflow variations to handle different signing scenarios.++<Tabs items={['Sequential signing', 'Approval workflows', 'Assistants for pre-filling', 'Direct links']}>+ <Tab value="Sequential signing">++When recipients must sign in a specific order, enable signing order:++1. Assign each recipient a signing position (1, 2, 3, etc.)+2. Recipients at position 1 sign first+3. Recipients at position 2 are notified only after position 1 completes+4. Multiple recipients can share the same position to sign in parallel within that step++Use sequential signing when later signers:++- need to see what earlier signers entered+- approval must happen before final signatures+- company policy requires a specific signing order++</Tab>+ <Tab value="Approval workflows">++Combine approver and signer roles to create approval workflows:++1. Add approvers at signing position 1+2. Add signers at signing position 2+3. Approvers review and approve first+4. Signers are notified only after approval is complete++<Callout type="warn">+ If an approver rejects the document (when rejection is enabled), the workflow stops and signers+ are never notified.+</Callout>++</Tab>+ <Tab value="Assistants for pre-filling">++Use assistants to have one person prepare the document for another:++1. Add an assistant at signing position 1+2. Add the final signer at signing position 2+3. The assistant pre-fills fields with suggested values+4. The signer reviews and completes their signature++This is useful when administrative staff prepare documents for executives or when gathering information from one person while another signs.++<Callout type="info">+ The Assistant role is only available when sequential signing is enabled.+</Callout>++</Tab>+ <Tab value="Direct links">++For high-volume signing scenarios, you can create direct links that allow anyone to sign without receiving an individual invitation:++- Generate a public signing link for a document or template+- Share the link on your website, in emails, or through other channels+- Each person who accesses the link creates their own signing instance+- Useful for waivers, consent forms, and public agreements++</Tab>+</Tabs>++## Related Concepts++- [Document Lifecycle](/docs/concepts/document-lifecycle) - Understanding document states from draft to completion+- [Recipient Roles](/docs/concepts/recipient-roles) - Detailed explanation of each role type+- [Field Types](/docs/concepts/field-types) - All available field types and their configuration options+- [Signing Certificates](/docs/concepts/signing-certificates) - How documents are digitally sealeddiff --git a/apps/docs/content/docs/developers/api/developer-mode.mdx b/apps/docs/content/docs/developers/api/developer-mode.mdxnew file mode 100644index 000000000..f5bd2e871--- /dev/null+++ b/apps/docs/content/docs/developers/api/developer-mode.mdx@@ -0,0 +1,37 @@+---+title: Developer Mode+description: Advanced development tools for debugging field coordinates and integrating with the Documenso API.+---++## Overview++Developer mode provides additional tools and features to help you integrate and debug Documenso.++## Field Coordinates++Field coordinates represent the position of a field in a document. They are returned in the `pageX`, `pageY`, `width` and `height` properties of the field.++To enable field coordinates, add the `devmode=true` query parameter to the editor URL.++```bash+# Legacy editor++https://app.documenso.com/t/<team-url>/documents/<envelope-id>/legacy_editor?devmode=true+```++++```bash+# New editor++https://app.documenso.com/t/<team-url>/documents/<envelope-id>/edit?step=addFields&devmode=true+```++++---++## See Also++- [Fields API](/docs/developers/api/fields) - Create and position fields via API+- [Field Types](/docs/concepts/field-types) - Detailed field type referencediff --git a/apps/docs/content/docs/developers/api/documents.mdx b/apps/docs/content/docs/developers/api/documents.mdxnew file mode 100644index 000000000..05433cc3c--- /dev/null+++ b/apps/docs/content/docs/developers/api/documents.mdx@@ -0,0 +1,815 @@+---+title: Documents API+description: Create, manage, and send documents for signing via the API.+---++import { Callout } from 'fumadocs-ui/components/callout';+import { Tab, Tabs } from 'fumadocs-ui/components/tabs';++<Callout type="warn">+ This guide may not reflect the latest endpoints or parameters. For an always up-to-date reference,+ see the [OpenAPI Reference](https://openapi.documenso.com).+</Callout>++## Overview++[Documents](/docs/users/documents) (called "envelopes" in the API) are the core resource in Documenso. You can:++1. create documents with recipients and fields+2. send them for signing+3. track their status+4. retrieve the completed PDFs++Each document contains one or more PDF files, a list of recipients, and the fields they need to fill.++## Document Object++A document object contains the following properties:++| Property | Type | Description |+| --------------- | -------------- | -------------------------------------------------------------- |+| `id` | string | Unique identifier (e.g., `envelope_abc123`) |+| `type` | string | `DOCUMENT` or `TEMPLATE` |+| `status` | string | Current status: `DRAFT`, `PENDING`, `COMPLETED`, or `REJECTED` |+| `title` | string | Document title |+| `source` | string | How the document was created: `DOCUMENT`, `TEMPLATE`, `API` |+| `visibility` | string | Who can view: `EVERYONE`, `ADMIN`, `MANAGER_AND_ABOVE` |+| `externalId` | string \| null | Your custom identifier for the document |+| `createdAt` | string | ISO 8601 timestamp |+| `updatedAt` | string | ISO 8601 timestamp |+| `completedAt` | string \| null | Timestamp when all recipients completed signing |+| `deletedAt` | string \| null | Timestamp if soft-deleted |+| `recipients` | array | List of recipients and their signing status |+| `fields` | array | Signature and form fields on the document |+| `envelopeItems` | array | PDF files attached to the document |+| `documentMeta` | object | Email settings, redirect URL, signing options |++### Example Document Object++```json+{+ "id": "envelope_abc123xyz",+ "type": "DOCUMENT",+ "status": "PENDING",+ "source": "API",+ "visibility": "EVERYONE",+ "title": "Service Agreement",+ "externalId": "contract-2025-001",+ "createdAt": "2025-01-15T10:30:00.000Z",+ "updatedAt": "2025-01-15T10:35:00.000Z",+ "completedAt": null,+ "deletedAt": null,+ "recipients": [+ {+ "id": 1,+ "email": "[email protected]",+ "name": "John Smith",+ "role": "SIGNER",+ "signingStatus": "NOT_SIGNED",+ "signingOrder": 1+ }+ ],+ "fields": [+ {+ "id": "field_123",+ "type": "SIGNATURE",+ "page": 1,+ "positionX": 10,+ "positionY": 80,+ "width": 30,+ "height": 5,+ "recipientId": 1+ }+ ],+ "envelopeItems": [+ {+ "id": "envelope_item_xyz",+ "title": "contract.pdf",+ "order": 1+ }+ ],+ "documentMeta": {+ "subject": "Please sign this document",+ "message": "Hi, please review and sign this agreement.",+ "timezone": "America/New_York",+ "redirectUrl": "https://example.com/thank-you"+ }+}+```++## List Documents++Retrieve a paginated list of documents.++```+GET /envelope+```++### Query Parameters++| Parameter | Type | Description |+| ------------------ | ------- | ------------------------------------------------------------- |+| `page` | integer | Page number (default: 1) |+| `perPage` | integer | Results per page (default: 10, max: 100) |+| `type` | string | Filter by `DOCUMENT` or `TEMPLATE` |+| `status` | string | Filter by status: `DRAFT`, `PENDING`, `COMPLETED`, `REJECTED` |+| `source` | string | Filter by creation source |+| `folderId` | string | Filter by folder ID |+| `orderByColumn` | string | Sort field (only `createdAt` supported) |+| `orderByDirection` | string | Sort direction: `asc` or `desc` (default: `desc`) |++### Code Examples++<Tabs items={['curl', 'TypeScript']}>+<Tab value="curl">+```bash+# List all documents+curl -X GET "https://app.documenso.com/api/v2/envelope" \+ -H "Authorization: api_xxxxxxxxxxxxxxxx"++# Filter by status and paginate++curl -X GET "https://app.documenso.com/api/v2/envelope?status=PENDING&page=1&perPage=20" \+ -H "Authorization: api_xxxxxxxxxxxxxxxx"++# List only documents (not templates)++curl -X GET "https://app.documenso.com/api/v2/envelope?type=DOCUMENT" \+ -H "Authorization: api_xxxxxxxxxxxxxxxx"++````+</Tab>+<Tab value="TypeScript">+```typescript+const API_TOKEN = process.env.DOCUMENSO_API_TOKEN;+const BASE_URL = 'https://app.documenso.com/api/v2';++// List all documents+const response = await fetch(`${BASE_URL}/envelope`, {+ method: 'GET',+ headers: {+ Authorization: API_TOKEN,+ },+});++const { data, pagination } = await response.json();+console.log(`Found ${pagination.totalItems} documents`);++// Filter by status+const pendingResponse = await fetch(+ `${BASE_URL}/envelope?status=PENDING&page=1&perPage=20`,+ {+ method: 'GET',+ headers: {+ Authorization: API_TOKEN,+ },+ }+);++const pendingDocs = await pendingResponse.json();+````++</Tab>+</Tabs>++### Response++```json+{+ "data": [+ {+ "id": "envelope_abc123",+ "type": "DOCUMENT",+ "status": "PENDING",+ "title": "Service Agreement",+ "createdAt": "2025-01-15T10:30:00.000Z",+ "updatedAt": "2025-01-15T10:35:00.000Z",+ "recipients": [+ {+ "id": 1,+ "email": "[email protected]",+ "name": "John Smith",+ "role": "SIGNER",+ "signingStatus": "NOT_SIGNED"+ }+ ]+ }+ ],+ "pagination": {+ "page": 1,+ "perPage": 10,+ "totalPages": 5,+ "totalItems": 42+ }+}+```++---++## Get Document++Retrieve a single document by ID.++```+GET /envelope/{envelopeId}+```++### Path Parameters++| Parameter | Type | Description |+| ------------ | ------ | ----------------------------------------- |+| `envelopeId` | string | The document ID (e.g., `envelope_abc123`) |++### Code Examples++<Tabs items={['curl', 'TypeScript']}>+<Tab value="curl">+```bash+curl -X GET "https://app.documenso.com/api/v2/envelope/envelope_abc123" \+ -H "Authorization: api_xxxxxxxxxxxxxxxx"+```+</Tab>+<Tab value="TypeScript">+```typescript+const envelopeId = 'envelope_abc123';++const response = await fetch(`https://app.documenso.com/api/v2/envelope/${envelopeId}`, {+ method: 'GET',+ headers: {+ Authorization: 'api_xxxxxxxxxxxxxxxx',+ },+});++const document = await response.json();+console.log(document.title, document.status);+````+</Tab>+</Tabs>++### Response++Returns the full document object including recipients, fields, and envelope items.++```json+{+ "id": "envelope_abc123",+ "type": "DOCUMENT",+ "status": "PENDING",+ "title": "Service Agreement",+ "recipients": [...],+ "fields": [...],+ "envelopeItems": [...],+ "documentMeta": {...}+}+````++---++## Create Document++Create a new document with optional recipients and fields in a single request.++```+POST /envelope/create+Content-Type: multipart/form-data+```++### Request Body++The request uses `multipart/form-data` with two parts:++| Part | Type | Description |+| --------- | ------- | ---------------------- |+| `payload` | JSON | Document configuration |+| `files` | File(s) | One or more PDF files |++### Payload Schema++| Field | Type | Required | Description |+| ------------ | ------ | -------- | ------------------------------------------- |+| `type` | string | Yes | Must be `DOCUMENT` |+| `title` | string | Yes | Document title |+| `externalId` | string | No | Your custom identifier |+| `visibility` | string | No | `EVERYONE`, `ADMIN`, or `MANAGER_AND_ABOVE` |+| `folderId` | string | No | Folder ID to create the document in |+| `recipients` | array | No | Recipients with optional fields |+| `meta` | object | No | Email subject, message, redirect URL, etc. |++### Code Examples++<Tabs items={['curl', 'TypeScript']}>+<Tab value="curl">+```bash+curl -X POST "https://app.documenso.com/api/v2/envelope/create" \+ -H "Authorization: api_xxxxxxxxxxxxxxxx" \+ -H "Content-Type: multipart/form-data" \+ -F 'payload={+ "type": "DOCUMENT",+ "title": "Service Agreement",+ "externalId": "contract-2025-001",+ "recipients": [+ {+ "email": "[email protected]",+ "name": "John Smith",+ "role": "SIGNER",+ "fields": [+ {+ "identifier": 0,+ "type": "SIGNATURE",+ "page": 1,+ "positionX": 10,+ "positionY": 80,+ "width": 30,+ "height": 5+ },+ {+ "identifier": 0,+ "type": "DATE",+ "page": 1,+ "positionX": 50,+ "positionY": 80,+ "width": 20,+ "height": 3+ }+ ]+ }+ ],+ "meta": {+ "subject": "Please sign this agreement",+ "message": "Hi John, please review and sign the attached agreement.",+ "redirectUrl": "https://example.com/thank-you"+ }+ }' \+ -F "files=@./contract.pdf;type=application/pdf"+```+</Tab>+<Tab value="TypeScript">+```typescript+import fs from 'fs';+import FormData from 'form-data';++const form = new FormData();++const payload = {+ type: 'DOCUMENT',+ title: 'Service Agreement',+ externalId: 'contract-2025-001',+ recipients: [+ {+ email: '[email protected]',+ name: 'John Smith',+ role: 'SIGNER',+ fields: [+ {+ identifier: 0,+ type: 'SIGNATURE',+ page: 1,+ positionX: 10,+ positionY: 80,+ width: 30,+ height: 5,+ },+ {+ identifier: 0,+ type: 'DATE',+ page: 1,+ positionX: 50,+ positionY: 80,+ width: 20,+ height: 3,+ },+ ],+ },+ ],+ meta: {+ subject: 'Please sign this agreement',+ message: 'Hi John, please review and sign the attached agreement.',+ redirectUrl: 'https://example.com/thank-you',+ },+};++form.append('payload', JSON.stringify(payload));+form.append('files', fs.createReadStream('./contract.pdf'), {+ contentType: 'application/pdf',+});++const response = await fetch('https://app.documenso.com/api/v2/envelope/create', {+ method: 'POST',+ headers: {+ Authorization: 'api_xxxxxxxxxxxxxxxx',+ },+ body: form,+});++const { id } = await response.json();+console.log('Created document:', id);+````+</Tab>+</Tabs>++### Response++```json+{+ "id": "envelope_abc123xyz"+}+````++### Field Positioning++Field positions use percentage values (0-100) relative to the PDF page:++| Parameter | Description |+| ------------ | ---------------------------------------------------------- |+| `positionX` | Horizontal position from left edge (0 = left, 100 = right) |+| `positionY` | Vertical position from top edge (0 = top, 100 = bottom) |+| `width` | Field width as percentage of page width |+| `height` | Field height as percentage of page height |+| `page` | Page number (1-indexed) |+| `identifier` | File index (0 for first file) or filename |++### Field Types++| Type | Description |+| ----------- | --------------------------- |+| `SIGNATURE` | Signature field |+| `INITIALS` | Initials field |+| `NAME` | Auto-filled recipient name |+| `EMAIL` | Auto-filled recipient email |+| `DATE` | Signing date |+| `TEXT` | Free text input |+| `NUMBER` | Numeric input |+| `CHECKBOX` | Checkbox selection |+| `RADIO` | Radio button group |+| `DROPDOWN` | Dropdown selection |++### Recipient Roles++| Role | Description |+| ---------- | ----------------------------------------- |+| `SIGNER` | Must sign the document |+| `APPROVER` | Must approve before signers can sign |+| `CC` | Receives a copy but doesn't sign |+| `VIEWER` | Can view the document but takes no action |++---++## Update Document++Update a document's properties. Only works on documents in `DRAFT` status.++```+POST /envelope/update+```++### Request Body++| Field | Type | Required | Description |+| ------------ | ------ | -------- | ------------------------------------ |+| `envelopeId` | string | Yes | Document ID |+| `data` | object | No | Document properties to update |+| `meta` | object | No | Email and signing settings to update |++### Code Examples++<Tabs items={['curl', 'TypeScript']}>+<Tab value="curl">+```bash+curl -X POST "https://app.documenso.com/api/v2/envelope/update" \+ -H "Authorization: api_xxxxxxxxxxxxxxxx" \+ -H "Content-Type: application/json" \+ -d '{+ "envelopeId": "envelope_abc123",+ "data": {+ "title": "Updated Service Agreement",+ "externalId": "contract-2025-001-v2"+ },+ "meta": {+ "subject": "Updated: Please sign this agreement",+ "redirectUrl": "https://example.com/signed"+ }+ }'+```+</Tab>+<Tab value="TypeScript">+```typescript+const response = await fetch('https://app.documenso.com/api/v2/envelope/update', {+ method: 'POST',+ headers: {+ Authorization: 'api_xxxxxxxxxxxxxxxx',+ 'Content-Type': 'application/json',+ },+ body: JSON.stringify({+ envelopeId: 'envelope_abc123',+ data: {+ title: 'Updated Service Agreement',+ externalId: 'contract-2025-001-v2',+ },+ meta: {+ subject: 'Updated: Please sign this agreement',+ redirectUrl: 'https://example.com/signed',+ },+ }),+});++const document = await response.json();++```+</Tab>+</Tabs>++---++## Send Document++Send a document to recipients for signing. This changes the status from `DRAFT` to `PENDING`.++```++POST /envelope/distribute++````++### Request Body++| Field | Type | Required | Description |+| --- | --- | --- | --- |+| `envelopeId` | string | Yes | Document ID |+| `meta` | object | No | Override email settings for this send |++### Code Examples++<Tabs items={['curl', 'TypeScript']}>+<Tab value="curl">+```bash+# Basic send+curl -X POST "https://app.documenso.com/api/v2/envelope/distribute" \+ -H "Authorization: api_xxxxxxxxxxxxxxxx" \+ -H "Content-Type: application/json" \+ -d '{+ "envelopeId": "envelope_abc123"+ }'++# Send with custom email settings+curl -X POST "https://app.documenso.com/api/v2/envelope/distribute" \+ -H "Authorization: api_xxxxxxxxxxxxxxxx" \+ -H "Content-Type: application/json" \+ -d '{+ "envelopeId": "envelope_abc123",+ "meta": {+ "subject": "Action Required: Sign Agreement",+ "message": "Please sign this document by end of day.",+ "timezone": "America/New_York"+ }+ }'+````++</Tab>+<Tab value="TypeScript">+```typescript+const response = await fetch('https://app.documenso.com/api/v2/envelope/distribute', {+ method: 'POST',+ headers: {+ Authorization: 'api_xxxxxxxxxxxxxxxx',+ 'Content-Type': 'application/json',+ },+ body: JSON.stringify({+ envelopeId: 'envelope_abc123',+ meta: {+ subject: 'Action Required: Sign Agreement',+ message: 'Please sign this document by end of day.',+ },+ }),+});++const { id, recipients } = await response.json();++// Recipients now include signing URLs+recipients.forEach((r) => {+ console.log(`${r.email}: ${r.signingUrl}`);+});++````+</Tab>+</Tabs>++### Response++The response includes signing URLs for each recipient:++```json+{+ "success": true,+ "id": "envelope_abc123",+ "recipients": [+ {+ "id": 1,+ "name": "John Smith",+ "email": "[email protected]",+ "token": "abc123xyz",+ "role": "SIGNER",+ "signingOrder": 1,+ "signingUrl": "https://app.documenso.com/sign/abc123xyz"+ }+ ]+}+````++<Callout type="info">+ Use the `signingUrl` to redirect recipients directly to the signing page, or let them use the+ email link.+</Callout>++---++## Delete Document++Delete a document. Completed documents cannot be deleted.++```+POST /envelope/delete+```++### Request Body++| Field | Type | Required | Description |+| ------------ | ------ | -------- | ----------- |+| `envelopeId` | string | Yes | Document ID |++### Code Examples++<Tabs items={['curl', 'TypeScript']}>+<Tab value="curl">+```bash+curl -X POST "https://app.documenso.com/api/v2/envelope/delete" \+ -H "Authorization: api_xxxxxxxxxxxxxxxx" \+ -H "Content-Type: application/json" \+ -d '{+ "envelopeId": "envelope_abc123"+ }'+```+</Tab>+<Tab value="TypeScript">+```typescript+const response = await fetch('https://app.documenso.com/api/v2/envelope/delete', {+ method: 'POST',+ headers: {+ Authorization: 'api_xxxxxxxxxxxxxxxx',+ 'Content-Type': 'application/json',+ },+ body: JSON.stringify({+ envelopeId: 'envelope_abc123',+ }),+});++const { success } = await response.json();++````+</Tab>+</Tabs>++### Response++```json+{+ "success": true+}+````++---++## Get Multiple Documents++Retrieve multiple documents by their IDs in a single request.++```+POST /envelope/get-many+```++### Request Body++| Field | Type | Required | Description |+| ------------- | ----- | -------- | --------------------- |+| `envelopeIds` | array | Yes | Array of document IDs |++### Code Examples++<Tabs items={['curl', 'TypeScript']}>+<Tab value="curl">+```bash+curl -X POST "https://app.documenso.com/api/v2/envelope/get-many" \+ -H "Authorization: api_xxxxxxxxxxxxxxxx" \+ -H "Content-Type: application/json" \+ -d '{+ "envelopeIds": ["envelope_abc123", "envelope_def456", "envelope_ghi789"]+ }'+```+</Tab>+<Tab value="TypeScript">+```typescript+const response = await fetch('https://app.documenso.com/api/v2/envelope/get-many', {+ method: 'POST',+ headers: {+ Authorization: 'api_xxxxxxxxxxxxxxxx',+ 'Content-Type': 'application/json',+ },+ body: JSON.stringify({+ envelopeIds: ['envelope_abc123', 'envelope_def456', 'envelope_ghi789'],+ }),+});++const documents = await response.json();++````+</Tab>+</Tabs>++---++## Document Statuses++| Status | Description |+| --- | --- |+| `DRAFT` | Document is being prepared. Recipients have not been notified. |+| `PENDING` | Document has been sent. Waiting for recipients to sign. |+| `COMPLETED` | All recipients have signed. Document is sealed. |+| `REJECTED` | A recipient rejected the document. |++### Status Transitions++```mermaid+flowchart LR+ DRAFT --> PENDING --> COMPLETED+ PENDING --> REJECTED+```++- **DRAFT to PENDING**: Call the distribute endpoint+- **PENDING to COMPLETED**: All recipients complete their signing+- **PENDING to REJECTED**: A recipient rejects the document++<Callout type="warn">+ You cannot modify recipients or fields after a document moves to `PENDING` status.+</Callout>++---++## Filtering and Pagination++### Pagination Parameters++| Parameter | Type | Default | Description |+| --------- | ------- | ------- | --------------------------- |+| `page` | integer | 1 | Page number |+| `perPage` | integer | 10 | Results per page (max: 100) |++### Filter Parameters++| Parameter | Values | Description |+| ---------- | ------------------------------------------- | ------------------------- |+| `type` | `DOCUMENT`, `TEMPLATE` | Filter by envelope type |+| `status` | `DRAFT`, `PENDING`, `COMPLETED`, `REJECTED` | Filter by status |+| `source` | `DOCUMENT`, `TEMPLATE`, `API` | Filter by creation source |+| `folderId` | string | Filter by folder |++### Sorting++| Parameter | Values | Description |+| ------------------ | ------------- | -------------------------------- |+| `orderByColumn` | `createdAt` | Field to sort by |+| `orderByDirection` | `asc`, `desc` | Sort direction (default: `desc`) |++### Example: Fetch All Pending Documents++```typescript+async function getAllPendingDocuments() {+ const documents = [];+ let page = 1;+ let hasMore = true;++ while (hasMore) {+ const response = await fetch(+ `https://app.documenso.com/api/v2/envelope?status=PENDING&page=${page}&perPage=100`,+ {+ headers: { Authorization: 'api_xxxxxxxxxxxxxxxx' },+ },+ );++ const { data, pagination } = await response.json();+ documents.push(...data);++ hasMore = page < pagination.totalPages;+ page++;+ }++ return documents;+}+```++---++## See Also++- [Recipients API](/docs/developers/api/recipients) - Add and manage document recipients+- [Fields API](/docs/developers/api/fields) - Add signature and form fields+- [Templates API](/docs/developers/api/templates) - Create reusable document templates+- [Webhooks](/docs/developers/webhooks) - Get notified when documents are signeddiff --git a/apps/docs/content/docs/developers/api/fields.mdx b/apps/docs/content/docs/developers/api/fields.mdxnew file mode 100644index 000000000..6d55fb2d7--- /dev/null+++ b/apps/docs/content/docs/developers/api/fields.mdx@@ -0,0 +1,738 @@+---+title: Fields API+description: Add signature and form fields to documents via API.+---++import { Callout } from 'fumadocs-ui/components/callout';+import { Tab, Tabs } from 'fumadocs-ui/components/tabs';++<Callout type="warn">+ This guide may not reflect the latest endpoints or parameters. For an always up-to-date reference,+ see the [OpenAPI Reference](https://openapi.documenso.com).+</Callout>++## Field Object++| Property | Type | Description |+| ---------------- | -------------- | -------------------------------------------- |+| `id` | number | Unique field identifier |+| `secondaryId` | string | Secondary identifier for audit logs |+| `type` | string | Field type (see [Field Types](#field-types)) |+| `recipientId` | number | ID of the recipient assigned to this field |+| `envelopeId` | number | ID of the parent envelope |+| `envelopeItemId` | string | ID of the PDF item the field is placed on |+| `page` | number | Page number (1-indexed) |+| `positionX` | number | X coordinate as percentage (0-100) |+| `positionY` | number | Y coordinate as percentage (0-100) |+| `width` | number | Width as percentage of page (0-100) |+| `height` | number | Height as percentage of page (0-100) |+| `customText` | string | Value entered by the recipient |+| `inserted` | boolean | Whether the field has been completed |+| `fieldMeta` | object \| null | Type-specific configuration options |++### Example Field Object++```json+{+ "id": 456,+ "secondaryId": "field_abc123",+ "type": "SIGNATURE",+ "recipientId": 123,+ "envelopeId": 789,+ "envelopeItemId": "envelope_item_xyz",+ "page": 1,+ "positionX": 10,+ "positionY": 80,+ "width": 30,+ "height": 5,+ "customText": "",+ "inserted": false,+ "fieldMeta": {+ "type": "signature",+ "required": true+ }+}+```++---++## Field Types++| Type | Description | Auto-filled |+| ---------------- | ----------------------------------------- | ----------- |+| `SIGNATURE` | Drawn, typed, or uploaded signature | No |+| `FREE_SIGNATURE` | Unrestricted signature without validation | No |+| `INITIALS` | Recipient's initials | No |+| `NAME` | Recipient's full name | Yes |+| `EMAIL` | Recipient's email address | Yes |+| `DATE` | Date the field was completed | Yes |+| `TEXT` | Free-form text input | No |+| `NUMBER` | Numeric input with optional validation | No |+| `RADIO` | Single selection from options | No |+| `CHECKBOX` | Multiple selections from options | No |+| `DROPDOWN` | Single selection from a dropdown menu | No |++---++## Get Field++Retrieve a single field by ID.++```+GET /envelope/field/{fieldId}+```++### Path Parameters++| Parameter | Type | Description |+| --------- | ------ | ------------ |+| `fieldId` | number | The field ID |++### Code Examples++<Tabs items={['curl', 'TypeScript']}>+<Tab value="curl">+```bash+curl -X GET "https://app.documenso.com/api/v2/envelope/field/456" \+ -H "Authorization: api_xxxxxxxxxxxxxxxx"+```+</Tab>+<Tab value="TypeScript">+```typescript+const response = await fetch(+ 'https://app.documenso.com/api/v2/envelope/field/456',+ {+ method: 'GET',+ headers: {+ Authorization: 'api_xxxxxxxxxxxxxxxx',+ },+ }+);++const field = await response.json();+console.log(field.type, field.page);++```+</Tab>+</Tabs>++### Response++Returns the field object.++---++## Create Fields++Add one or more fields to a document.++```++POST /envelope/field/create-many++````++### Request Body++| Field | Type | Required | Description |+| ----------- | ------ | -------- | ------------------------------- |+| `documentId`| number | Yes | The document ID |+| `fields` | array | Yes | Array of field configurations |++### Code Examples++<Tabs items={['curl', 'TypeScript']}>+<Tab value="curl">+```bash+curl -X POST "https://app.documenso.com/api/v2/envelope/field/create-many" \+ -H "Authorization: api_xxxxxxxxxxxxxxxx" \+ -H "Content-Type: application/json" \+ -d '{+ "documentId": 123,+ "fields": [+ {+ "type": "SIGNATURE",+ "recipientId": 456,+ "pageNumber": 1,+ "pageX": 10,+ "pageY": 80,+ "width": 30,+ "height": 5+ },+ {+ "type": "DATE",+ "recipientId": 456,+ "pageNumber": 1,+ "pageX": 50,+ "pageY": 80,+ "width": 20,+ "height": 3+ },+ {+ "type": "TEXT",+ "recipientId": 456,+ "pageNumber": 1,+ "pageX": 10,+ "pageY": 70,+ "width": 40,+ "height": 4,+ "fieldMeta": {+ "type": "text",+ "label": "Job Title",+ "placeholder": "Enter your job title",+ "required": true+ }+ }+ ]+ }'+````++</Tab>+<Tab value="TypeScript">+```typescript+const response = await fetch(+ 'https://app.documenso.com/api/v2/envelope/field/create-many',+ {+ method: 'POST',+ headers: {+ Authorization: 'api_xxxxxxxxxxxxxxxx',+ 'Content-Type': 'application/json',+ },+ body: JSON.stringify({+ documentId: 123,+ fields: [+ {+ type: 'SIGNATURE',+ recipientId: 456,+ pageNumber: 1,+ pageX: 10,+ pageY: 80,+ width: 30,+ height: 5,+ },+ {+ type: 'DATE',+ recipientId: 456,+ pageNumber: 1,+ pageX: 50,+ pageY: 80,+ width: 20,+ height: 3,+ },+ {+ type: 'TEXT',+ recipientId: 456,+ pageNumber: 1,+ pageX: 10,+ pageY: 70,+ width: 40,+ height: 4,+ fieldMeta: {+ type: 'text',+ label: 'Job Title',+ placeholder: 'Enter your job title',+ required: true,+ },+ },+ ],+ }),+ }+);++const { fields } = await response.json();+console.log(`Created ${fields.length} fields`);++````+</Tab>+</Tabs>++### Response++```json+{+ "fields": [+ {+ "id": 101,+ "type": "SIGNATURE",+ "recipientId": 456,+ "page": 1,+ "positionX": 10,+ "positionY": 80,+ "width": 30,+ "height": 5+ },+ {+ "id": 102,+ "type": "DATE",+ "recipientId": 456,+ "page": 1,+ "positionX": 50,+ "positionY": 80,+ "width": 20,+ "height": 3+ },+ {+ "id": 103,+ "type": "TEXT",+ "recipientId": 456,+ "page": 1,+ "positionX": 10,+ "positionY": 70,+ "width": 40,+ "height": 4+ }+ ]+}+````++---++## Update Fields++Update one or more fields in a single request.++```+POST /envelope/field/update-many+```++### Request Body++| Field | Type | Required | Description |+| ------------ | ------ | -------- | ----------------------------- |+| `documentId` | number | Yes | The document ID |+| `fields` | array | Yes | Array of field update objects |++### Code Examples++<Tabs items={['curl', 'TypeScript']}>+<Tab value="curl">+```bash+curl -X POST "https://app.documenso.com/api/v2/envelope/field/update-many" \+ -H "Authorization: api_xxxxxxxxxxxxxxxx" \+ -H "Content-Type: application/json" \+ -d '{+ "documentId": 123,+ "fields": [+ {+ "id": 101,+ "type": "SIGNATURE",+ "pageY": 85+ },+ {+ "id": 102,+ "type": "DATE",+ "pageY": 85+ }+ ]+ }'+```+</Tab>+<Tab value="TypeScript">+```typescript+const response = await fetch(+ 'https://app.documenso.com/api/v2/envelope/field/update-many',+ {+ method: 'POST',+ headers: {+ Authorization: 'api_xxxxxxxxxxxxxxxx',+ 'Content-Type': 'application/json',+ },+ body: JSON.stringify({+ documentId: 123,+ fields: [+ { id: 101, type: 'SIGNATURE', pageY: 85 },+ { id: 102, type: 'DATE', pageY: 85 },+ ],+ }),+ }+);++const { fields } = await response.json();++````+</Tab>+</Tabs>++### Response++```json+{+ "fields": [+ { "id": 101, "type": "SIGNATURE", "positionY": 85 },+ { "id": 102, "type": "DATE", "positionY": 85 }+ ]+}+````++---++## Delete Field++Remove a field from a document.++```+POST /envelope/field/delete+```++### Request Body++| Field | Type | Required | Description |+| --------- | ------ | -------- | ------------ |+| `fieldId` | number | Yes | The field ID |++### Code Examples++<Tabs items={['curl', 'TypeScript']}>+<Tab value="curl">+```bash+curl -X POST "https://app.documenso.com/api/v2/envelope/field/delete" \+ -H "Authorization: api_xxxxxxxxxxxxxxxx" \+ -H "Content-Type: application/json" \+ -d '{+ "fieldId": 456+ }'+```+</Tab>+<Tab value="TypeScript">+```typescript+const response = await fetch(+ 'https://app.documenso.com/api/v2/envelope/field/delete',+ {+ method: 'POST',+ headers: {+ Authorization: 'api_xxxxxxxxxxxxxxxx',+ 'Content-Type': 'application/json',+ },+ body: JSON.stringify({+ fieldId: 456,+ }),+ }+);++const { success } = await response.json();++````+</Tab>+</Tabs>++### Response++```json+{+ "success": true+}+````++---++## Field Positioning++Fields use percentage-based coordinates relative to the PDF page dimensions.++| Property | Range | Description |+| ----------- | ----- | -------------------------------------------------- |+| `positionX` | 0-100 | Horizontal position from left edge (0 = left edge) |+| `positionY` | 0-100 | Vertical position from top edge (0 = top edge) |+| `width` | 0-100 | Field width as percentage of page width |+| `height` | 0-100 | Field height as percentage of page height |+| `page` | 1+ | Page number (1-indexed) |++### Coordinate System++```+(0,0) ─────────────────────────── (100,0)+ │ │+ │ ┌─────────┐ │+ │ │ Field │ (pageX: 10, │+ │ │ │ pageY: 20, │+ │ └─────────┘ width: 30, │+ │ height: 5) │+ │ │+(0,100) ─────────────────────────(100,100)+```++### Example: Position a Signature at Bottom Right++```typescript+const field = {+ type: 'SIGNATURE',+ recipientId: 123,+ pageNumber: 1,+ pageX: 60, // 60% from left+ pageY: 85, // 85% from top (near bottom)+ width: 30, // 30% of page width+ height: 8, // 8% of page height+};+```++---++## Placeholder-Based Field Positioning++Instead of specifying exact coordinates, you can position fields using placeholder text embedded in your PDF. Include placeholder markers such as `{{signature, r1}}` in your document, and Documenso will create fields at those locations when the document is uploaded.++This approach is useful when generating PDFs programmatically or using templates with consistent layouts.++See the [PDF Placeholders](/docs/users/documents/advanced/pdf-placeholders) guide for the full placeholder format reference, including supported field types, recipient identifiers, and field options.++---++## Field Meta Options++Each field type supports specific configuration through `fieldMeta`.++### Common Options++All field types support these base options:++| Option | Type | Description |+| ------------- | ------- | --------------------------------------- |+| `label` | string | Display text shown near the field |+| `placeholder` | string | Hint text when field is empty |+| `required` | boolean | Whether field must be completed |+| `readOnly` | boolean | Lock field with a pre-filled value |+| `fontSize` | number | Text size in pixels (8-96, default: 12) |++### Signature Field++```json+{+ "type": "SIGNATURE",+ "fieldMeta": {+ "type": "signature",+ "required": true+ }+}+```++### Text Field++```json+{+ "type": "TEXT",+ "fieldMeta": {+ "type": "text",+ "label": "Company Name",+ "placeholder": "Enter company name",+ "text": "Default value",+ "characterLimit": 100,+ "textAlign": "left",+ "required": true+ }+}+```++| Option | Type | Description |+| ---------------- | ------ | ---------------------------------- |+| `text` | string | Default value |+| `characterLimit` | number | Maximum characters allowed |+| `textAlign` | string | `left`, `center`, or `right` |+| `lineHeight` | number | Spacing between lines (1-10) |+| `letterSpacing` | number | Spacing between characters (0-100) |++### Number Field++```json+{+ "type": "NUMBER",+ "fieldMeta": {+ "type": "number",+ "label": "Quantity",+ "minValue": 1,+ "maxValue": 100,+ "value": "10",+ "required": true+ }+}+```++| Option | Type | Description |+| -------------- | ------ | --------------------- |+| `value` | string | Default value |+| `minValue` | number | Minimum allowed value |+| `maxValue` | number | Maximum allowed value |+| `numberFormat` | string | Display format |++### Date Field++```json+{+ "type": "DATE",+ "fieldMeta": {+ "type": "date",+ "textAlign": "left",+ "required": true+ }+}+```++### Checkbox Field++```json+{+ "type": "CHECKBOX",+ "fieldMeta": {+ "type": "checkbox",+ "label": "Agreements",+ "values": [+ { "id": 1, "value": "Terms of Service", "checked": false },+ { "id": 2, "value": "Privacy Policy", "checked": false }+ ],+ "validationRule": "min",+ "validationLength": 1,+ "direction": "vertical",+ "required": true+ }+}+```++| Option | Type | Description |+| ------------------ | ------ | --------------------------------- |+| `values` | array | List of checkbox options |+| `validationRule` | string | Validation type for selections |+| `validationLength` | number | Number for validation rule |+| `direction` | string | `vertical` or `horizontal` layout |++### Radio Field++```json+{+ "type": "RADIO",+ "fieldMeta": {+ "type": "radio",+ "label": "Payment Method",+ "values": [+ { "id": 1, "value": "Credit Card", "checked": false },+ { "id": 2, "value": "Bank Transfer", "checked": true },+ { "id": 3, "value": "Check", "checked": false }+ ],+ "direction": "vertical",+ "required": true+ }+}+```++### Dropdown Field++```json+{+ "type": "DROPDOWN",+ "fieldMeta": {+ "type": "dropdown",+ "label": "Country",+ "values": [{ "value": "United States" }, { "value": "Canada" }, { "value": "United Kingdom" }],+ "defaultValue": "United States",+ "required": true+ }+}+```++| Option | Type | Description |+| -------------- | ------ | ------------------------ |+| `values` | array | List of dropdown options |+| `defaultValue` | string | Pre-selected option |++---++## Complete Example++Create a document with a signature block containing multiple field types:++```typescript+async function addSignatureBlock(documentId: number, recipientId: number) {+ const fields = [+ // Signature+ {+ type: 'SIGNATURE',+ recipientId,+ pageNumber: 1,+ pageX: 10,+ pageY: 80,+ width: 30,+ height: 8,+ fieldMeta: {+ type: 'signature',+ required: true,+ },+ },+ // Printed name+ {+ type: 'NAME',+ recipientId,+ pageNumber: 1,+ pageX: 10,+ pageY: 90,+ width: 30,+ height: 4,+ fieldMeta: {+ type: 'name',+ label: 'Printed Name',+ },+ },+ // Date+ {+ type: 'DATE',+ recipientId,+ pageNumber: 1,+ pageX: 50,+ pageY: 80,+ width: 20,+ height: 4,+ fieldMeta: {+ type: 'date',+ label: 'Date',+ },+ },+ // Job title+ {+ type: 'TEXT',+ recipientId,+ pageNumber: 1,+ pageX: 50,+ pageY: 90,+ width: 30,+ height: 4,+ fieldMeta: {+ type: 'text',+ label: 'Title',+ placeholder: 'Enter your job title',+ },+ },+ ];++ const response = await fetch('https://app.documenso.com/api/v2/envelope/field/create-many', {+ method: 'POST',+ headers: {+ Authorization: 'api_xxxxxxxxxxxxxxxx',+ 'Content-Type': 'application/json',+ },+ body: JSON.stringify({ documentId, fields }),+ });++ return response.json();+}+```++---++## Error Responses++| Status | Description |+| ------ | ---------------------------------------------------- |+| `400` | Invalid field configuration or document already sent |+| `401` | Invalid or missing API key |+| `404` | Document, recipient, or field not found |+| `500` | Server error |++<Callout type="warn">+ Fields cannot be modified after a document is sent for signing. Make all field changes while the+ document is in `DRAFT` status.+</Callout>++---++## See Also++- [Documents API](/docs/developers/api/documents) - Create and manage documents+- [Recipients API](/docs/developers/api/recipients) - Add signers to documents+- [Field Types](/docs/concepts/field-types) - Detailed field type referencediff --git a/apps/docs/content/docs/developers/api/index.mdx b/apps/docs/content/docs/developers/api/index.mdxnew file mode 100644index 000000000..7f446c7ad--- /dev/null+++ b/apps/docs/content/docs/developers/api/index.mdx@@ -0,0 +1,72 @@+---+title: API Reference+description: Complete reference for the Documenso REST API.+---++import { Callout } from 'fumadocs-ui/components/callout';++<Callout type="warn">+ The guides below cover common API patterns but may not reflect the latest endpoints or parameters.+ For an always up-to-date reference, see the [OpenAPI Reference](https://openapi.documenso.com).+</Callout>++## Base URL++```+https://app.documenso.com/api/v2+```++For self-hosted instances, replace with your instance URL.++---++## Authentication++All requests require an API key in the `Authorization` header:++```+Authorization: api_xxxxxxxxxxxxxxxx+```++<Callout type="info">+ See [Authentication](/docs/developers/getting-started/authentication) for details.+</Callout>++---++## Endpoints++<Cards>+ <Card+ title="Documents"+ description="Create, retrieve, update, and delete documents."+ href="/docs/developers/api/documents"+ />+ <Card+ title="Recipients"+ description="Manage document recipients and signers."+ href="/docs/developers/api/recipients"+ />+ <Card+ title="Fields"+ description="Add and configure signature fields."+ href="/docs/developers/api/fields"+ />+ <Card+ title="Templates"+ description="Work with document templates."+ href="/docs/developers/api/templates"+ />+ <Card+ title="Teams"+ description="Manage teams and team members."+ href="/docs/developers/api/teams"+ />+</Cards>++---++## See Also++- [First API Call](/docs/developers/getting-started/first-api-call) - Quick start example+- [Webhooks](/docs/developers/webhooks) - Get notified about document eventsdiff --git a/apps/docs/content/docs/developers/api/meta.json b/apps/docs/content/docs/developers/api/meta.jsonnew file mode 100644index 000000000..ffabac120--- /dev/null+++ b/apps/docs/content/docs/developers/api/meta.json@@ -0,0 +1,13 @@+{+ "title": "API Reference",+ "pages": [+ "documents",+ "recipients",+ "fields",+ "templates",+ "teams",+ "rate-limits",+ "versioning",+ "developer-mode"+ ]+}diff --git a/apps/docs/content/docs/developers/api/rate-limits.mdx b/apps/docs/content/docs/developers/api/rate-limits.mdxnew file mode 100644index 000000000..ecd50558e--- /dev/null+++ b/apps/docs/content/docs/developers/api/rate-limits.mdx@@ -0,0 +1,67 @@+---+title: Rate Limits+description: Learn about the rate limits for the Documenso Public API.+---++import { Callout } from 'fumadocs-ui/components/callout';++## Overview++Documenso enforces rate limits on all API endpoints to ensure service stability.++## HTTP Rate Limits++**Limit:** 100 requests per minute per IP address+**Response:** 429 Too Many Requests++### Rate Limit Response++```json+{+ "error": "Too many requests, please try again later."+}+```++<Callout type="warn">+ No rate limit headers are currently provided. When you receive a 429 response, wait at least 60+ seconds before retrying.+</Callout>++## Resource Limits++Beyond HTTP rate limits, your account has usage limits based on your subscription plan.++### Plan Limits++| Resource | Free | Paid | Self-hosted | Enterprise |+| ---------------- | ---- | --------- | ----------- | ---------- |+| Documents/month | 5 | Unlimited | Unlimited | Unlimited |+| Total Recipients | 10 | Unlimited | Unlimited | Unlimited |+| Direct Templates | 3 | Unlimited | Unlimited | Unlimited |++### Error Response++When you exceed a resource limit:++```json+{+ "error": "You have reached your document limit for this month. Please upgrade your plan.",+ "code": "LIMIT_EXCEEDED",+ "statusCode": 400+}+```++## Error Codes++| Code | Status | Description |+| ------------------- | ------ | ----------------------------- |+| `TOO_MANY_REQUESTS` | 429 | HTTP rate limit exceeded |+| `LIMIT_EXCEEDED` | 400 | Resource usage limit exceeded |++---++## See Also++- [Authentication](/docs/developers/getting-started/authentication) - API authentication guide+- [API Versioning](/docs/developers/api/versioning) - API version management+- [First API Call](/docs/developers/getting-started/first-api-call) - Getting started with the APIdiff --git a/apps/docs/content/docs/developers/api/recipients.mdx b/apps/docs/content/docs/developers/api/recipients.mdxnew file mode 100644index 000000000..6751a400a--- /dev/null+++ b/apps/docs/content/docs/developers/api/recipients.mdx@@ -0,0 +1,504 @@+---+title: Recipients API+description: Add and manage envelope recipients via API.+---++import { Callout } from 'fumadocs-ui/components/callout';+import { Tab, Tabs } from 'fumadocs-ui/components/tabs';++<Callout type="warn">+ This guide may not reflect the latest endpoints or parameters. For an always up-to-date reference,+ see the [OpenAPI Reference](https://openapi.documenso.com).+</Callout>++## Recipient Object++```json+{+ "id": 123,+ "envelopeId": "clu1abc2def3ghi4jkl",+ "email": "[email protected]",+ "name": "John Doe",+ "role": "SIGNER",+ "signingOrder": 1,+ "token": "abc123...",+ "signedAt": "2024-01-15T10:30:00Z",+ "readStatus": "OPENED",+ "signingStatus": "SIGNED",+ "sendStatus": "SENT"+}+```++| Field | Type | Description |+| --------------- | -------------- | ------------------------------------- |+| `id` | number | Unique recipient identifier |+| `envelopeId` | string | ID of the associated envelope |+| `email` | string | Recipient's email address |+| `name` | string | Recipient's display name |+| `role` | string | Recipient role (see below) |+| `signingOrder` | number \| null | Order in sequential signing |+| `token` | string | Unique token for signing URL |+| `signedAt` | string \| null | ISO timestamp when signed |+| `readStatus` | string | `NOT_OPENED` or `OPENED` |+| `signingStatus` | string | `NOT_SIGNED`, `SIGNED`, or `REJECTED` |+| `sendStatus` | string | `NOT_SENT` or `SENT` |++---++## Recipient Roles++| Role | Description |+| ----------- | -------------------------------------------------------------- |+| `SIGNER` | Must sign the document. Required fields must be completed. |+| `APPROVER` | Must approve the document before signers can proceed. |+| `VIEWER` | Can view the document but takes no action. |+| `CC` | Receives a copy of the completed document. No action required. |+| `ASSISTANT` | Can fill in fields on behalf of another recipient. |++---++## Get Recipient++Retrieve a single recipient by ID.++```+GET /api/v2/envelope/recipient/{recipientId}+```++### Example++<Tabs items={['curl', 'TypeScript']}>+<Tab value="curl">+```bash+curl "https://app.documenso.com/api/v2/envelope/recipient/789" \+ -H "Authorization: api_xxxxxxxxxxxxxxxx"+```+</Tab>+<Tab value="TypeScript">+```typescript+const response = await fetch(+ 'https://app.documenso.com/api/v2/envelope/recipient/789',+ {+ headers: {+ Authorization: 'api_xxxxxxxxxxxxxxxx',+ },+ },+);++const recipient = await response.json();++```+</Tab>+</Tabs>++### Response++Returns the full recipient object including fields.++---++## Create Recipients++Add one or more recipients to an envelope.++```++POST /api/v2/envelope/recipient/create-many++````++### Request Body++| Field | Type | Required | Description |+| ------------ | ------ | -------- | --------------------------------------- |+| `envelopeId` | string | Yes | ID of the envelope to add recipients to |+| `data` | array | Yes | Array of recipient objects |++Each item in the `data` array:++| Field | Type | Required | Description |+| -------------- | -------- | -------- | ------------------------------------------ |+| `email` | string | Yes | Recipient's email address |+| `name` | string | Yes | Recipient's display name (max 255 chars) |+| `role` | string | Yes | Recipient role (see Recipient Roles above) |+| `signingOrder` | number | No | Position in sequential signing |+| `accessAuth` | string[] | No | Access authentication types |+| `actionAuth` | string[] | No | Action authentication types |++### Example++<Tabs items={['curl', 'TypeScript']}>+<Tab value="curl">+```bash+curl -X POST "https://app.documenso.com/api/v2/envelope/recipient/create-many" \+ -H "Authorization: api_xxxxxxxxxxxxxxxx" \+ -H "Content-Type: application/json" \+ -d '{+ "envelopeId": "clu1abc2def3ghi4jkl",+ "data": [+ {+ "email": "[email protected]",+ "name": "John Doe",+ "role": "SIGNER",+ "signingOrder": 1+ },+ {+ "email": "[email protected]",+ "name": "Jane Smith",+ "role": "APPROVER",+ "signingOrder": 0+ }+ ]+ }'+````++</Tab>+<Tab value="TypeScript">+```typescript+const response = await fetch(+ 'https://app.documenso.com/api/v2/envelope/recipient/create-many',+ {+ method: 'POST',+ headers: {+ Authorization: 'api_xxxxxxxxxxxxxxxx',+ 'Content-Type': 'application/json',+ },+ body: JSON.stringify({+ envelopeId: 'clu1abc2def3ghi4jkl',+ data: [+ {+ email: '[email protected]',+ name: 'John Doe',+ role: 'SIGNER',+ signingOrder: 1,+ },+ {+ email: '[email protected]',+ name: 'Jane Smith',+ role: 'APPROVER',+ signingOrder: 0,+ },+ ],+ }),+ },+);++const { data: recipients } = await response.json();++````+</Tab>+</Tabs>++### Response++```json+{+ "data": [+ {+ "id": 789,+ "envelopeId": "clu1abc2def3ghi4jkl",+ "email": "[email protected]",+ "name": "John Doe",+ "role": "SIGNER",+ "signingOrder": 1,+ "token": "abc123def456",+ "signedAt": null,+ "readStatus": "NOT_OPENED",+ "signingStatus": "NOT_SIGNED",+ "sendStatus": "NOT_SENT"+ },+ {+ "id": 790,+ "envelopeId": "clu1abc2def3ghi4jkl",+ "email": "[email protected]",+ "name": "Jane Smith",+ "role": "APPROVER",+ "signingOrder": 0,+ "token": "def456ghi789",+ "signedAt": null,+ "readStatus": "NOT_OPENED",+ "signingStatus": "NOT_SIGNED",+ "sendStatus": "NOT_SENT"+ }+ ]+}+````++---++## Update Recipients++Update one or more recipients on an envelope. Only available for envelopes that are not yet completed.++```+POST /api/v2/envelope/recipient/update-many+```++### Request Body++| Field | Type | Required | Description |+| ------------ | ------ | -------- | -------------------------------------------- |+| `envelopeId` | string | Yes | ID of the envelope containing the recipients |+| `data` | array | Yes | Array of recipient update objects |++Each item in the `data` array:++| Field | Type | Required | Description |+| -------------- | -------- | -------- | ---------------------------------- |+| `id` | number | Yes | ID of the recipient to update |+| `email` | string | No | New email address |+| `name` | string | No | New display name (max 255 chars) |+| `role` | string | No | New recipient role |+| `signingOrder` | number | No | New position in sequential signing |+| `accessAuth` | string[] | No | Access authentication types |+| `actionAuth` | string[] | No | Action authentication types |++### Example++<Tabs items={['curl', 'TypeScript']}>+<Tab value="curl">+```bash+curl -X POST "https://app.documenso.com/api/v2/envelope/recipient/update-many" \+ -H "Authorization: api_xxxxxxxxxxxxxxxx" \+ -H "Content-Type: application/json" \+ -d '{+ "envelopeId": "clu1abc2def3ghi4jkl",+ "data": [+ {+ "id": 789,+ "name": "Jane Doe",+ "signingOrder": 2+ }+ ]+ }'+```+</Tab>+<Tab value="TypeScript">+```typescript+const response = await fetch(+ 'https://app.documenso.com/api/v2/envelope/recipient/update-many',+ {+ method: 'POST',+ headers: {+ Authorization: 'api_xxxxxxxxxxxxxxxx',+ 'Content-Type': 'application/json',+ },+ body: JSON.stringify({+ envelopeId: 'clu1abc2def3ghi4jkl',+ data: [+ {+ id: 789,+ name: 'Jane Doe',+ signingOrder: 2,+ },+ ],+ }),+ },+);++const { data: updatedRecipients } = await response.json();++```+</Tab>+</Tabs>++### Response++Returns the updated recipient objects in a `data` array.++---++## Delete Recipient++Remove a recipient from an envelope. Only available for envelopes that are not yet completed.++```++POST /api/v2/envelope/recipient/delete++````++### Request Body++| Field | Type | Required | Description |+| ------------- | ------ | -------- | ------------------------------- |+| `recipientId` | number | Yes | ID of the recipient to remove |++### Example++<Tabs items={['curl', 'TypeScript']}>+<Tab value="curl">+```bash+curl -X POST "https://app.documenso.com/api/v2/envelope/recipient/delete" \+ -H "Authorization: api_xxxxxxxxxxxxxxxx" \+ -H "Content-Type: application/json" \+ -d '{+ "recipientId": 789+ }'+````++</Tab>+<Tab value="TypeScript">+```typescript+const response = await fetch(+ 'https://app.documenso.com/api/v2/envelope/recipient/delete',+ {+ method: 'POST',+ headers: {+ Authorization: 'api_xxxxxxxxxxxxxxxx',+ 'Content-Type': 'application/json',+ },+ body: JSON.stringify({+ recipientId: 789,+ }),+ },+);++const result = await response.json();+// { "success": true }++````+</Tab>+</Tabs>++### Response++```json+{+ "success": true+}+````++---++## Signing Order++When an envelope uses sequential signing, recipients sign in a specific order defined by `signingOrder`.++### Setting Signing Order++When creating recipients, assign `signingOrder` values to control the sequence:++```typescript+const response = await fetch('https://app.documenso.com/api/v2/envelope/recipient/create-many', {+ method: 'POST',+ headers: {+ Authorization: 'api_xxxxxxxxxxxxxxxx',+ 'Content-Type': 'application/json',+ },+ body: JSON.stringify({+ envelopeId: 'clu1abc2def3ghi4jkl',+ data: [+ {+ email: '[email protected]',+ name: 'Approver',+ role: 'APPROVER',+ signingOrder: 0, // Approvers typically go first+ },+ {+ email: '[email protected]',+ name: 'First Signer',+ role: 'SIGNER',+ signingOrder: 1,+ },+ {+ email: '[email protected]',+ name: 'Second Signer',+ role: 'SIGNER',+ signingOrder: 2,+ },+ ],+ }),+});+```++<Callout type="info">+ To enable sequential signing, set `signingOrder` to `SEQUENTIAL` in the envelope metadata when+ creating or updating the envelope. See the [Documents API](/docs/developers/api/documents) for+ details.+</Callout>++### Signing Order Behavior++- Recipients with lower `signingOrder` values sign first+- Recipients with the same `signingOrder` can sign simultaneously+- `CC` recipients receive the document after all signing is complete+- `APPROVER` recipients must approve before signers with higher order values++---++## Authentication Options++For enhanced security, you can require additional authentication when recipients access or sign a document.++### Access Authentication++Controls who can view the document:++| Type | Description |+| ----------------- | ------------------------------ |+| `ACCOUNT` | Recipient must be logged in |+| `TWO_FACTOR_AUTH` | Recipient must verify with 2FA |++### Action Authentication++Controls who can sign the document:++| Type | Description |+| ----------------- | ---------------------------------------- |+| `ACCOUNT` | Recipient must be logged in |+| `PASSKEY` | Require passkey authentication |+| `TWO_FACTOR_AUTH` | Require 2FA code |+| `PASSWORD` | Require password verification |+| `EXPLICIT_NONE` | Explicitly disable action authentication |++### Example++```typescript+const response = await fetch('https://app.documenso.com/api/v2/envelope/recipient/create-many', {+ method: 'POST',+ headers: {+ Authorization: 'api_xxxxxxxxxxxxxxxx',+ 'Content-Type': 'application/json',+ },+ body: JSON.stringify({+ envelopeId: 'clu1abc2def3ghi4jkl',+ data: [+ {+ email: '[email protected]',+ name: 'John Doe',+ role: 'SIGNER',+ accessAuth: ['ACCOUNT'],+ actionAuth: ['PASSKEY', 'TWO_FACTOR_AUTH'],+ },+ ],+ }),+});+```++---++## Error Responses++| Status | Description |+| ------ | ------------------------------------------------ |+| `400` | Invalid request body or recipient already exists |+| `400` | Envelope is already completed |+| `401` | Invalid or missing API key |+| `404` | Envelope or recipient not found |+| `500` | Server error |++### Example Error Response++```json+{+ "message": "Recipient already exists"+}+```++---++## See Also++- [Documents API](/docs/developers/api/documents) - Create and manage envelopes+- [Fields API](/docs/developers/api/fields) - Add signature fields for recipientsdiff --git a/apps/docs/content/docs/developers/api/teams.mdx b/apps/docs/content/docs/developers/api/teams.mdxnew file mode 100644index 000000000..99d708b41--- /dev/null+++ b/apps/docs/content/docs/developers/api/teams.mdx@@ -0,0 +1,373 @@+---+title: Teams API+description: Manage team resources, documents, and templates with team-scoped API tokens.+---++import { Callout } from 'fumadocs-ui/components/callout';+import { Step, Steps } from 'fumadocs-ui/components/steps';+import { Tab, Tabs } from 'fumadocs-ui/components/tabs';++<Callout type="warn">+ This guide may not reflect the latest endpoints or parameters. For an always up-to-date reference,+ see the [OpenAPI Reference](https://openapi.documenso.com).+</Callout>++## Team Object++A team object contains the following properties:++| Property | Type | Description |+| ----------------- | -------------- | --------------------------------------------------- |+| `id` | number | Unique team identifier |+| `name` | string | Team display name |+| `url` | string | Unique team URL slug |+| `createdAt` | string | ISO 8601 timestamp |+| `avatarImageId` | string \| null | ID of the team's avatar image |+| `organisationId` | string | ID of the parent organisation |+| `currentTeamRole` | string | Your role in the team: `ADMIN`, `MANAGER`, `MEMBER` |++### Example Team Object++```json+{+ "id": 123,+ "name": "Engineering",+ "url": "engineering",+ "createdAt": "2025-01-15T10:30:00.000Z",+ "avatarImageId": null,+ "organisationId": "org_abc123",+ "currentTeamRole": "ADMIN"+}+```++## Team-Scoped API Tokens++API tokens in Documenso are always scoped to a specific team. When you create an API token, it is associated with the team you're currently working in.++### How Team Scoping Works++- Each API token belongs to exactly one team+- All API operations using that token automatically access that team's resources+- Documents, templates, and other resources created via the API belong to the token's team+- You cannot access resources from other teams with a single token++### Creating Team-Scoped Tokens++{/* prettier-ignore */}+<Steps>+ <Step>+ Navigate to your team's settings+ </Step>+ <Step>+ Go to **API Tokens**+ </Step>+ <Step>+ Click **Create Token**+ </Step>+ <Step>+ The token will be scoped to the current team+ </Step>+</Steps>++<Callout type="info">+ To work with multiple teams via API, create separate tokens for each team.+</Callout>++### Token Permissions++Your API token inherits permissions based on your role in the team:++| Role | Permissions |+| --------- | ------------------------------------------------ |+| `ADMIN` | Full access to all team resources and settings |+| `MANAGER` | Create, edit, and delete documents and templates |+| `MEMBER` | Create and manage own documents |++## Working with Team Documents++When you use a team-scoped API token, all document operations are automatically scoped to that team.++### Create a Team Document++Documents created with a team token belong to that team:++<Tabs items={['curl', 'TypeScript']}>+<Tab value="curl">+```bash+curl -X POST "https://app.documenso.com/api/v2/envelope/create" \+ -H "Authorization: api_team_xxxxxxxxxxxxxxxx" \+ -H "Content-Type: multipart/form-data" \+ -F 'payload={+ "type": "DOCUMENT",+ "title": "Team Contract",+ "recipients": [+ {+ "email": "[email protected]",+ "name": "John Smith",+ "role": "SIGNER"+ }+ ]+ }' \+ -F "files=@./contract.pdf;type=application/pdf"+```+</Tab>+<Tab value="TypeScript">+```typescript+const TEAM_API_TOKEN = process.env.DOCUMENSO_TEAM_API_TOKEN;++const form = new FormData();++const payload = {+ type: 'DOCUMENT',+ title: 'Team Contract',+ recipients: [+ {+ email: '[email protected]',+ name: 'John Smith',+ role: 'SIGNER',+ },+ ],+};++form.append('payload', JSON.stringify(payload));+form.append('files', fs.createReadStream('./contract.pdf'), {+ contentType: 'application/pdf',+});++const response = await fetch('https://app.documenso.com/api/v2/envelope/create', {+ method: 'POST',+ headers: {+ Authorization: TEAM_API_TOKEN,+ },+ body: form,+});++const { id } = await response.json();+console.log('Created team document:', id);+````+</Tab>+</Tabs>++### List Team Documents++Retrieve all documents belonging to the team:++<Tabs items={['curl', 'TypeScript']}>+<Tab value="curl">+```bash+# List all team documents+curl -X GET "https://app.documenso.com/api/v2/envelope" \+ -H "Authorization: api_team_xxxxxxxxxxxxxxxx"++# Filter by status+curl -X GET "https://app.documenso.com/api/v2/envelope?status=PENDING" \+ -H "Authorization: api_team_xxxxxxxxxxxxxxxx"+````++</Tab>+<Tab value="TypeScript">+```typescript+const response = await fetch('https://app.documenso.com/api/v2/envelope', {+ method: 'GET',+ headers: {+ Authorization: TEAM_API_TOKEN,+ },+});++const { data, pagination } = await response.json();+console.log(`Found ${pagination.totalItems} team documents`);++````+</Tab>+</Tabs>++## Working with Team Templates++Templates created with a team token are shared across the team.++### Create a Team Template++<Tabs items={['curl', 'TypeScript']}>+<Tab value="curl">+```bash+curl -X POST "https://app.documenso.com/api/v2/template/create" \+ -H "Authorization: api_team_xxxxxxxxxxxxxxxx" \+ -H "Content-Type: multipart/form-data" \+ -F 'payload={+ "title": "NDA Template",+ "recipients": [+ {+ "email": "[email protected]",+ "name": "Signer",+ "role": "SIGNER",+ "fields": [+ {+ "identifier": 0,+ "type": "SIGNATURE",+ "page": 1,+ "positionX": 10,+ "positionY": 80,+ "width": 30,+ "height": 5+ }+ ]+ }+ ]+ }' \+ -F "files=@./nda-template.pdf;type=application/pdf"+````++</Tab>+<Tab value="TypeScript">+```typescript+const form = new FormData();++const payload = {+ title: 'NDA Template',+ recipients: [+ {+ email: '[email protected]',+ name: 'Signer',+ role: 'SIGNER',+ fields: [+ {+ identifier: 0,+ type: 'SIGNATURE',+ page: 1,+ positionX: 10,+ positionY: 80,+ width: 30,+ height: 5,+ },+ ],+ },+ ],+};++form.append('payload', JSON.stringify(payload));+form.append('files', fs.createReadStream('./nda-template.pdf'), {+ contentType: 'application/pdf',+});++const response = await fetch('https://app.documenso.com/api/v2/template/create', {+ method: 'POST',+ headers: {+ Authorization: TEAM_API_TOKEN,+ },+ body: form,+});++const template = await response.json();+console.log('Created team template:', template.id);+````+</Tab>+</Tabs>++### List Team Templates++<Tabs items={['curl', 'TypeScript']}>+<Tab value="curl">+```bash+curl -X GET "https://app.documenso.com/api/v2/template" \+ -H "Authorization: api_team_xxxxxxxxxxxxxxxx"+````++</Tab>+<Tab value="TypeScript">+```typescript+const response = await fetch('https://app.documenso.com/api/v2/template', {+ method: 'GET',+ headers: {+ Authorization: TEAM_API_TOKEN,+ },+});++const { data } = await response.json();+console.log('Team templates:', data);++````+</Tab>+</Tabs>++## Team Member Roles++| Role | Description |+| --------- | ------------------------------------------------------------------- |+| `ADMIN` | Full control over team settings, members, and all resources |+| `MANAGER` | Can manage documents, templates, and view team resources |+| `MEMBER` | Can create and manage their own documents within the team |++### Document Visibility++Team documents have visibility settings that control who can access them:++| Visibility | Description |+| ------------------ | ------------------------------------------------ |+| `EVERYONE` | All team members can view the document |+| `MANAGER_AND_ABOVE`| Only managers and admins can view |+| `ADMIN` | Only admins can view |++Set visibility when creating a document:++```typescript+const payload = {+ type: 'DOCUMENT',+ title: 'Confidential Agreement',+ visibility: 'ADMIN', // Only team admins can view+ recipients: [...],+};+````++## Multi-Team Workflow++To work with multiple teams, create and manage separate API tokens for each team.++### Example: Sync Documents Across Teams++```typescript+// Tokens for different teams+const SALES_TEAM_TOKEN = process.env.SALES_TEAM_API_TOKEN;+const LEGAL_TEAM_TOKEN = process.env.LEGAL_TEAM_API_TOKEN;++// Get pending documents from sales team+const salesResponse = await fetch('https://app.documenso.com/api/v2/envelope?status=PENDING', {+ headers: { Authorization: SALES_TEAM_TOKEN },+});+const salesDocs = await salesResponse.json();++// Get completed documents from legal team+const legalResponse = await fetch('https://app.documenso.com/api/v2/envelope?status=COMPLETED', {+ headers: { Authorization: LEGAL_TEAM_TOKEN },+});+const legalDocs = await legalResponse.json();++console.log(`Sales team: ${salesDocs.pagination.totalItems} pending`);+console.log(`Legal team: ${legalDocs.pagination.totalItems} completed`);+```++## Error Responses++| Status | Description |+| ------ | ------------------------------------------------- |+| `401` | Invalid or expired API token |+| `403` | Token doesn't have permission for this operation |+| `404` | Resource not found or not accessible by this team |++### Example Error Response++```json+{+ "message": "You do not have permission to access this resource"+}+```++<Callout type="warn">+ API tokens can only access resources belonging to their associated team. Attempting to access+ resources from another team returns a 403 or 404 error.+</Callout>++## See Also++- [Documents API](/docs/developers/api/documents) - Create and manage documents+- [Templates API](/docs/developers/api/templates) - Work with document templates+- [Authentication](/docs/developers/getting-started/authentication) - Create and manage API tokensdiff --git a/apps/docs/content/docs/developers/api/templates.mdx b/apps/docs/content/docs/developers/api/templates.mdxnew file mode 100644index 000000000..91bdf5a07--- /dev/null+++ b/apps/docs/content/docs/developers/api/templates.mdx@@ -0,0 +1,1026 @@+---+title: Templates API+description: Create documents from reusable templates via API.+---++import { Callout } from 'fumadocs-ui/components/callout';+import { Tab, Tabs } from 'fumadocs-ui/components/tabs';++<Callout type="warn">+ This guide may not reflect the latest endpoints or parameters. For an always up-to-date reference,+ see the [OpenAPI Reference](https://openapi.documenso.com).+</Callout>++## Template Object++A template object contains the following properties:++| Property | Type | Description |+| ------------------- | -------------- | ------------------------------------------------------ |+| `id` | number | Unique template identifier |+| `envelopeId` | string | Associated envelope ID |+| `type` | string | Template type: `PRIVATE` or `PUBLIC` |+| `visibility` | string | Who can view: `EVERYONE`, `ADMIN`, `MANAGER_AND_ABOVE` |+| `title` | string | Template title |+| `externalId` | string \| null | Your custom identifier |+| `publicTitle` | string \| null | Public-facing title (for public templates) |+| `publicDescription` | string \| null | Public-facing description (for public templates) |+| `userId` | number | Owner's user ID |+| `teamId` | number \| null | Team ID if team-owned |+| `folderId` | string \| null | Folder containing the template |+| `createdAt` | string | ISO 8601 timestamp |+| `updatedAt` | string | ISO 8601 timestamp |+| `recipients` | array | Predefined recipients with roles and fields |+| `fields` | array | Signature and form fields on the template |+| `templateMeta` | object | Email settings, signing options, redirect URL |+| `directLink` | object \| null | Direct link configuration if enabled |++### Example Template Object++```json+{+ "id": 123,+ "envelopeId": "envelope_abc123xyz",+ "type": "PRIVATE",+ "visibility": "EVERYONE",+ "title": "Employment Contract",+ "externalId": "template-emp-001",+ "publicTitle": null,+ "publicDescription": null,+ "userId": 1,+ "teamId": 5,+ "folderId": null,+ "createdAt": "2025-01-10T08:00:00.000Z",+ "updatedAt": "2025-01-10T08:30:00.000Z",+ "recipients": [+ {+ "id": 1,+ "email": "[email protected]",+ "name": "Employee",+ "role": "SIGNER",+ "signingOrder": 1+ },+ {+ "id": 2,+ "email": "[email protected]",+ "name": "HR Manager",+ "role": "SIGNER",+ "signingOrder": 2+ }+ ],+ "fields": [+ {+ "id": 101,+ "type": "SIGNATURE",+ "page": 1,+ "positionX": 10,+ "positionY": 80,+ "width": 30,+ "height": 5,+ "recipientId": 1+ }+ ],+ "templateMeta": {+ "subject": "Your Employment Contract",+ "message": "Please review and sign your employment contract.",+ "redirectUrl": "https://example.com/welcome"+ },+ "directLink": null+}+```++## List Templates++Retrieve a paginated list of templates.++```+GET /template+```++### Query Parameters++| Parameter | Type | Description |+| ------------------ | ------- | ------------------------------------------------- |+| `page` | integer | Page number (default: 1) |+| `perPage` | integer | Results per page (default: 10, max: 100) |+| `type` | string | Filter by type: `PRIVATE` or `PUBLIC` |+| `folderId` | string | Filter by folder ID |+| `orderByColumn` | string | Sort field (only `createdAt` supported) |+| `orderByDirection` | string | Sort direction: `asc` or `desc` (default: `desc`) |++### Code Examples++<Tabs items={['curl', 'TypeScript']}>+<Tab value="curl">+```bash+# List all templates+curl -X GET "https://app.documenso.com/api/v2/template" \+ -H "Authorization: api_xxxxxxxxxxxxxxxx"++# Filter by type and paginate++curl -X GET "https://app.documenso.com/api/v2/template?type=PRIVATE&page=1&perPage=20" \+ -H "Authorization: api_xxxxxxxxxxxxxxxx"++````+</Tab>+<Tab value="TypeScript">+```typescript+const API_TOKEN = process.env.DOCUMENSO_API_TOKEN;+const BASE_URL = 'https://app.documenso.com/api/v2';++// List all templates+const response = await fetch(`${BASE_URL}/template`, {+ method: 'GET',+ headers: {+ Authorization: API_TOKEN,+ },+});++const { data, pagination } = await response.json();+console.log(`Found ${pagination.totalItems} templates`);++// Filter by type+const privateResponse = await fetch(+ `${BASE_URL}/template?type=PRIVATE&page=1&perPage=20`,+ {+ method: 'GET',+ headers: {+ Authorization: API_TOKEN,+ },+ }+);++const privateTemplates = await privateResponse.json();+````++</Tab>+</Tabs>++### Response++```json+{+ "data": [+ {+ "id": 123,+ "envelopeId": "envelope_abc123",+ "type": "PRIVATE",+ "title": "Employment Contract",+ "createdAt": "2025-01-10T08:00:00.000Z",+ "updatedAt": "2025-01-10T08:30:00.000Z",+ "recipients": [+ {+ "id": 1,+ "email": "[email protected]",+ "name": "Employee",+ "role": "SIGNER"+ }+ ]+ }+ ],+ "pagination": {+ "page": 1,+ "perPage": 10,+ "totalPages": 3,+ "totalItems": 25+ }+}+```++---++## Get Template++Retrieve a single template by ID.++```+GET /template/{templateId}+```++### Path Parameters++| Parameter | Type | Description |+| ------------ | ------ | --------------- |+| `templateId` | number | The template ID |++### Code Examples++<Tabs items={['curl', 'TypeScript']}>+<Tab value="curl">+```bash+curl -X GET "https://app.documenso.com/api/v2/template/123" \+ -H "Authorization: api_xxxxxxxxxxxxxxxx"+```+</Tab>+<Tab value="TypeScript">+```typescript+const templateId = 123;++const response = await fetch(`https://app.documenso.com/api/v2/template/${templateId}`, {+ method: 'GET',+ headers: {+ Authorization: 'api_xxxxxxxxxxxxxxxx',+ },+});++const template = await response.json();+console.log(template.title, template.recipients.length);+```+</Tab>+</Tabs>++### Response++Returns the full template object including recipients, fields, and metadata.++---++## Create Document from Template++Create a new document using a template. This is the primary way to use templates programmatically.++```++POST /template/use++````++### Request Body++| Field | Type | Required | Description |+| ------------------- | ------- | -------- | ---------------------------------------------------------- |+| `templateId` | number | Yes | The template ID to use |+| `recipients` | array | Yes | Recipient details (maps to template recipients) |+| `distributeDocument`| boolean | No | If `true`, immediately send the document to recipients |+| `externalId` | string | No | Your custom identifier for the created document |+| `folderId` | string | No | Folder ID to create the document in |+| `prefillFields` | array | No | Pre-fill field values before sending |+| `override` | object | No | Override template settings for this document |+| `formValues` | object | No | PDF form values to insert |++### Recipients Array++Each recipient object must include:++| Field | Type | Required | Description |+| ------- | ------ | -------- | ---------------------------------------------- |+| `id` | number | Yes | The recipient ID from the template |+| `email` | string | Yes | Recipient's email address |+| `name` | string | No | Recipient's display name |++### Code Examples++<Tabs items={['curl', 'TypeScript']}>+<Tab value="curl">+```bash+# Create document from template+curl -X POST "https://app.documenso.com/api/v2/template/use" \+ -H "Authorization: api_xxxxxxxxxxxxxxxx" \+ -H "Content-Type: application/json" \+ -d '{+ "templateId": 123,+ "recipients": [+ {+ "id": 1,+ "email": "[email protected]",+ "name": "John Doe"+ },+ {+ "id": 2,+ "email": "[email protected]",+ "name": "Jane Smith"+ }+ ],+ "distributeDocument": true,+ "externalId": "contract-2025-001"+ }'++# Create document with field prefilling+curl -X POST "https://app.documenso.com/api/v2/template/use" \+ -H "Authorization: api_xxxxxxxxxxxxxxxx" \+ -H "Content-Type: application/json" \+ -d '{+ "templateId": 123,+ "recipients": [+ {+ "id": 1,+ "email": "[email protected]",+ "name": "John Doe"+ }+ ],+ "prefillFields": [+ {+ "id": 101,+ "type": "text",+ "value": "Senior Software Engineer"+ },+ {+ "id": 102,+ "type": "number",+ "value": "85000"+ },+ {+ "id": 103,+ "type": "date",+ "value": "2025-02-01"+ }+ ],+ "distributeDocument": true+ }'+````++</Tab>+<Tab value="TypeScript">+```typescript+const API_TOKEN = process.env.DOCUMENSO_API_TOKEN;+const BASE_URL = 'https://app.documenso.com/api/v2';++// Create document from template+const response = await fetch(`${BASE_URL}/template/use`, {+ method: 'POST',+ headers: {+ Authorization: API_TOKEN,+ 'Content-Type': 'application/json',+ },+ body: JSON.stringify({+ templateId: 123,+ recipients: [+ {+ id: 1,+ email: '[email protected]',+ name: 'John Doe',+ },+ {+ id: 2,+ email: '[email protected]',+ name: 'Jane Smith',+ },+ ],+ distributeDocument: true,+ externalId: 'contract-2025-001',+ }),+});++const document = await response.json();+console.log('Created document:', document.id);++// Create document with prefilled fields+const prefillResponse = await fetch(`${BASE_URL}/template/use`, {+ method: 'POST',+ headers: {+ Authorization: API_TOKEN,+ 'Content-Type': 'application/json',+ },+ body: JSON.stringify({+ templateId: 123,+ recipients: [+ {+ id: 1,+ email: '[email protected]',+ name: 'John Doe',+ },+ ],+ prefillFields: [+ {+ id: 101,+ type: 'text',+ value: 'Senior Software Engineer',+ },+ {+ id: 102,+ type: 'number',+ value: '85000',+ },+ {+ id: 103,+ type: 'date',+ value: '2025-02-01',+ },+ ],+ distributeDocument: true,+ }),+});++const prefilledDocument = await prefillResponse.json();+````+</Tab>+</Tabs>++### Response++Returns the created document object with recipients and signing URLs.++```json+{+ "id": "envelope_xyz789",+ "type": "DOCUMENT",+ "status": "PENDING",+ "title": "Employment Contract",+ "source": "TEMPLATE",+ "externalId": "contract-2025-001",+ "recipients": [+ {+ "id": 1,+ "email": "[email protected]",+ "name": "John Doe",+ "role": "SIGNER",+ "signingStatus": "NOT_SIGNED",+ "signingUrl": "https://app.documenso.com/sign/abc123"+ }+ ]+}+````++---++## Override Template Settings++When creating a document from a template, you can override various settings:++```typescript+const response = await fetch(`${BASE_URL}/template/use`, {+ method: 'POST',+ headers: {+ Authorization: API_TOKEN,+ 'Content-Type': 'application/json',+ },+ body: JSON.stringify({+ templateId: 123,+ recipients: [{ id: 1, email: '[email protected]', name: 'Signer' }],+ override: {+ title: 'Custom Document Title',+ subject: 'Custom email subject',+ message: 'Custom email message body',+ timezone: 'America/New_York',+ dateFormat: 'MM/dd/yyyy',+ redirectUrl: 'https://example.com/custom-redirect',+ language: 'de',+ typedSignatureEnabled: true,+ uploadSignatureEnabled: false,+ drawSignatureEnabled: true,+ },+ distributeDocument: true,+ }),+});+```++### Override Options++| Field | Type | Description |+| ------------------------ | ------- | ------------------------------- |+| `title` | string | Document title |+| `subject` | string | Email subject line |+| `message` | string | Email body message |+| `timezone` | string | Timezone for date fields |+| `dateFormat` | string | Date format string |+| `redirectUrl` | string | URL to redirect after signing |+| `language` | string | Document language code |+| `typedSignatureEnabled` | boolean | Allow typed signatures |+| `uploadSignatureEnabled` | boolean | Allow uploaded signature images |+| `drawSignatureEnabled` | boolean | Allow drawn signatures |++---++## Prefill Fields++Prefill field values when creating a document from a template. This is useful for populating known data before sending.++### Supported Field Types++| Type | Value Format | Description |+| ---------- | ----------------- | ------------------------------ |+| `text` | string | Text field value |+| `number` | string | Numeric value as string |+| `date` | string (ISO 8601) | Date in `YYYY-MM-DD` format |+| `radio` | string | Selected option value |+| `checkbox` | array of strings | Array of checked option values |+| `dropdown` | string | Selected dropdown value |++### Prefill Field Schema++```typescript+type PrefillField = {+ id: number; // Field ID from template+ type: string; // Field type (must match template field)+ label?: string; // Optional label override+ placeholder?: string; // Optional placeholder (text/number only)+ value: string | string[]; // Value to prefill+};+```++### Example: Prefill Multiple Field Types++```typescript+const response = await fetch(`${BASE_URL}/template/use`, {+ method: 'POST',+ headers: {+ Authorization: API_TOKEN,+ 'Content-Type': 'application/json',+ },+ body: JSON.stringify({+ templateId: 123,+ recipients: [{ id: 1, email: '[email protected]', name: 'Signer' }],+ prefillFields: [+ // Text field+ {+ id: 101,+ type: 'text',+ value: 'John Doe',+ },+ // Number field+ {+ id: 102,+ type: 'number',+ value: '50000',+ },+ // Date field+ {+ id: 103,+ type: 'date',+ value: '2025-03-15',+ },+ // Radio field (select one option)+ {+ id: 104,+ type: 'radio',+ value: 'full-time',+ },+ // Checkbox field (select multiple options)+ {+ id: 105,+ type: 'checkbox',+ value: ['health', 'dental', '401k'],+ },+ // Dropdown field+ {+ id: 106,+ type: 'dropdown',+ value: 'engineering',+ },+ ],+ distributeDocument: true,+ }),+});+```++<Callout type="warn">+ The field type in `prefillFields` must match the actual field type in the template. A mismatch+ will result in an error.+</Callout>++---++## Update Template++Update a template's properties.++```+POST /template/update+```++### Request Body++| Field | Type | Required | Description |+| ------------ | ------ | -------- | ------------------------------------ |+| `templateId` | number | Yes | Template ID |+| `data` | object | No | Template properties to update |+| `meta` | object | No | Email and signing settings to update |++### Code Examples++<Tabs items={['curl', 'TypeScript']}>+<Tab value="curl">+```bash+curl -X POST "https://app.documenso.com/api/v2/template/update" \+ -H "Authorization: api_xxxxxxxxxxxxxxxx" \+ -H "Content-Type: application/json" \+ -d '{+ "templateId": 123,+ "data": {+ "title": "Updated Employment Contract",+ "visibility": "ADMIN"+ },+ "meta": {+ "subject": "Updated: Your Employment Contract",+ "redirectUrl": "https://example.com/updated-redirect"+ }+ }'+```+</Tab>+<Tab value="TypeScript">+```typescript+const response = await fetch(`${BASE_URL}/template/update`, {+ method: 'POST',+ headers: {+ Authorization: API_TOKEN,+ 'Content-Type': 'application/json',+ },+ body: JSON.stringify({+ templateId: 123,+ data: {+ title: 'Updated Employment Contract',+ visibility: 'ADMIN',+ },+ meta: {+ subject: 'Updated: Your Employment Contract',+ redirectUrl: 'https://example.com/updated-redirect',+ },+ }),+});++const template = await response.json();++```+</Tab>+</Tabs>++---++## Duplicate Template++Create a copy of an existing template.++```++POST /template/duplicate++````++### Request Body++| Field | Type | Required | Description |+| ------------ | ------ | -------- | --------------- |+| `templateId` | number | Yes | Template ID |++### Code Examples++<Tabs items={['curl', 'TypeScript']}>+<Tab value="curl">+```bash+curl -X POST "https://app.documenso.com/api/v2/template/duplicate" \+ -H "Authorization: api_xxxxxxxxxxxxxxxx" \+ -H "Content-Type: application/json" \+ -d '{+ "templateId": 123+ }'+````++</Tab>+<Tab value="TypeScript">+```typescript+const response = await fetch(`${BASE_URL}/template/duplicate`, {+ method: 'POST',+ headers: {+ Authorization: API_TOKEN,+ 'Content-Type': 'application/json',+ },+ body: JSON.stringify({+ templateId: 123,+ }),+});++const duplicatedTemplate = await response.json();+console.log('New template ID:', duplicatedTemplate.id);++```+</Tab>+</Tabs>++---++## Delete Template++Delete a template.++```++POST /template/delete++````++### Request Body++| Field | Type | Required | Description |+| ------------ | ------ | -------- | --------------- |+| `templateId` | number | Yes | Template ID |++### Code Examples++<Tabs items={['curl', 'TypeScript']}>+<Tab value="curl">+```bash+curl -X POST "https://app.documenso.com/api/v2/template/delete" \+ -H "Authorization: api_xxxxxxxxxxxxxxxx" \+ -H "Content-Type: application/json" \+ -d '{+ "templateId": 123+ }'+````++</Tab>+<Tab value="TypeScript">+```typescript+const response = await fetch(`${BASE_URL}/template/delete`, {+ method: 'POST',+ headers: {+ Authorization: API_TOKEN,+ 'Content-Type': 'application/json',+ },+ body: JSON.stringify({+ templateId: 123,+ }),+});++const { success } = await response.json();++````+</Tab>+</Tabs>++### Response++```json+{+ "success": true+}+````++---++## Direct Link Templates++Direct link templates allow recipients to create and sign documents without requiring you to explicitly create each document. When a recipient visits the direct link, a new document is automatically created from the template.++### Create Direct Link++```+POST /template/direct/create+```++| Field | Type | Required | Description |+| ------------------- | ------ | -------- | --------------------------------------------- |+| `templateId` | number | Yes | Template ID |+| `directRecipientId` | number | No | Recipient ID to use as the direct link signer |++<Tabs items={['curl', 'TypeScript']}>+<Tab value="curl">+```bash+curl -X POST "https://app.documenso.com/api/v2/template/direct/create" \+ -H "Authorization: api_xxxxxxxxxxxxxxxx" \+ -H "Content-Type: application/json" \+ -d '{+ "templateId": 123,+ "directRecipientId": 1+ }'+```+</Tab>+<Tab value="TypeScript">+```typescript+const response = await fetch(`${BASE_URL}/template/direct/create`, {+ method: 'POST',+ headers: {+ Authorization: API_TOKEN,+ 'Content-Type': 'application/json',+ },+ body: JSON.stringify({+ templateId: 123,+ directRecipientId: 1,+ }),+});++const directLink = await response.json();+console.log('Direct link token:', directLink.token);+// Share: https://app.documenso.com/d/{token}++````+</Tab>+</Tabs>++### Response++```json+{+ "id": 456,+ "token": "abc123xyz",+ "templateId": 123,+ "directTemplateRecipientId": 1,+ "enabled": true,+ "createdAt": "2025-01-15T10:00:00.000Z"+}+````++### Toggle Direct Link++Enable or disable an existing direct link.++```+POST /template/direct/toggle+```++<Tabs items={['curl', 'TypeScript']}>+<Tab value="curl">+```bash+curl -X POST "https://app.documenso.com/api/v2/template/direct/toggle" \+ -H "Authorization: api_xxxxxxxxxxxxxxxx" \+ -H "Content-Type: application/json" \+ -d '{+ "templateId": 123,+ "enabled": false+ }'+```+</Tab>+<Tab value="TypeScript">+```typescript+const response = await fetch(`${BASE_URL}/template/direct/toggle`, {+ method: 'POST',+ headers: {+ Authorization: API_TOKEN,+ 'Content-Type': 'application/json',+ },+ body: JSON.stringify({+ templateId: 123,+ enabled: false,+ }),+});++const directLink = await response.json();+console.log('Direct link enabled:', directLink.enabled);++```+</Tab>+</Tabs>++### Delete Direct Link++```++POST /template/direct/delete++````++<Tabs items={['curl', 'TypeScript']}>+<Tab value="curl">+```bash+curl -X POST "https://app.documenso.com/api/v2/template/direct/delete" \+ -H "Authorization: api_xxxxxxxxxxxxxxxx" \+ -H "Content-Type: application/json" \+ -d '{+ "templateId": 123+ }'+````++</Tab>+<Tab value="TypeScript">+```typescript+const response = await fetch(`${BASE_URL}/template/direct/delete`, {+ method: 'POST',+ headers: {+ Authorization: API_TOKEN,+ 'Content-Type': 'application/json',+ },+ body: JSON.stringify({+ templateId: 123,+ }),+});++const { success } = await response.json();++````+</Tab>+</Tabs>++---++## Custom Document Data++When creating a document from a template, you can replace the template's PDF with a custom PDF by using the `customDocumentData` parameter. This is useful when you need to generate the PDF dynamically while reusing the template's recipient and field configuration.++To use custom document data:++1. Retrieve the template to get the `envelopeItemId` of the PDF you want to replace+2. Include `customDocumentData` in your `template/use` request, mapping each `envelopeItemId` to a new file++The field positions from the template are preserved on the new PDF. Ensure the replacement PDF has the same page layout to maintain accurate field placement.++See the [OpenAPI Reference](https://openapi.documenso.com) for the full request schema.++---++## Template Types++| Type | Description |+| --------- | ------------------------------------------------------------------ |+| `PRIVATE` | Only accessible by owner and team members |+| `PUBLIC` | Can be shared publicly with a direct link |++---++## Complete Example: Contract Workflow++This example demonstrates a complete workflow for using templates to send contracts.++```typescript+const API_TOKEN = process.env.DOCUMENSO_API_TOKEN;+const BASE_URL = 'https://app.documenso.com/api/v2';++async function sendEmploymentContract(employeeData: {+ email: string;+ name: string;+ position: string;+ salary: number;+ startDate: string;+}) {+ // 1. Get the template to find recipient and field IDs+ const templateResponse = await fetch(`${BASE_URL}/template/456`, {+ headers: { Authorization: API_TOKEN },+ });+ const template = await templateResponse.json();++ // 2. Find the employee recipient slot+ const employeeRecipient = template.recipients.find(+ (r) => r.role === 'SIGNER' && r.signingOrder === 1+ );++ // 3. Find fields to prefill+ const positionField = template.fields.find(+ (f) => f.fieldMeta?.label === 'Position'+ );+ const salaryField = template.fields.find(+ (f) => f.fieldMeta?.label === 'Salary'+ );+ const startDateField = template.fields.find(+ (f) => f.type === 'DATE'+ );++ // 4. Create document from template with prefilled data+ const documentResponse = await fetch(`${BASE_URL}/template/use`, {+ method: 'POST',+ headers: {+ Authorization: API_TOKEN,+ 'Content-Type': 'application/json',+ },+ body: JSON.stringify({+ templateId: 456,+ recipients: [+ {+ id: employeeRecipient.id,+ email: employeeData.email,+ name: employeeData.name,+ },+ ],+ prefillFields: [+ {+ id: positionField.id,+ type: 'text',+ value: employeeData.position,+ },+ {+ id: salaryField.id,+ type: 'number',+ value: employeeData.salary.toString(),+ },+ {+ id: startDateField.id,+ type: 'date',+ value: employeeData.startDate,+ },+ ],+ override: {+ subject: `Employment Contract for ${employeeData.name}`,+ message: `Hi ${employeeData.name},\n\nPlease review and sign your employment contract.`,+ },+ distributeDocument: true,+ externalId: `emp-contract-${Date.now()}`,+ }),+ });++ const document = await documentResponse.json();++ return {+ documentId: document.id,+ signingUrl: document.recipients[0].signingUrl,+ };+}++// Usage+const result = await sendEmploymentContract({+ email: '[email protected]',+ name: 'John Doe',+ position: 'Senior Engineer',+ salary: 120000,+ startDate: '2025-03-01',+});++console.log('Document created:', result.documentId);+console.log('Signing URL:', result.signingUrl);+````++---++## See Also++- [Documents API](/docs/developers/api/documents) - Work with created documents+- [Recipients API](/docs/developers/api/recipients) - Manage document recipients+- [Fields API](/docs/developers/api/fields) - Work with signature and form fields+- [Webhooks](/docs/developers/webhooks) - Get notified when documents are signeddiff --git a/apps/docs/content/docs/developers/api/versioning.mdx b/apps/docs/content/docs/developers/api/versioning.mdxnew file mode 100644index 000000000..c137a869a--- /dev/null+++ b/apps/docs/content/docs/developers/api/versioning.mdx@@ -0,0 +1,25 @@+---+title: API Versioning+description: Versioning information for the Documenso public API.+---++import { Callout } from 'fumadocs-ui/components/callout';++## Overview++Documenso uses API versioning to manage changes to the public API. This allows us to introduce new features, fix bugs, and make other changes without breaking existing integrations.++<Callout type="info">The current version of the API is `v2`.</Callout>++The API version is specified in the URL. For example, the base URL for the `v2` API is `https://app.documenso.com/api/v2`.++We may make changes to the API without incrementing the version number. We will always try to avoid breaking changes, but in some cases, it may be necessary to make changes that are not backward compatible. In these cases, we will increment the version number and provide information about the changes in the release notes.++Also, we may deprecate certain features or endpoints in the API. When we deprecate a feature or endpoint, we will provide information about the deprecation in the release notes and give a timeline for when the feature or endpoint will be removed.++---++## See Also++- [Authentication](/docs/developers/getting-started/authentication) - API authentication guide+- [Rate Limits](/docs/developers/api/rate-limits) - API rate limit detailsdiff --git a/apps/docs/content/docs/developers/contributing/contributing-translations.mdx b/apps/docs/content/docs/developers/contributing/contributing-translations.mdxnew file mode 100644index 000000000..24b069ee0--- /dev/null+++ b/apps/docs/content/docs/developers/contributing/contributing-translations.mdx@@ -0,0 +1,91 @@+---+title: Contributing Translations+description: Learn how to contribute translations to Documenso and become part of our community.+---++import { Callout } from 'fumadocs-ui/components/callout';+import { Step, Steps } from 'fumadocs-ui/components/steps';++We are always open for help with translations! Currently we utilise AI to generate the initial translations for new languages, which are then improved over time by our awesome community.++If you are looking for development notes on translations, you can find them [here](/docs/developers/local-development/translations).++<Callout type="info">+ Contributions are made through GitHub Pull Requests, so you will need a GitHub account to+ contribute.+</Callout>++## Overview++We store our translations in PO files, which are located in our GitHub repository [here](https://github.com/documenso/documenso/tree/main/packages/lib/translations).++The translation files are organized into folders represented by their respective language codes (`en` for English, `de` for German, etc).++Each PO file contains translations which look like this:++```po+#: apps/remix/app/(signing)/sign/[token]/no-longer-available.tsx:61+msgid "Want to send slick signing links like this one? <0>Check out Documenso.</0>"+msgstr "Möchten Sie auffällige Signatur-Links wie diesen senden? <0>Überprüfen Sie Documenso.</0>"+```++- `msgid`: The original text in English (never edit this manually)+- `msgstr`: The translated text in the target language++<Callout type="warn">+ Notice the `<0>` tags? These represent HTML elements and must remain in both the `msgid` and `msgstr`. Make sure to translate the content between these tags while keeping the tags intact.+</Callout>++## How to Contribute++### Updating Existing Translations++{/* prettier-ignore */}+<Steps>+ <Step>+ Fork the repository+ </Step>+ <Step>+ Navigate to the appropriate language folder and open the PO file you want to update+ </Step>+ <Step>+ Make your changes, ensuring you follow the PO file format+ </Step>+ <Step>+ Commit your changes with a message such as <code>chore: update German translations</code>+ </Step>+ <Step>+ Create a Pull Request+ </Step>+</Steps>++### Adding a New Language++If you want to add translations for a language that doesn't exist yet:++{/* prettier-ignore */}+<Steps>+ <Step>+ Create an issue in our GitHub repository requesting the addition of the new language+ </Step>+ <Step>+ Wait for our team to review and approve the request+ </Step>+ <Step>+ Once approved, we will set up the necessary files and kickstart the translations with AI to+ provide initial coverage+ </Step>+</Steps>++## Need Help?++<Callout type="info">+ If you have any questions, hop into our [Discord](https://documen.so/discord) and ask us directly!+</Callout>++Thank you for helping make Documenso more accessible to users around the world!++## See Also++- [Translations (Development)](/docs/developers/local-development/translations) - Technical guide to translations in code+- [Contributing Guide](/docs/developers/contributing) - General contributing guidelinesdiff --git a/apps/docs/content/docs/developers/contributing/index.mdx b/apps/docs/content/docs/developers/contributing/index.mdxnew file mode 100644index 000000000..51296f50b--- /dev/null+++ b/apps/docs/content/docs/developers/contributing/index.mdx@@ -0,0 +1,152 @@+---+title: Contributing to Documenso+description: Learn how to contribute to Documenso and become part of our community.+---++import { Callout } from 'fumadocs-ui/components/callout';+import { Step, Steps } from 'fumadocs-ui/components/steps';++## Overview++If you plan to contribute to Documenso, please take a moment to feel awesome. People like you are what open source is about. Any contributions, no matter how big or small, are highly appreciated.++This guide will help you get started with contributing to Documenso.++## Before Getting Started++{/* prettier-ignore */}+<Steps>++<Step>+### Check the existing issues and pull requests++Search the existing [issues](https://github.com/documenso/documenso/issues) to see if someone else reported the same issue. Or, check the [existing PRs](https://github.com/documenso/documenso/pulls) to see if someone else is already working on the same thing.++</Step>++<Step>+### Creating a new issue++If there is no issue or PR for the problem you are facing, feel free to create a new issue. Make sure to provide as much detail as possible, including the steps to reproduce the issue.++</Step>++<Step>+### Picking an existing issue++If you pick an existing issue, take into consideration the discussion on the issue.++</Step>++<Step>+### Contributor license agreement++Accept the [Contributor License Agreement](https://documen.so/cla) to ensure we can accept your contributions.++</Step>++</Steps>++## Taking Issues++Before taking an issue, ensure that:++- The issue has been assigned the public label.+- The issue is clearly defined and understood.+- No one has been assigned to the issue.+- No one has expressed the intention to work on it.++After that:++1. Comment on the issue with your intention to work on it.+2. Start working on the issue.++Feel free to ask for help, clarification or guidance if needed. We are here to help you.++## Developing++The development branch is `main`, and all pull requests should be made against this branch. Here's how you can get started with developing:++{/* prettier-ignore */}+<Steps>++<Step>+### Set up Documenso locally++To set up your local environment, check out the [local development](/docs/developers/local-development) guide.++</Step>++<Step>+### Pick a task++Find an issue to work on or create a new one.++> Before working on an issue, ensure that no one else is working on it. If no one is assigned to the issue, you can pick it up by leaving a comment and asking to assign it to you.++Before creating a new issue, check the existing issues to see if someone else has already reported it.++</Step>++<Step>+### Create a new branch++After you're assigned an issue, you can start working on it. Create a new branch for your feature or bug fix.++When creating a branch, make sure that the branch name:++- starts with the correct prefix: `feat/` for new features, `fix/` for bug fixes, etc.+- includes the issue ID you are working on (if applicable).+- is descriptive.++```sh+git checkout -b feat/issue-id-your-branch-name++## Example+git checkout -b feat/1234-add-share-button-to-articles+```++In the pull request description, include `references #yyyy` or `fixes #yyyy` to link it to the issue you are working on.++</Step>++<Step>+### Implement your changes++Start working on the issue you picked up and implement the changes. Make sure to test your changes locally and ensure that they work as expected.++</Step>++<Step>+### Open a pull request++After implementing your changes, open a pull request against the `main` branch.++</Step>++</Steps>++<Callout type="info">+ If you need help getting started, [join us on Discord](https://documen.so/discord).+</Callout>++## Building++Before pushing code or creating pull requests, please ensure you can successfully create a successful production build. You can build the project by running the following command in your terminal:++```bash+npm run build+```++Once the project builds successfully, you can push your code changes or create a pull request.++<Callout type="info">+ Remember to run tests and perform any necessary checks before finalizing your changes. As a+ result, we can collaborate more effectively and maintain a high standard of code quality in our+ project.+</Callout>++## See Also++- [Local Development](/docs/developers/local-development) - Set up your development environment+- [Contributing Translations](/docs/developers/contributing/contributing-translations) - Help translate Documensodiff --git a/apps/docs/content/docs/developers/contributing/meta.json b/apps/docs/content/docs/developers/contributing/meta.jsonnew file mode 100644index 000000000..85a61090e--- /dev/null+++ b/apps/docs/content/docs/developers/contributing/meta.json@@ -0,0 +1,4 @@+{+ "title": "Contributing",+ "pages": ["contributing-translations"]+}diff --git a/apps/docs/content/docs/developers/demo-environment/index.mdx b/apps/docs/content/docs/developers/demo-environment/index.mdxnew file mode 100644index 000000000..4980fc25b--- /dev/null+++ b/apps/docs/content/docs/developers/demo-environment/index.mdx@@ -0,0 +1,64 @@+---+title: Demo Environment+description: Use the demo environment to try out the Documenso platform and its features.+---++import { Step, Steps } from 'fumadocs-ui/components/steps';++## Overview++The demo (staging) environment is a sandbox environment that replicates the production environment. It has the same features and capabilities as the production environment, but is intended for development and testing purposes.++You can use it to try out the Documenso platform and its features before committing to a paid plan.++## How to Use the Demo Environment++{/* prettier-ignore */}+<Steps>+ <Step>+ ### Navigate to the staging environment++ Go to the [staging environment](https://stg-app.documenso.com).++ </Step>+ <Step>+ ### Create an account++ You need to create a new account for the demo environment. You can't use your production account.++ </Step>+ <Step>+ ### Pick a paid plan++ Choose the appropriate plan for your needs.++ You can also use the free plan but it's limited to 5 documents per month and up to 10 recipients per document.++ Whatever plan you choose, you can upgrade later.++ </Step>+ <Step>+ ### Use a test card++ To upgrade to a paid plan, you can use a test card. Example:++ ```+ Card number: 4242 4242 4242 4242+ Expiry date: 02/2030 (or any valid future date)+ CVV: 123+ ```++ </Step>+ <Step>+ ### Use the platform++ You can then try out the platform and its features.++ </Step>+ <Step>+ ### Issues, questions and feedback++ If you have any issues, questions or feedback, please reach out to us on the [Documenso Discord](https://documen.so/discord) or [GitHub](https://github.com/documenso/documenso/issues).++ </Step>+</Steps>diff --git a/apps/docs/content/docs/developers/embedding/authoring.mdx b/apps/docs/content/docs/developers/embedding/authoring.mdxnew file mode 100644index 000000000..030f9ae93--- /dev/null+++ b/apps/docs/content/docs/developers/embedding/authoring.mdx@@ -0,0 +1,306 @@+---+title: Authoring+description: Embed document and template creation directly in your application.+---++import { Callout } from 'fumadocs-ui/components/callout';++In addition to embedding signing, Documenso supports embedded authoring. It allows your users to create and edit documents and templates without leaving your application.++<Callout type="warn">+ Embedded authoring is included with [Enterprise](https://documen.so/enterprise-cta) plans. It is+ also available as a paid add-on for the [Platform Plan](https://documen.so/platform-cta-pricing).+ Contact sales for access.+</Callout>++## Components++The SDK provides four authoring components:++| Component | Purpose |+| ----------------------- | ----------------------- |+| `EmbedCreateDocumentV1` | Create new documents |+| `EmbedCreateTemplateV1` | Create new templates |+| `EmbedUpdateDocumentV1` | Edit existing documents |+| `EmbedUpdateTemplateV1` | Edit existing templates |++All authoring components require a **presign token** for authentication instead of a regular token.++---++## Presign Tokens++Before using any authoring component, obtain a presign token from your backend:++```+POST /api/v2/embedding/create-presign-token+```++This endpoint requires your Documenso API key. The token has a default expiration of 1 hour.++See the [API documentation](https://openapi.documenso.com/reference#tag/embedding) for full details.++<Callout type="warn">+ Presign tokens should be created server-side. Never expose your API key in client-side code.+</Callout>++---++## Creating Documents++```jsx+import { EmbedCreateDocumentV1 } from '@documenso/embed-react';++const DocumentCreator = ({ presignToken }) => {+ return (+ <div style={{ height: '800px', width: '100%' }}>+ <EmbedCreateDocumentV1+ presignToken={presignToken}+ externalId="order-12345"+ onDocumentCreated={(data) => {+ console.log('Document created:', data.documentId);+ console.log('External ID:', data.externalId);+ }}+ />+ </div>+ );+};+```++---++## Creating Templates++```jsx+import { EmbedCreateTemplateV1 } from '@documenso/embed-react';++const TemplateCreator = ({ presignToken }) => {+ return (+ <div style={{ height: '800px', width: '100%' }}>+ <EmbedCreateTemplateV1+ presignToken={presignToken}+ externalId="template-12345"+ onTemplateCreated={(data) => {+ console.log('Template created:', data.templateId);+ }}+ />+ </div>+ );+};+```++---++## Editing Documents++```jsx+import { EmbedUpdateDocumentV1 } from '@documenso/embed-react';++const DocumentEditor = ({ presignToken, documentId }) => {+ return (+ <div style={{ height: '800px', width: '100%' }}>+ <EmbedUpdateDocumentV1+ presignToken={presignToken}+ documentId={documentId}+ externalId="order-12345"+ onDocumentUpdated={(data) => {+ console.log('Document updated:', data.documentId);+ }}+ />+ </div>+ );+};+```++---++## Editing Templates++```jsx+import { EmbedUpdateTemplateV1 } from '@documenso/embed-react';++const TemplateEditor = ({ presignToken, templateId }) => {+ return (+ <div style={{ height: '800px', width: '100%' }}>+ <EmbedUpdateTemplateV1+ presignToken={presignToken}+ templateId={templateId}+ externalId="template-12345"+ onTemplateUpdated={(data) => {+ console.log('Template updated:', data.templateId);+ }}+ />+ </div>+ );+};+```++---++## Props++### All Authoring Components++| Prop | Type | Required | Description |+| ------------------ | --------- | -------- | -------------------------------------------------------- |+| `presignToken` | `string` | Yes | Authentication token from your backend |+| `externalId` | `string` | No | Your reference ID to link with the document or template |+| `host` | `string` | No | Custom host URL. Defaults to `https://app.documenso.com` |+| `css` | `string` | No | Custom CSS string (Platform Plan) |+| `cssVars` | `object` | No | CSS variable overrides (Platform Plan) |+| `darkModeDisabled` | `boolean` | No | Disable dark mode (Platform Plan) |+| `className` | `string` | No | CSS class for the iframe |+| `features` | `object` | No | Feature toggles for the authoring experience |++### Update Components Only++| Prop | Type | Required | Description |+| ---------------- | --------- | -------- | ---------------------------------------------------------- |+| `documentId` | `number` | Yes | The document ID to edit (for document update component) |+| `templateId` | `number` | Yes | The template ID to edit (for template update component) |+| `onlyEditFields` | `boolean` | No | Restrict editing to fields only, skipping recipient config |++---++## Feature Toggles++Customize what options are available in the authoring experience:++```jsx+<EmbedCreateDocumentV1+ presignToken={presignToken}+ features={{+ allowConfigureSignatureTypes: true,+ allowConfigureLanguage: true,+ allowConfigureDateFormat: true,+ allowConfigureTimezone: true,+ allowConfigureRedirectUrl: true,+ allowConfigureCommunication: true,+ }}+/>+```++---++## Event Callbacks++All creation callbacks receive:++| Field | Type | Description |+| ---------------------------- | -------- | --------------------------------------- |+| `documentId` or `templateId` | `number` | The ID of the created or updated item |+| `externalId` | `string` | Your external reference ID, if provided |++---++## Field-Only Editing++Restrict users to editing fields only, skipping recipient configuration:++```jsx+<EmbedUpdateDocumentV1+ presignToken={presignToken}+ documentId={123}+ onlyEditFields={true}+ onDocumentUpdated={(data) => {+ console.log('Fields updated:', data.documentId);+ }}+/>+```++---++## Complete Integration Example++This example shows a full workflow where users create a document and then edit it:++```tsx+import { useState } from 'react';++import { EmbedCreateDocumentV1, EmbedUpdateDocumentV1 } from '@documenso/embed-react';++const DocumentManager = ({ presignToken }) => {+ const [documentId, setDocumentId] = useState(null);+ const [mode, setMode] = useState('create');++ if (mode === 'success') {+ return (+ <div>+ <h2>Document updated successfully</h2>+ <button+ onClick={() => {+ setDocumentId(null);+ setMode('create');+ }}+ >+ Create Another Document+ </button>+ </div>+ );+ }++ if (mode === 'edit' && documentId) {+ return (+ <div style={{ height: '800px', width: '100%' }}>+ <button onClick={() => setMode('create')}>Back to Create</button>+ <EmbedUpdateDocumentV1+ presignToken={presignToken}+ documentId={documentId}+ onDocumentUpdated={(data) => {+ console.log('Document updated:', data.documentId);+ setMode('success');+ }}+ />+ </div>+ );+ }++ return (+ <div style={{ height: '800px', width: '100%' }}>+ <EmbedCreateDocumentV1+ presignToken={presignToken}+ features={{+ allowConfigureSignatureTypes: true,+ allowConfigureLanguage: true,+ }}+ onDocumentCreated={(data) => {+ console.log('Document created:', data.documentId);+ setDocumentId(data.documentId);+ setMode('edit');+ }}+ />+ </div>+ );+};+```++---++## Additional Props++Pass extra props to the iframe for testing experimental features:++```jsx+<EmbedCreateDocumentV1+ presignToken="YOUR_PRESIGN_TOKEN"+ additionalProps={{+ experimentalFeature: true,+ customSetting: 'value',+ }}+/>+```++<Callout type="info">+ Presign tokens expire after 1 hour by default. You can customize this duration based on your+ security requirements. Generate fresh tokens for each session and avoid caching them on the client+ side.+</Callout>++---++## See Also++- [Embedding Overview](/docs/developers/embedding) - Signing embed concepts and props+- [CSS Variables](/docs/developers/embedding/css-variables) - Customize appearance+- [Documents API](/docs/developers/api/documents) - Create documents via API+- [Templates API](/docs/developers/api/templates) - Create templates via APIdiff --git a/apps/docs/content/docs/developers/embedding/css-variables.mdx b/apps/docs/content/docs/developers/embedding/css-variables.mdxnew file mode 100644index 000000000..e95b0fda4--- /dev/null+++ b/apps/docs/content/docs/developers/embedding/css-variables.mdx@@ -0,0 +1,215 @@+---+title: CSS Variables+description: Customize the appearance of embedded signing experiences with CSS variables and class targets.+---++import { Accordion, Accordions } from 'fumadocs-ui/components/accordion';+import { Callout } from 'fumadocs-ui/components/callout';++<Callout type="info">+ Custom CSS and CSS variables are available on the [Platform+ Plan](https://documen.so/platform-cta-pricing).+</Callout>++## CSS Variables++Use the `cssVars` prop on any embed component to override default colors, spacing, and more.++```jsx+<EmbedDirectTemplate+ token="your-token"+ cssVars={{+ background: '#ffffff',+ foreground: '#000000',+ primary: '#0000ff',+ primaryForeground: '#ffffff',+ radius: '0.5rem',+ }}+/>+```++### Colors++| Variable | Description |+| ----------------------- | --------------------------------- |+| `background` | Base background color |+| `foreground` | Base text color |+| `muted` | Muted/subtle background color |+| `mutedForeground` | Muted/subtle text color |+| `popover` | Popover/dropdown background color |+| `popoverForeground` | Popover/dropdown text color |+| `card` | Card background color |+| `cardBorder` | Card border color |+| `cardBorderTint` | Card border tint/highlight color |+| `cardForeground` | Card text color |+| `fieldCard` | Field card background color |+| `fieldCardBorder` | Field card border color |+| `fieldCardForeground` | Field card text color |+| `widget` | Widget background color |+| `widgetForeground` | Widget text color |+| `border` | Default border color |+| `input` | Input field border color |+| `primary` | Primary action/button color |+| `primaryForeground` | Primary action/button text color |+| `secondary` | Secondary action/button color |+| `secondaryForeground` | Secondary button text color |+| `accent` | Accent/highlight color |+| `accentForeground` | Accent/highlight text color |+| `destructive` | Destructive/danger action color |+| `destructiveForeground` | Destructive/danger text color |+| `ring` | Focus ring color |+| `warning` | Warning/alert color |++### Spacing++| Variable | Description |+| -------- | ---------------------------------- |+| `radius` | Border radius size (e.g. `0.5rem`) |++### Framework Usage++Pass `cssVars` to any embed component. The syntax varies by framework:++```jsx+// React / Preact+<EmbedDirectTemplate token={token} cssVars={cssVars} />++// Vue+<EmbedDirectTemplate :token="token" :cssVars="cssVars" />++// Svelte+<EmbedDirectTemplate {token} cssVars={cssVars} />++// Solid+<EmbedDirectTemplate token={token} cssVars={cssVars} />+```++### Color Formats++Colors can be specified in any valid CSS format:++- Hex: `#ff0000`+- RGB: `rgb(255, 0, 0)`+- HSL: `hsl(0, 100%, 50%)`+- Named: `red`++---++## Custom CSS++Use the `css` prop to inject a CSS string for more targeted control:++```jsx+<EmbedDirectTemplate+ token="your-token"+ css={`+ .documenso-embed {+ border-radius: 8px;+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);+ }+ `}+/>+```++---++## CSS Class Targets++Specific parts of the embed can be targeted with CSS classes for granular styling.++### Component Classes++| Class | Description |+| --------------------------------- | --------------------------------------------- |+| `.embed--Root` | Main container for the embedded experience |+| `.embed--DocumentContainer` | Container for the document and signing widget |+| `.embed--DocumentViewer` | Container for the document viewer |+| `.embed--DocumentWidget` | The signing widget container |+| `.embed--DocumentWidgetContainer` | Outer container for the signing widget |+| `.embed--DocumentWidgetHeader` | Header section of the signing widget |+| `.embed--DocumentWidgetContent` | Main content area of the signing widget |+| `.embed--DocumentWidgetForm` | Form section within the signing widget |+| `.embed--DocumentWidgetFooter` | Footer section of the signing widget |+| `.embed--WaitingForTurn` | Waiting screen when it is not the user's turn |+| `.embed--DocumentCompleted` | Completion screen after signing |+| `.field--FieldRootContainer` | Base container for document fields |++### Field Data Attributes++Fields expose data attributes for state-based styling:++| Attribute | Values | Description |+| ------------------- | ---------------------------------------------- | ------------------------------------ |+| `[data-field-type]` | `SIGNATURE`, `TEXT`, `CHECKBOX`, `RADIO`, etc. | The type of field |+| `[data-inserted]` | `true`, `false` | Whether the field has been filled |+| `[data-validate]` | `true`, `false` | Whether the field is being validated |++### Example++```css+/* Style signature fields */+.field--FieldRootContainer[data-field-type='SIGNATURE'] {+ background-color: rgba(0, 0, 0, 0.02);+}++/* Style filled fields */+.field--FieldRootContainer[data-inserted='true'] {+ background-color: var(--primary);+ opacity: 0.2;+}++/* Custom widget styling */+.embed--DocumentWidget {+ background-color: #ffffff;+ box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);+}+```++### Additional Examples++```css+/* Style all field containers with transitions */+.field--FieldRootContainer {+ transition: all 200ms ease;+}++/* Custom styles for the waiting screen */+.embed--WaitingForTurn {+ background-color: #f9fafb;+ padding: 2rem;+}++/* Responsive adjustments for the document container */+@media (min-width: 768px) {+ .embed--DocumentContainer {+ gap: 2rem;+ }+}+```++---++## Best Practices++<Accordions type="multiple">+ <Accordion title="Maintain contrast">+ Ensure sufficient contrast between background and foreground colors for accessibility.+ </Accordion>+ <Accordion title="Test dark mode">+ If dark mode is not disabled, verify your variables work in both modes.+ </Accordion>+ <Accordion title="Match your brand">+ Align `primary` and `accent` colors with your brand for a cohesive look.+ </Accordion>+ <Accordion title="Consistent radius">+ Use a border radius that matches your application's design system.+ </Accordion>+</Accordions>++---++## See Also++- [Embedding Overview](/docs/developers/embedding) - Props reference and concepts+- [React](/docs/developers/embedding/sdks/react) - React SDK usage+- [Vue](/docs/developers/embedding/sdks/vue) - Vue SDK usagediff --git a/apps/docs/content/docs/developers/embedding/direct-links.mdx b/apps/docs/content/docs/developers/embedding/direct-links.mdxnew file mode 100644index 000000000..87e1ac75c--- /dev/null+++ b/apps/docs/content/docs/developers/embedding/direct-links.mdx@@ -0,0 +1,514 @@+---+title: Direct Links+description: Share a URL or embed an iframe to let users sign documents without email invitations.+---++import { Callout } from 'fumadocs-ui/components/callout';+import { Step, Steps } from 'fumadocs-ui/components/steps';+import { Tab, Tabs } from 'fumadocs-ui/components/tabs';++## What Are Direct Links?++Direct links are unique URLs tied to a template that allow anyone to:++{/* prettier-ignore */}+<Steps>+ <Step>+ View and sign a document without receiving an email invitation+ </Step>+ <Step>+ Enter their own name and email address+ </Step>+ <Step>+ Complete signature fields and submit the document+ </Step>+</Steps>++When someone uses a direct link, Documenso creates a new document from the template with that person as the signer.++### When to Use Direct Links++- Collecting signatures from unknown recipients (forms, waivers, petitions)+- Embedding signing in your website or application+- Self-service contracts where customers initiate signing+- Public-facing agreements that anyone can sign++### Limitations++- Only work with templates, not individual documents+- Each link is tied to one recipient role in the template+- Recipients enter their own information (you cannot prefill recipient details)++## Creating Direct Link Templates++Before embedding, you need a template with direct links enabled.++### Via the Dashboard++{/* prettier-ignore */}+<Steps>+<Step>+Go to **Templates** and create or select a template++++</Step>+<Step>+Click the three-dot menu and select **Direct link**+</Step>+<Step>+Click **Enable direct link signing**+</Step>+<Step>+Choose which recipient in your template will use the direct link++++</Step>+<Step>+Copy the generated URL+</Step>+</Steps>++### Via the API++Create a direct link for an existing template:++<Tabs items={['curl', 'TypeScript']}>+<Tab value="curl">+```bash+# Create direct link for template+curl -X POST "https://app.documenso.com/api/v2/template/direct/create" \+ -H "Authorization: api_xxxxxxxxxxxxxxxx" \+ -H "Content-Type: application/json" \+ -d '{+ "templateId": 123,+ "directRecipientId": 1+ }'+```+</Tab>+<Tab value="TypeScript">+```typescript+const API_TOKEN = process.env.DOCUMENSO_API_TOKEN;+const BASE_URL = 'https://app.documenso.com/api/v2';++const response = await fetch(`${BASE_URL}/template/direct/create`, {+ method: 'POST',+ headers: {+ Authorization: API_TOKEN,+ 'Content-Type': 'application/json',+ },+ body: JSON.stringify({+ templateId: 123,+ directRecipientId: 1, // Optional: specific recipient to use+ }),+});++const directLink = await response.json();+console.log('Direct link token:', directLink.token);+// URL: https://app.documenso.com/d/{token}+````+</Tab>+</Tabs>++### Response++```json+{+ "id": 456,+ "token": "abc123xyz",+ "templateId": 123,+ "directTemplateRecipientId": 1,+ "enabled": true,+ "createdAt": "2025-01-15T10:00:00.000Z"+}+````++The direct link URL format is:++```+https://app.documenso.com/d/{token}+```++++---++## Embedding in an iframe++Embed the signing experience directly in your application using an iframe.++### Basic iframe Embedding++```html+<iframe+ src="https://app.documenso.com/embed/direct/abc123xyz"+ width="100%"+ height="800"+ frameborder="0"+ allow="clipboard-write"+></iframe>+```++### Responsive iframe++```html+<div style="position: relative; width: 100%; padding-bottom: 75%; height: 0; overflow: hidden;">+ <iframe+ src="https://app.documenso.com/embed/direct/abc123xyz"+ style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none;"+ allow="clipboard-write"+ ></iframe>+</div>+```++### React Component Example++```tsx+function DocumentSigner({ token }: { token: string }) {+ return (+ <div className="h-[800px] w-full">+ <iframe+ src={`https://app.documenso.com/embed/direct/${token}`}+ className="h-full w-full border-0"+ allow="clipboard-write"+ title="Sign Document"+ />+ </div>+ );+}+```++<Callout type="info">+ The embed URL uses `/embed/direct/{token}` instead of `/d/{token}`. The embed version is optimized+ for iframe embedding with reduced navigation.+</Callout>++---++## Embedding with Redirect++Instead of an iframe, redirect users to the signing page and bring them back after completion.++### Simple Redirect++```typescript+function redirectToSigning(token: string) {+ window.location.href = `https://app.documenso.com/d/${token}`;+}+```++### With Return URL++Configure a redirect URL in your template settings to return users to your application after signing:++{/* prettier-ignore */}+<Steps>+ <Step>+ Edit your template+ </Step>+ <Step>+ Go to **Advanced Settings**+ </Step>+ <Step>+ Set **Redirect URL** to your desired return URL (e.g., `https://yourapp.com/signed`)+ </Step>+</Steps>++Or set it via API when creating the template:++```typescript+const response = await fetch(`${BASE_URL}/template/update`, {+ method: 'POST',+ headers: {+ Authorization: API_TOKEN,+ 'Content-Type': 'application/json',+ },+ body: JSON.stringify({+ templateId: 123,+ meta: {+ redirectUrl: 'https://yourapp.com/signing-complete',+ },+ }),+});+```++After signing completes, users are automatically redirected to the specified URL.++---++## URL Parameters++Pass additional data through the direct link URL using query parameters.++### External ID++Track which document belongs to which transaction in your system:++```+https://app.documenso.com/d/abc123xyz?externalId=order-12345+```++The external ID is stored with the created document and included in webhook payloads.++### Example: Dynamic External ID++```typescript+function getSigningUrl(token: string, orderId: string) {+ const params = new URLSearchParams({+ externalId: orderId,+ });++ return `https://app.documenso.com/d/${token}?${params.toString()}`;+}++// Usage+const url = getSigningUrl('abc123xyz', 'order-12345');+// https://app.documenso.com/d/abc123xyz?externalId=order-12345+```++### Embed URL Parameters++The embed URL supports the same parameters:++```+https://app.documenso.com/embed/direct/abc123xyz?externalId=order-12345+```++---++## Security Considerations++### Access Authentication++Direct links can require authentication before signing. Configure this in your template settings:++| Auth Type | Description |+| --------- | ---------------------------------------------- |+| None | Anyone with the link can sign |+| Account | Signer must be logged into a Documenso account |++To require authentication, set `globalAccessAuth` when creating or updating the template:++```typescript+const response = await fetch(`${BASE_URL}/template/update`, {+ method: 'POST',+ headers: {+ Authorization: API_TOKEN,+ 'Content-Type': 'application/json',+ },+ body: JSON.stringify({+ templateId: 123,+ data: {+ globalAccessAuth: ['ACCOUNT'], // Require login+ },+ }),+});+```++### Disabling Direct Links++Temporarily disable a direct link without deleting it:++<Tabs items={['curl', 'TypeScript']}>+<Tab value="curl">+```bash+curl -X POST "https://app.documenso.com/api/v2/template/direct/toggle" \+ -H "Authorization: api_xxxxxxxxxxxxxxxx" \+ -H "Content-Type: application/json" \+ -d '{+ "templateId": 123,+ "enabled": false+ }'+```+</Tab>+<Tab value="TypeScript">+```typescript+const response = await fetch(`${BASE_URL}/template/direct/toggle`, {+ method: 'POST',+ headers: {+ Authorization: API_TOKEN,+ 'Content-Type': 'application/json',+ },+ body: JSON.stringify({+ templateId: 123,+ enabled: false,+ }),+});+```+</Tab>+</Tabs>++Re-enable later by setting `enabled: true`. The URL remains the same.++### Deleting Direct Links++Permanently remove a direct link:++```bash+curl -X POST "https://app.documenso.com/api/v2/template/direct/delete" \+ -H "Authorization: api_xxxxxxxxxxxxxxxx" \+ -H "Content-Type: application/json" \+ -d '{+ "templateId": 123+ }'+```++<Callout type="warn">+ Deleting a direct link invalidates the URL permanently. If you enable direct links again, a new+ URL will be generated.+</Callout>++---++## Styling and Customization++### Branding++The signing experience uses your organisation's branding settings:++- Logo+- Primary color+- Email customization++Configure branding in **Settings** > **Branding** or via team settings.++### Signature Options++Control which signature input methods are available:++```typescript+const response = await fetch(`${BASE_URL}/template/update`, {+ method: 'POST',+ headers: {+ Authorization: API_TOKEN,+ 'Content-Type': 'application/json',+ },+ body: JSON.stringify({+ templateId: 123,+ meta: {+ typedSignatureEnabled: true, // Allow typed signatures+ drawSignatureEnabled: true, // Allow drawn signatures+ uploadSignatureEnabled: false, // Disable uploaded signatures+ },+ }),+});+```++### White-labeling++Enterprise plans support white-label embedding with the "Powered by Documenso" badge removed. [Contact sales](mailto:[email protected]) for details.++---++## Handling Completion++### Webhook Notifications++Set up webhooks to receive notifications when documents are signed:++```json+{+ "event": "DOCUMENT_SIGNED",+ "payload": {+ "id": 123,+ "externalId": "order-12345",+ "title": "contract.pdf",+ "status": "COMPLETED",+ "Recipient": [+ {+ "email": "[email protected]",+ "name": "John Doe",+ "signingStatus": "SIGNED",+ "signedAt": "2024-01-15T10:30:00.000Z"+ }+ ]+ },+ "createdAt": "2024-01-15T10:30:00.000Z",+ "webhookEndpoint": "https://your-endpoint.com/webhook"+}+```++See [Webhooks](/docs/developers/webhooks) for setup instructions.++### Polling for Status++If webhooks aren't suitable, poll the document status:++```typescript+async function checkDocumentStatus(externalId: string) {+ const response = await fetch(`${BASE_URL}/envelope?source=TEMPLATE_DIRECT_LINK`, {+ headers: { Authorization: API_TOKEN },+ });++ const { data } = await response.json();++ return data.find((doc) => doc.externalId === externalId);+}+```++---++## Complete Example++This example shows a complete workflow for embedding direct link signing:++```typescript+const API_TOKEN = process.env.DOCUMENSO_API_TOKEN;+const BASE_URL = 'https://app.documenso.com/api/v2';++// 1. Get template with direct link+async function getDirectLinkTemplate(templateId: number) {+ const response = await fetch(`${BASE_URL}/template/${templateId}`, {+ headers: { Authorization: API_TOKEN },+ });++ return response.json();+}++// 2. Create direct link if not exists+async function ensureDirectLink(templateId: number, recipientId: number) {+ const template = await getDirectLinkTemplate(templateId);++ if (template.directLink?.enabled) {+ return template.directLink.token;+ }++ const response = await fetch(`${BASE_URL}/template/direct/create`, {+ method: 'POST',+ headers: {+ Authorization: API_TOKEN,+ 'Content-Type': 'application/json',+ },+ body: JSON.stringify({+ templateId,+ directRecipientId: recipientId,+ }),+ });++ const directLink = await response.json();+ return directLink.token;+}++// 3. Generate signing URL with tracking+function getEmbedUrl(token: string, orderId: string) {+ const params = new URLSearchParams({ externalId: orderId });+ return `https://app.documenso.com/embed/direct/${token}?${params}`;+}++// Usage+const token = await ensureDirectLink(123, 1);+const embedUrl = getEmbedUrl(token, 'order-12345');++// Embed in your page+document.getElementById('signer-frame').src = embedUrl;+```++---++## See Also++- [SDKs](/docs/developers/embedding/sdks) - Framework SDK integration+- [Templates API](/docs/developers/api/templates) - Template management+- [Webhooks](/docs/developers/webhooks) - Event notifications+- [Direct Links (User Guide)](/docs/users/documents/direct-links) - End-user documentationdiff --git a/apps/docs/content/docs/developers/embedding/index.mdx b/apps/docs/content/docs/developers/embedding/index.mdxnew file mode 100644index 000000000..3161907d4--- /dev/null+++ b/apps/docs/content/docs/developers/embedding/index.mdx@@ -0,0 +1,242 @@+---+title: Embedding+description: Embed document signing experiences directly in your application using official SDKs.+---++import { Callout } from 'fumadocs-ui/components/callout';+import { Step, Steps } from 'fumadocs-ui/components/steps';++## Embedded Signing vs Embedded Authoring++Documenso offers two types of embedding:++- **Embedded Signing** lets you embed the signing experience in your application. Your users sign documents without leaving your site. Available on Teams Plan and above.+- **Embedded Authoring** lets you embed document and template _creation and editing_ in your application. This is an [Enterprise](/docs/policies/enterprise-edition) feature (also available as a Platform Plan add-on). See the [Authoring](/docs/developers/embedding/authoring) guide.++This page covers **embedded signing**. If you need your users to create or edit documents inside your app, see [Authoring](/docs/developers/embedding/authoring).++---++## Availability++Embedding is available on **Teams Plan** and above, as well as for **Early Adopters** within a team (Early Adopters can create a team for free).++The [Platform Plan](https://documen.so/platform-cta-pricing) adds enhanced customization:++- Custom CSS and styling variables+- Dark mode controls+- Removal of Documenso branding++---++## How It Works++There are two ways to embed signing, each using a different component and token type.++### Direct Templates++Direct templates are evergreen - each time a user completes signing, a new document is created from the template. This is the recommended approach for most use cases.++Use the `EmbedDirectTemplate` component with a template token:++```jsx+import { EmbedDirectTemplate } from '@documenso/embed-react';++<EmbedDirectTemplate+ token="your-template-token"+ onDocumentCompleted={(data) => {+ console.log('Signed:', data.documentId);+ }}+/>;+```++### Signing Tokens++For advanced integrations where you create documents via the API, you can embed the signing experience for a specific recipient using their signing token.++Use the `EmbedSignDocument` component with the recipient's token:++```jsx+import { EmbedSignDocument } from '@documenso/embed-react';++<EmbedSignDocument+ token="recipient-signing-token"+ onDocumentCompleted={(data) => {+ console.log('Signed:', data.documentId);+ }}+/>;+```++<Callout type="info">+ For most use cases, direct templates are the way to go. Use signing tokens when you need+ programmatic control over document creation via the API.+</Callout>++---++## Getting Your Token++### Direct Template Token++{/* prettier-ignore */}+<Steps>+<Step>+Navigate to your team's templates in Documenso++++</Step>+<Step>+Click on a direct link template to copy its URL. The token is the last segment of the URL.++For example, `https://app.documenso.com/d/-WoSwWVT-fYOERS2MI37k` has the token `-WoSwWVT-fYOERS2MI37k`.++If your template is not a direct link template yet, select **Direct Link** from the three-dot menu on the templates table to enable it.++++</Step>+</Steps>++### Signing Token++Signing tokens are returned in API responses when distributing a document. You can also get one manually by hovering over a recipient's avatar on a document you own and clicking their email.++++---++## Framework SDKs++Pick your framework to get started:++<Cards>+ <Card+ title="React"+ description="@documenso/embed-react"+ href="/docs/developers/embedding/sdks/react"+ />+ <Card title="Vue" description="@documenso/embed-vue" href="/docs/developers/embedding/sdks/vue" />+ <Card+ title="Svelte"+ description="@documenso/embed-svelte"+ href="/docs/developers/embedding/sdks/svelte"+ />+ <Card+ title="Angular"+ description="@documenso/embed-angular"+ href="/docs/developers/embedding/sdks/angular"+ />+ <Card+ title="Solid"+ description="@documenso/embed-solid"+ href="/docs/developers/embedding/sdks/solid"+ />+ <Card+ title="Preact"+ description="@documenso/embed-preact"+ href="/docs/developers/embedding/sdks/preact"+ />+</Cards>++A [Web Components](https://developer.mozilla.org/en-US/docs/Web/API/Web_components) SDK (`@documenso/embed-webcomponent`) is also available for use outside of JavaScript frameworks. It works in any environment that supports custom elements.++If you prefer not to use any SDK, you can embed signing using [Direct Links](/docs/developers/embedding/direct-links) with a plain iframe or redirect.++---++## Props++### EmbedDirectTemplate++| Prop | Type | Description |+| --------------------- | ---------- | ---------------------------------------------------------------- |+| `token` | `string` | **Required.** The direct template token. |+| `host` | `string` | Documenso instance URL. Defaults to `https://app.documenso.com`. |+| `name` | `string` | Pre-fill the signer's name. |+| `lockName` | `boolean` | Prevent the signer from changing their name. |+| `email` | `string` | Pre-fill the signer's email. |+| `lockEmail` | `boolean` | Prevent the signer from changing their email. |+| `externalId` | `string` | Your reference ID, stored with the created document. |+| `css` | `string` | Custom CSS string (Platform Plan). |+| `cssVars` | `object` | CSS variable overrides for theming (Platform Plan). |+| `darkModeDisabled` | `boolean` | Disable dark mode in the embed (Platform Plan). |+| `onDocumentReady` | `function` | Called when the document is loaded and ready. |+| `onDocumentCompleted` | `function` | Called when signing is completed. |+| `onDocumentError` | `function` | Called when an error occurs. |+| `onFieldSigned` | `function` | Called when a field is signed. |+| `onFieldUnsigned` | `function` | Called when a field value is cleared. |++### EmbedSignDocument++| Prop | Type | Description |+| --------------------- | ---------- | ---------------------------------------------------------------- |+| `token` | `string` | **Required.** The recipient's signing token. |+| `host` | `string` | Documenso instance URL. Defaults to `https://app.documenso.com`. |+| `name` | `string` | Pre-fill the signer's name. |+| `lockName` | `boolean` | Prevent the signer from changing their name. |+| `onDocumentReady` | `function` | Called when the document is loaded and ready. |+| `onDocumentCompleted` | `function` | Called when signing is completed. |+| `onDocumentError` | `function` | Called when an error occurs. |++---++## Event Callbacks++### onDocumentCompleted++Receives an object with:++| Field | Type | Description |+| ------------- | -------- | ------------------------------ |+| `token` | `string` | The token used for signing. |+| `documentId` | `number` | The ID of the signed document. |+| `recipientId` | `number` | The ID of the recipient. |++### onFieldSigned++Receives an object with:++| Field | Type | Description |+| ---------- | --------- | -------------------------------------------- |+| `fieldId` | `number` | The ID of the field. |+| `value` | `string` | The field value. |+| `isBase64` | `boolean` | Whether the value is a base64 encoded image. |++### onFieldUnsigned++Receives an object with:++| Field | Type | Description |+| --------- | -------- | -------------------- |+| `fieldId` | `number` | The ID of the field. |++---++## More++<Cards>+ <Card+ title="Direct Links"+ description="Embed with iframes or redirects, no SDK required."+ href="/docs/developers/embedding/direct-links"+ />+ <Card+ title="CSS Variables"+ description="Customize colors, spacing, and theming."+ href="/docs/developers/embedding/css-variables"+ />+ <Card+ title="Authoring"+ description="Embed document and template creation."+ href="/docs/developers/embedding/authoring"+ />+</Cards>++---++## See Also++- [Documents API](/docs/developers/api/documents) - Create documents programmatically+- [Templates API](/docs/developers/api/templates) - Manage templates via API+- [Webhooks](/docs/developers/webhooks) - Receive server-side signing notificationsdiff --git a/apps/docs/content/docs/developers/embedding/meta.json b/apps/docs/content/docs/developers/embedding/meta.jsonnew file mode 100644index 000000000..293124961--- /dev/null+++ b/apps/docs/content/docs/developers/embedding/meta.json@@ -0,0 +1,4 @@+{+ "title": "Embedding",+ "pages": ["sdks", "direct-links", "css-variables", "authoring"]+}diff --git a/apps/docs/content/docs/developers/embedding/sdks/angular.mdx b/apps/docs/content/docs/developers/embedding/sdks/angular.mdxnew file mode 100644index 000000000..1ebe6f9e8--- /dev/null+++ b/apps/docs/content/docs/developers/embedding/sdks/angular.mdx@@ -0,0 +1,92 @@+---+title: Angular+description: Embed Documenso signing in your Angular application using the official SDK.+---++import { Tab, Tabs } from 'fumadocs-ui/components/tabs';++## Installation++<Tabs items={['npm', 'yarn', 'pnpm']}>+ <Tab value="npm">``` npm install @documenso/embed-angular ```</Tab>+ <Tab value="yarn">``` yarn add @documenso/embed-angular ```</Tab>+ <Tab value="pnpm">``` pnpm add @documenso/embed-angular ```</Tab>+</Tabs>++---++## Direct Template++```typescript+import { Component } from '@angular/core';+import { EmbedDirectTemplate } from '@documenso/embed-angular';++@Component({+ selector: 'app-signing',+ standalone: true,+ imports: [EmbedDirectTemplate],+ template: `+ <embed-direct-template+ [token]="token"+ [name]="'John Doe'"+ [email]="'[email protected]'"+ [lockEmail]="true"+ [externalId]="'order-12345'"+ (documentReady)="onReady()"+ (documentCompleted)="onCompleted($event)"+ (documentError)="onError()"+ />+ `,+})+export class SigningComponent {+ token = 'your-template-token';++ onReady() {+ console.log('Ready');+ }++ onCompleted(data: { documentId: number }) {+ console.log('Signed:', data.documentId);+ }++ onError() {+ console.error('Error');+ }+}+```++---++## Signing Token++```typescript+import { Component, Input } from '@angular/core';+import { EmbedSignDocument } from '@documenso/embed-angular';++@Component({+ selector: 'app-signing',+ standalone: true,+ imports: [EmbedSignDocument],+ template: `+ <embed-sign-document+ [token]="token"+ (documentCompleted)="onCompleted($event)"+ />+ `,+})+export class SigningComponent {+ @Input() token = '';++ onCompleted(data: { documentId: number }) {+ console.log('Signed:', data.documentId);+ }+}+```++---++## See Also++- [Embedding Overview](/docs/developers/embedding) - Props reference and concepts+- [CSS Variables](/docs/developers/embedding/css-variables) - Customize appearance+- [Authoring](/docs/developers/embedding/authoring) - Embed document creationdiff --git a/apps/docs/content/docs/developers/embedding/sdks/index.mdx b/apps/docs/content/docs/developers/embedding/sdks/index.mdxnew file mode 100644index 000000000..3c333f3f5--- /dev/null+++ b/apps/docs/content/docs/developers/embedding/sdks/index.mdx@@ -0,0 +1,37 @@+---+title: SDKs+description: Official embedding SDKs for React, Vue, Svelte, Angular, Solid, and Preact.+---++Install the SDK for your framework and embed document signing with a few lines of code.++<Cards>+ <Card+ title="React"+ description="@documenso/embed-react"+ href="/docs/developers/embedding/sdks/react"+ />+ <Card title="Vue" description="@documenso/embed-vue" href="/docs/developers/embedding/sdks/vue" />+ <Card+ title="Svelte"+ description="@documenso/embed-svelte"+ href="/docs/developers/embedding/sdks/svelte"+ />+ <Card+ title="Angular"+ description="@documenso/embed-angular"+ href="/docs/developers/embedding/sdks/angular"+ />+ <Card+ title="Solid"+ description="@documenso/embed-solid"+ href="/docs/developers/embedding/sdks/solid"+ />+ <Card+ title="Preact"+ description="@documenso/embed-preact"+ href="/docs/developers/embedding/sdks/preact"+ />+</Cards>++If you are not using a JavaScript framework, you can embed signing using [Direct Links](/docs/developers/embedding/direct-links) with a plain iframe or redirect.diff --git a/apps/docs/content/docs/developers/embedding/sdks/meta.json b/apps/docs/content/docs/developers/embedding/sdks/meta.jsonnew file mode 100644index 000000000..92b396635--- /dev/null+++ b/apps/docs/content/docs/developers/embedding/sdks/meta.json@@ -0,0 +1,4 @@+{+ "title": "SDKs",+ "pages": ["react", "vue", "svelte", "angular", "solid", "preact"]+}diff --git a/apps/docs/content/docs/developers/embedding/sdks/preact.mdx b/apps/docs/content/docs/developers/embedding/sdks/preact.mdxnew file mode 100644index 000000000..f552e507d--- /dev/null+++ b/apps/docs/content/docs/developers/embedding/sdks/preact.mdx@@ -0,0 +1,96 @@+---+title: Preact+description: Embed Documenso signing in your Preact application using the official SDK.+---++import { Tab, Tabs } from 'fumadocs-ui/components/tabs';++## Installation++<Tabs items={['npm', 'yarn', 'pnpm']}>+ <Tab value="npm">``` npm install @documenso/embed-preact ```</Tab>+ <Tab value="yarn">``` yarn add @documenso/embed-preact ```</Tab>+ <Tab value="pnpm">``` pnpm add @documenso/embed-preact ```</Tab>+</Tabs>++---++## Direct Template++```tsx+import { EmbedDirectTemplate } from '@documenso/embed-preact';++const SigningPage = () => {+ return (+ <EmbedDirectTemplate+ token="your-template-token"+ name="John Doe"+ email="[email protected]"+ lockEmail={true}+ externalId="order-12345"+ onDocumentReady={() => console.log('Ready')}+ onDocumentCompleted={(data) => {+ console.log('Signed:', data.documentId);+ }}+ onDocumentError={() => console.error('Error')}+ />+ );+};+```++---++## Signing Token++```tsx+import { EmbedSignDocument } from '@documenso/embed-preact';++const SigningPage = ({ token }: { token: string }) => {+ return (+ <EmbedSignDocument+ token={token}+ onDocumentCompleted={(data) => {+ console.log('Signed:', data.documentId);+ }}+ />+ );+};+```++---++## Styling (Platform Plan)++```tsx+import { EmbedDirectTemplate } from '@documenso/embed-preact';++const StyledEmbed = () => {+ return (+ <EmbedDirectTemplate+ token="your-token"+ css={`+ .documenso-embed {+ border-radius: 8px;+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);+ }+ `}+ cssVars={{+ primary: '#0000FF',+ background: '#F5F5F5',+ radius: '8px',+ }}+ darkModeDisabled={true}+ />+ );+};+```++See [CSS Variables](/docs/developers/embedding/css-variables) for all available variables.++---++## See Also++- [Embedding Overview](/docs/developers/embedding) - Props reference and concepts+- [CSS Variables](/docs/developers/embedding/css-variables) - Customize appearance+- [Authoring](/docs/developers/embedding/authoring) - Embed document creationdiff --git a/apps/docs/content/docs/developers/embedding/sdks/react.mdx b/apps/docs/content/docs/developers/embedding/sdks/react.mdxnew file mode 100644index 000000000..65e9058df--- /dev/null+++ b/apps/docs/content/docs/developers/embedding/sdks/react.mdx@@ -0,0 +1,136 @@+---+title: React+description: Embed Documenso signing in your React application using the official SDK.+---++import { Tab, Tabs } from 'fumadocs-ui/components/tabs';++## Installation++<Tabs items={['npm', 'yarn', 'pnpm']}>+ <Tab value="npm">``` npm install @documenso/embed-react ```</Tab>+ <Tab value="yarn">``` yarn add @documenso/embed-react ```</Tab>+ <Tab value="pnpm">``` pnpm add @documenso/embed-react ```</Tab>+</Tabs>++---++## Direct Template++```tsx+import { EmbedDirectTemplate } from '@documenso/embed-react';++const SigningPage = () => {+ return (+ <EmbedDirectTemplate+ token="your-template-token"+ name="John Doe"+ email="[email protected]"+ lockEmail={true}+ externalId="order-12345"+ onDocumentReady={() => console.log('Ready')}+ onDocumentCompleted={(data) => {+ console.log('Signed:', data.documentId);+ }}+ onDocumentError={() => console.error('Error')}+ />+ );+};+```++---++## Signing Token++```tsx+import { EmbedSignDocument } from '@documenso/embed-react';++const SigningPage = ({ token }: { token: string }) => {+ return (+ <EmbedSignDocument+ token={token}+ onDocumentCompleted={(data) => {+ console.log('Signed:', data.documentId);+ }}+ />+ );+};+```++---++## Styling (Platform Plan)++```tsx+import { EmbedDirectTemplate } from '@documenso/embed-react';++const StyledEmbed = () => {+ return (+ <EmbedDirectTemplate+ token="your-token"+ css={`+ .documenso-embed {+ border-radius: 8px;+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);+ }+ `}+ cssVars={{+ primary: '#0000FF',+ background: '#F5F5F5',+ radius: '8px',+ }}+ darkModeDisabled={true}+ />+ );+};+```++See [CSS Variables](/docs/developers/embedding/css-variables) for all available variables.++---++## Complete Example++```tsx+import { useState } from 'react';++import { EmbedDirectTemplate } from '@documenso/embed-react';++type Status = 'loading' | 'ready' | 'completed' | 'error';++const DocumentSigning = ({ token }: { token: string }) => {+ const [status, setStatus] = useState<Status>('loading');++ if (status === 'completed') {+ return <p>Thank you for signing the document.</p>;+ }++ if (status === 'error') {+ return <p>An error occurred. Please try again.</p>;+ }++ return (+ <div style={{ position: 'relative', height: '100vh' }}>+ {status === 'loading' && (+ <div style={{ position: 'absolute', inset: 0, display: 'grid', placeItems: 'center' }}>+ Loading...+ </div>+ )}+ <EmbedDirectTemplate+ token={token}+ onDocumentReady={() => setStatus('ready')}+ onDocumentCompleted={() => setStatus('completed')}+ onDocumentError={() => setStatus('error')}+ />+ </div>+ );+};+```++---++## See Also++- [Embedding Overview](/docs/developers/embedding) - Props reference and concepts+- [CSS Variables](/docs/developers/embedding/css-variables) - Customize appearance+- [Authoring](/docs/developers/embedding/authoring) - Embed document creationdiff --git a/apps/docs/content/docs/developers/embedding/sdks/solid.mdx b/apps/docs/content/docs/developers/embedding/sdks/solid.mdxnew file mode 100644index 000000000..a3a5eb972--- /dev/null+++ b/apps/docs/content/docs/developers/embedding/sdks/solid.mdx@@ -0,0 +1,96 @@+---+title: Solid+description: Embed Documenso signing in your Solid application using the official SDK.+---++import { Tab, Tabs } from 'fumadocs-ui/components/tabs';++## Installation++<Tabs items={['npm', 'yarn', 'pnpm']}>+ <Tab value="npm">``` npm install @documenso/embed-solid ```</Tab>+ <Tab value="yarn">``` yarn add @documenso/embed-solid ```</Tab>+ <Tab value="pnpm">``` pnpm add @documenso/embed-solid ```</Tab>+</Tabs>++---++## Direct Template++```tsx+import { EmbedDirectTemplate } from '@documenso/embed-solid';++const SigningPage = () => {+ return (+ <EmbedDirectTemplate+ token="your-template-token"+ name="John Doe"+ email="[email protected]"+ lockEmail={true}+ externalId="order-12345"+ onDocumentReady={() => console.log('Ready')}+ onDocumentCompleted={(data) => {+ console.log('Signed:', data.documentId);+ }}+ onDocumentError={() => console.error('Error')}+ />+ );+};+```++---++## Signing Token++```tsx+import { EmbedSignDocument } from '@documenso/embed-solid';++const SigningPage = (props: { token: string }) => {+ return (+ <EmbedSignDocument+ token={props.token}+ onDocumentCompleted={(data) => {+ console.log('Signed:', data.documentId);+ }}+ />+ );+};+```++---++## Styling (Platform Plan)++```tsx+import { EmbedDirectTemplate } from '@documenso/embed-solid';++const StyledEmbed = () => {+ return (+ <EmbedDirectTemplate+ token="your-token"+ css={`+ .documenso-embed {+ border-radius: 8px;+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);+ }+ `}+ cssVars={{+ primary: '#0000FF',+ background: '#F5F5F5',+ radius: '8px',+ }}+ darkModeDisabled={true}+ />+ );+};+```++See [CSS Variables](/docs/developers/embedding/css-variables) for all available variables.++---++## See Also++- [Embedding Overview](/docs/developers/embedding) - Props reference and concepts+- [CSS Variables](/docs/developers/embedding/css-variables) - Customize appearance+- [Authoring](/docs/developers/embedding/authoring) - Embed document creationdiff --git a/apps/docs/content/docs/developers/embedding/sdks/svelte.mdx b/apps/docs/content/docs/developers/embedding/sdks/svelte.mdxnew file mode 100644index 000000000..9492bb6eb--- /dev/null+++ b/apps/docs/content/docs/developers/embedding/sdks/svelte.mdx@@ -0,0 +1,104 @@+---+title: Svelte+description: Embed Documenso signing in your Svelte application using the official SDK.+---++import { Tab, Tabs } from 'fumadocs-ui/components/tabs';++## Installation++<Tabs items={['npm', 'yarn', 'pnpm']}>+ <Tab value="npm">``` npm install @documenso/embed-svelte ```</Tab>+ <Tab value="yarn">``` yarn add @documenso/embed-svelte ```</Tab>+ <Tab value="pnpm">``` pnpm add @documenso/embed-svelte ```</Tab>+</Tabs>++---++## Direct Template++```svelte+<script lang="ts">+ import { EmbedDirectTemplate } from '@documenso/embed-svelte';++ const token = 'your-template-token';++ function onCompleted(data: { documentId: number }) {+ console.log('Signed:', data.documentId);+ }+</script>++<EmbedDirectTemplate+ {token}+ name="John Doe"+ email="[email protected]"+ lockEmail={true}+ externalId="order-12345"+ onDocumentReady={() => console.log('Ready')}+ onDocumentCompleted={onCompleted}+ onDocumentError={() => console.error('Error')}+/>+```++---++## Signing Token++```svelte+<script lang="ts">+ import { EmbedSignDocument } from '@documenso/embed-svelte';++ export let token: string;++ function onCompleted(data: { documentId: number }) {+ console.log('Signed:', data.documentId);+ }+</script>++<EmbedSignDocument+ {token}+ onDocumentCompleted={onCompleted}+/>+```++---++## Styling (Platform Plan)++```svelte+<script lang="ts">+ import { EmbedDirectTemplate } from '@documenso/embed-svelte';++ const token = 'your-token';++ const customCss = `+ .documenso-embed {+ border-radius: 8px;+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);+ }+ `;++ const cssVars = {+ primary: '#0000FF',+ background: '#F5F5F5',+ radius: '8px',+ };+</script>++<EmbedDirectTemplate+ {token}+ css={customCss}+ cssVars={cssVars}+ darkModeDisabled={true}+/>+```++See [CSS Variables](/docs/developers/embedding/css-variables) for all available variables.++---++## See Also++- [Embedding Overview](/docs/developers/embedding) - Props reference and concepts+- [CSS Variables](/docs/developers/embedding/css-variables) - Customize appearance+- [Authoring](/docs/developers/embedding/authoring) - Embed document creationdiff --git a/apps/docs/content/docs/developers/embedding/sdks/vue.mdx b/apps/docs/content/docs/developers/embedding/sdks/vue.mdxnew file mode 100644index 000000000..fc174eab4--- /dev/null+++ b/apps/docs/content/docs/developers/embedding/sdks/vue.mdx@@ -0,0 +1,107 @@+---+title: Vue+description: Embed Documenso signing in your Vue application using the official SDK.+---++import { Tab, Tabs } from 'fumadocs-ui/components/tabs';++## Installation++<Tabs items={['npm', 'yarn', 'pnpm']}>+ <Tab value="npm">``` npm install @documenso/embed-vue ```</Tab>+ <Tab value="yarn">``` yarn add @documenso/embed-vue ```</Tab>+ <Tab value="pnpm">``` pnpm add @documenso/embed-vue ```</Tab>+</Tabs>++---++## Direct Template++```html+<script setup lang="ts">+ import { EmbedDirectTemplate } from '@documenso/embed-vue';++ const token = 'your-template-token';++ function onCompleted(data: { documentId: number }) {+ console.log('Signed:', data.documentId);+ }+</script>++<template>+ <EmbedDirectTemplate+ :token="token"+ name="John Doe"+ email="[email protected]"+ :lockEmail="true"+ externalId="order-12345"+ @document-completed="onCompleted"+ @document-ready="() => console.log('Ready')"+ @document-error="() => console.error('Error')"+ />+</template>+```++---++## Signing Token++```html+<script setup lang="ts">+ import { EmbedSignDocument } from '@documenso/embed-vue';++ const props = defineProps<{ token: string }>();++ function onCompleted(data: { documentId: number }) {+ console.log('Signed:', data.documentId);+ }+</script>++<template>+ <EmbedSignDocument :token="props.token" @document-completed="onCompleted" />+</template>+```++---++## Styling (Platform Plan)++```html+<script setup lang="ts">+ import { EmbedDirectTemplate } from '@documenso/embed-vue';++ const token = 'your-token';++ const customCss = `+ .documenso-embed {+ border-radius: 8px;+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);+ }+`;++ const cssVars = {+ primary: '#0000FF',+ background: '#F5F5F5',+ radius: '8px',+ };+</script>++<template>+ <EmbedDirectTemplate+ :token="token"+ :css="customCss"+ :cssVars="cssVars"+ :darkModeDisabled="true"+ />+</template>+```++See [CSS Variables](/docs/developers/embedding/css-variables) for all available variables.++---++## See Also++- [Embedding Overview](/docs/developers/embedding) - Props reference and concepts+- [CSS Variables](/docs/developers/embedding/css-variables) - Customize appearance+- [Authoring](/docs/developers/embedding/authoring) - Embed document creationdiff --git a/apps/docs/content/docs/developers/examples/common-workflows.mdx b/apps/docs/content/docs/developers/examples/common-workflows.mdxnew file mode 100644index 000000000..fe7887d5b--- /dev/null+++ b/apps/docs/content/docs/developers/examples/common-workflows.mdx@@ -0,0 +1,1157 @@+---+title: Common Workflows+description: Complete code examples for common document signing workflows, with error handling that can be adapted for your specific use case.+---++import { Accordion, Accordions } from 'fumadocs-ui/components/accordion';+import { Callout } from 'fumadocs-ui/components/callout';+import { Step, Steps } from 'fumadocs-ui/components/steps';+import { Tab, Tabs } from 'fumadocs-ui/components/tabs';++## Workflow 1: Send a Document for Signature++The most common workflow: upload a PDF, add recipients with signature fields, and send for signing.++{/* prettier-ignore */}+<Steps>+ <Step>+ Build the recipient payload with signature and date fields+ </Step>+ <Step>+ Create the envelope via <code>POST /envelope/create</code> with the PDF and payload+ </Step>+ <Step>+ Distribute the document via <code>POST /envelope/distribute</code> to send signing links+ </Step>+</Steps>++<Tabs items={['TypeScript', 'curl']}>+<Tab value="TypeScript">+```typescript+const API_TOKEN = process.env.DOCUMENSO_API_TOKEN;+const BASE_URL = 'https://app.documenso.com/api/v2';++type Recipient = {+ email: string;+ name: string;+ role: 'SIGNER' | 'APPROVER' | 'CC' | 'VIEWER';+};++type CreateAndSendResult = {+ envelopeId: string;+ recipients: Array<{+ email: string;+ signingUrl: string;+ }>;+};++async function createAndSendDocument(+ pdfBuffer: Buffer,+ filename: string,+ title: string,+ recipients: Recipient[],+): Promise<CreateAndSendResult> {+ const recipientPayload = recipients.map((recipient, index) => ({+ email: recipient.email,+ name: recipient.name,+ role: recipient.role,+ signingOrder: index + 1,+ fields:+ recipient.role === 'SIGNER'+ ? [+ {+ identifier: 0,+ type: 'SIGNATURE',+ page: 1,+ positionX: 10,+ positionY: 80 - index * 10,+ width: 30,+ height: 5,+ },+ {+ identifier: 0,+ type: 'DATE',+ page: 1,+ positionX: 50,+ positionY: 80 - index * 10,+ width: 20,+ height: 3,+ },+ ]+ : [],+ }));++ const formData = new FormData();+ formData.append(+ 'payload',+ JSON.stringify({+ type: 'DOCUMENT',+ title,+ recipients: recipientPayload,+ meta: {+ subject: `Please sign: ${title}`,+ message: 'Please review and sign the attached document.',+ },+ }),+ );+ formData.append('files', new Blob([pdfBuffer], { type: 'application/pdf' }), filename);++ const createResponse = await fetch(`${BASE_URL}/envelope/create`, {+ method: 'POST',+ headers: { Authorization: API_TOKEN },+ body: formData,+ });++ if (!createResponse.ok) {+ const error = await createResponse.json();+ throw new Error(`Failed to create envelope: ${error.message}`);+ }++ const { id: envelopeId } = await createResponse.json();++ const distributeResponse = await fetch(`${BASE_URL}/envelope/distribute`, {+ method: 'POST',+ headers: {+ Authorization: API_TOKEN,+ 'Content-Type': 'application/json',+ },+ body: JSON.stringify({ envelopeId }),+ });++ if (!distributeResponse.ok) {+ const error = await distributeResponse.json();+ throw new Error(`Failed to send document: ${error.message}`);+ }++ const distributeResult = await distributeResponse.json();++ return {+ envelopeId,+ recipients: distributeResult.recipients.map(+ (r: { email: string; signingUrl: string }) => ({+ email: r.email,+ signingUrl: r.signingUrl,+ }),+ ),+ };+}++const fs = require('fs');+const pdfBuffer = fs.readFileSync('./contract.pdf');++const result = await createAndSendDocument(+ pdfBuffer,+ 'contract.pdf',+ 'Service Agreement',+ [+ { email: '[email protected]', name: 'John Smith', role: 'SIGNER' },+ { email: '[email protected]', name: 'Jane Doe', role: 'SIGNER' },+ { email: '[email protected]', name: 'Legal Team', role: 'CC' },+ ],+);++console.log('Document sent:', result.envelopeId);+result.recipients.forEach((r) => console.log(`${r.email}: ${r.signingUrl}`));+````+</Tab>+<Tab value="curl">+```bash+#!/bin/bash+set -e++API_TOKEN="YOUR_API_TOKEN"+BASE_URL="https://app.documenso.com/api/v2"+PDF_FILE="./contract.pdf"++# Step 1: Create envelope with recipients and fields+echo "Creating envelope..."+ENVELOPE_RESPONSE=$(curl -s -X POST "${BASE_URL}/envelope/create" \+ -H "Authorization: ${API_TOKEN}" \+ -F 'payload={+ "type": "DOCUMENT",+ "title": "Service Agreement",+ "recipients": [+ {+ "email": "[email protected]",+ "name": "John Smith",+ "role": "SIGNER",+ "signingOrder": 1,+ "fields": [+ {+ "identifier": 0,+ "type": "SIGNATURE",+ "page": 1,+ "positionX": 10,+ "positionY": 80,+ "width": 30,+ "height": 5+ },+ {+ "identifier": 0,+ "type": "DATE",+ "page": 1,+ "positionX": 50,+ "positionY": 80,+ "width": 20,+ "height": 3+ }+ ]+ },+ {+ "email": "[email protected]",+ "name": "Jane Doe",+ "role": "SIGNER",+ "signingOrder": 2,+ "fields": [+ {+ "identifier": 0,+ "type": "SIGNATURE",+ "page": 1,+ "positionX": 10,+ "positionY": 70,+ "width": 30,+ "height": 5+ }+ ]+ }+ ],+ "meta": {+ "subject": "Please sign: Service Agreement",+ "message": "Please review and sign the attached document."+ }+ }' \+ -F "files=@${PDF_FILE};type=application/pdf")++ENVELOPE_ID=$(echo $ENVELOPE_RESPONSE | jq -r '.id')+echo "Created envelope: ${ENVELOPE_ID}"++# Step 2: Distribute (send) the document+echo "Sending document..."+DISTRIBUTE_RESPONSE=$(curl -s -X POST "${BASE_URL}/envelope/distribute" \+ -H "Authorization: ${API_TOKEN}" \+ -H "Content-Type: application/json" \+ -d "{\"envelopeId\": \"${ENVELOPE_ID}\"}")++echo "Document sent!"+echo $DISTRIBUTE_RESPONSE | jq '.recipients[] | {email, signingUrl}'+````++</Tab>+</Tabs>++---++## Workflow 2: Create Document from Template with Custom Data++Use templates for repeatable document workflows. This example creates an employment contract with prefilled data.++{/* prettier-ignore */}+<Steps>+ <Step>+ Fetch the template to get recipient and field IDs+ </Step>+ <Step>+ Map template fields by label and build a <code>prefillFields</code> array+ </Step>+ <Step>+ Call <code>POST /template/use</code> with recipients, prefill data, and{' '}+ <code>distributeDocument: true</code>+ </Step>+</Steps>++<Tabs items={['TypeScript', 'curl']}>+<Tab value="TypeScript">+```typescript+const API_TOKEN = process.env.DOCUMENSO_API_TOKEN;+const BASE_URL = 'https://app.documenso.com/api/v2';++type EmployeeData = {+ email: string;+ name: string;+ position: string;+ salary: number;+ startDate: string; // ISO 8601 format: YYYY-MM-DD+ department: string;+};++type TemplateField = {+ id: number;+ type: string;+ fieldMeta?: { label?: string };+};++type TemplateRecipient = {+ id: number;+ role: string;+ signingOrder: number;+};++async function sendEmploymentContract(+ templateId: number,+ employee: EmployeeData,+): Promise<{ documentId: string; signingUrl: string }> {+ const templateResponse = await fetch(`${BASE_URL}/template/${templateId}`, {+ headers: { Authorization: API_TOKEN },+ });++ if (!templateResponse.ok) {+ throw new Error('Template not found');+ }++ const template = await templateResponse.json();++ const employeeRecipient = template.recipients.find(+ (r: TemplateRecipient) => r.role === 'SIGNER' && r.signingOrder === 1,+ );++ if (!employeeRecipient) {+ throw new Error('Template missing employee recipient');+ }++ const fieldsByLabel = new Map<string, TemplateField>();+ template.fields.forEach((field: TemplateField) => {+ if (field.fieldMeta?.label) {+ fieldsByLabel.set(field.fieldMeta.label.toLowerCase(), field);+ }+ });++ const prefillFields = [];++ const positionField = fieldsByLabel.get('position') || fieldsByLabel.get('job title');+ if (positionField) {+ prefillFields.push({ id: positionField.id, type: 'text', value: employee.position });+ }++ const salaryField = fieldsByLabel.get('salary') || fieldsByLabel.get('compensation');+ if (salaryField) {+ prefillFields.push({+ id: salaryField.id,+ type: 'number',+ value: employee.salary.toString(),+ });+ }++ const startDateField = fieldsByLabel.get('start date');+ if (startDateField) {+ prefillFields.push({+ id: startDateField.id,+ type: 'date',+ value: employee.startDate,+ });+ }++ const departmentField = fieldsByLabel.get('department');+ if (departmentField) {+ prefillFields.push({+ id: departmentField.id,+ type: 'dropdown',+ value: employee.department,+ });+ }++ const createResponse = await fetch(`${BASE_URL}/template/use`, {+ method: 'POST',+ headers: {+ Authorization: API_TOKEN,+ 'Content-Type': 'application/json',+ },+ body: JSON.stringify({+ templateId,+ recipients: [+ { id: employeeRecipient.id, email: employee.email, name: employee.name },+ ],+ prefillFields,+ override: {+ title: `Employment Contract - ${employee.name}`,+ subject: `Your Employment Contract at ${employee.department}`,+ message: `Hi ${employee.name},\n\nPlease review and sign your employment contract for the ${employee.position} position.\n\nStart date: ${employee.startDate}`,+ },+ distributeDocument: true,+ externalId: `emp-${Date.now()}-${employee.email.split('@')[0]}`,+ }),+ });++ if (!createResponse.ok) {+ const error = await createResponse.json();+ throw new Error(`Failed to create document: ${error.message}`);+ }++ const document = await createResponse.json();++ return {+ documentId: document.id,+ signingUrl: document.recipients[0].signingUrl,+ };+}++const result = await sendEmploymentContract(123, {+ email: '[email protected]',+ name: 'Alice Johnson',+ position: 'Senior Engineer',+ salary: 120000,+ startDate: '2025-03-01',+ department: 'Engineering',+});++console.log('Contract sent:', result.documentId);+console.log('Signing URL:', result.signingUrl);+````+</Tab>+<Tab value="curl">+```bash+#!/bin/bash+set -e++API_TOKEN="YOUR_API_TOKEN"+BASE_URL="https://app.documenso.com/api/v2"+TEMPLATE_ID=123++# Variables+EMPLOYEE_EMAIL="[email protected]"+EMPLOYEE_NAME="Alice Johnson"+POSITION="Senior Engineer"+SALARY="120000"+START_DATE="2025-03-01"+DEPARTMENT="Engineering"++# Fetch template to get recipient ID+TEMPLATE=$(curl -s -X GET "${BASE_URL}/template/${TEMPLATE_ID}" \+ -H "Authorization: ${API_TOKEN}")++# Extract first signer recipient ID+RECIPIENT_ID=$(echo $TEMPLATE | jq '.recipients[] | select(.role == "SIGNER" and .signingOrder == 1) | .id')++# Create document from template with prefilled data+RESPONSE=$(curl -s -X POST "${BASE_URL}/template/use" \+ -H "Authorization: ${API_TOKEN}" \+ -H "Content-Type: application/json" \+ -d "{+ \"templateId\": ${TEMPLATE_ID},+ \"recipients\": [+ {+ \"id\": ${RECIPIENT_ID},+ \"email\": \"${EMPLOYEE_EMAIL}\",+ \"name\": \"${EMPLOYEE_NAME}\"+ }+ ],+ \"prefillFields\": [+ {\"id\": 101, \"type\": \"text\", \"value\": \"${POSITION}\"},+ {\"id\": 102, \"type\": \"number\", \"value\": \"${SALARY}\"},+ {\"id\": 103, \"type\": \"date\", \"value\": \"${START_DATE}\"},+ {\"id\": 104, \"type\": \"dropdown\", \"value\": \"${DEPARTMENT}\"}+ ],+ \"override\": {+ \"title\": \"Employment Contract - ${EMPLOYEE_NAME}\",+ \"subject\": \"Your Employment Contract\",+ \"message\": \"Please review and sign your employment contract.\"+ },+ \"distributeDocument\": true,+ \"externalId\": \"emp-$(date +%s)-alice\"+ }")++echo "Document created:"+echo $RESPONSE | jq '{id, signingUrl: .recipients[0].signingUrl}'+````++</Tab>+</Tabs>++---++## Workflow 3: Bulk Send Documents++Send the same document to multiple recipients in parallel. Useful for policy acknowledgments, NDAs, or announcements.++{/* prettier-ignore */}+<Steps>+ <Step>+ Fetch the template and get the signer recipient slot ID+ </Step>+ <Step>+ For each recipient, call <code>POST /template/use</code> with{' '}+ <code>distributeDocument: true</code>+ </Step>+ <Step>+ Process in batches with a short delay to respect rate limits (e.g. 100 requests/minute)+ </Step>+</Steps>++<Tabs items={['TypeScript', 'curl']}>+<Tab value="TypeScript">+```typescript+const API_TOKEN = process.env.DOCUMENSO_API_TOKEN;+const BASE_URL = 'https://app.documenso.com/api/v2';++type BulkRecipient = {+ email: string;+ name: string;+};++type BulkSendResult = {+ successful: Array<{ email: string; envelopeId: string; signingUrl: string }>;+ failed: Array<{ email: string; error: string }>;+};++async function bulkSendFromTemplate(+ templateId: number,+ recipients: BulkRecipient[],+ concurrency = 5,+): Promise<BulkSendResult> {+ const templateResponse = await fetch(`${BASE_URL}/template/${templateId}`, {+ headers: { Authorization: API_TOKEN },+ });++ if (!templateResponse.ok) {+ throw new Error('Template not found');+ }++ const template = await templateResponse.json();+ const signerSlot = template.recipients.find(+ (r: { role: string }) => r.role === 'SIGNER',+ );++ if (!signerSlot) {+ throw new Error('Template has no signer recipient');+ }++ const results: BulkSendResult = { successful: [], failed: [] };++ for (let i = 0; i < recipients.length; i += concurrency) {+ const batch = recipients.slice(i, i + concurrency);++ const batchResults = await Promise.allSettled(+ batch.map(async (recipient) => {+ const response = await fetch(`${BASE_URL}/template/use`, {+ method: 'POST',+ headers: {+ Authorization: API_TOKEN,+ 'Content-Type': 'application/json',+ },+ body: JSON.stringify({+ templateId,+ recipients: [+ { id: signerSlot.id, email: recipient.email, name: recipient.name },+ ],+ distributeDocument: true,+ externalId: `bulk-${Date.now()}-${recipient.email}`,+ }),+ });++ if (!response.ok) {+ const error = await response.json();+ throw new Error(error.message || 'Unknown error');+ }++ const document = await response.json();+ return {+ email: recipient.email,+ envelopeId: document.id,+ signingUrl: document.recipients[0].signingUrl,+ };+ }),+ );++ batchResults.forEach((result, index) => {+ if (result.status === 'fulfilled') {+ results.successful.push(result.value);+ } else {+ results.failed.push({+ email: batch[index].email,+ error: result.reason.message,+ });+ }+ });++ if (i + concurrency < recipients.length) {+ await new Promise((resolve) => setTimeout(resolve, 1000));+ }+ }++ return results;+}++const recipients = [+ { email: '[email protected]', name: 'Employee One' },+ { email: '[email protected]', name: 'Employee Two' },+ { email: '[email protected]', name: 'Employee Three' },+];++const results = await bulkSendFromTemplate(456, recipients);++console.log(`Sent: ${results.successful.length}`);+console.log(`Failed: ${results.failed.length}`);+results.failed.forEach((f) => console.error(`${f.email}: ${f.error}`));+````+</Tab>+<Tab value="curl">+```bash+#!/bin/bash++API_TOKEN="YOUR_API_TOKEN"+BASE_URL="https://app.documenso.com/api/v2"+TEMPLATE_ID=456++# Get signer slot ID from template+SIGNER_ID=$(curl -s -X GET "${BASE_URL}/template/${TEMPLATE_ID}" \+ -H "Authorization: ${API_TOKEN}" | jq '.recipients[] | select(.role == "SIGNER") | .id')++# Recipients to process+RECIPIENTS=(+ "[email protected]:Employee One"+ "[email protected]:Employee Two"+ "[email protected]:Employee Three"+)++# Send to each recipient+for RECIPIENT in "${RECIPIENTS[@]}"; do+ EMAIL=$(echo $RECIPIENT | cut -d: -f1)+ NAME=$(echo $RECIPIENT | cut -d: -f2)++ echo "Sending to ${EMAIL}..."++ RESPONSE=$(curl -s -X POST "${BASE_URL}/template/use" \+ -H "Authorization: ${API_TOKEN}" \+ -H "Content-Type: application/json" \+ -d "{+ \"templateId\": ${TEMPLATE_ID},+ \"recipients\": [{+ \"id\": ${SIGNER_ID},+ \"email\": \"${EMAIL}\",+ \"name\": \"${NAME}\"+ }],+ \"distributeDocument\": true,+ \"externalId\": \"bulk-$(date +%s)-${EMAIL}\"+ }")++ if echo $RESPONSE | jq -e '.id' > /dev/null 2>&1; then+ echo " Success: $(echo $RESPONSE | jq -r '.id')"+ else+ echo " Failed: $(echo $RESPONSE | jq -r '.message')"+ fi++ # Rate limiting delay+ sleep 0.5+done+````++</Tab>+</Tabs>++<Callout type="info">+ The API allows 100 requests per minute. For large batches, implement rate limiting with delays+ between requests to avoid hitting limits.+</Callout>++---++## Workflow 4: Wait for Completion with Webhooks++Set up webhooks to receive real-time notifications when documents are signed or completed.++{/* prettier-ignore */}+<Steps>+ <Step>+ **Create a webhook endpoint**: Implement an HTTP handler that verifies the signature and+ processes events+ </Step>+ <Step>+ **Register the webhook**: Add your endpoint URL and secret in Team Settings → Webhooks+ </Step>+ <Step>+ **Optional: poll as fallback**: For critical workflows, poll envelope status if webhooks are+ unreliable+ </Step>+</Steps>++### Create a Webhook Endpoint++```typescript+// Express.js webhook handler+import express from 'express';++const app = express();+app.use(express.json());++const WEBHOOK_SECRET = process.env.DOCUMENSO_WEBHOOK_SECRET;++type WebhookPayload = {+ event: string;+ payload: {+ id: number;+ externalId: string | null;+ status: string;+ title: string;+ completedAt: string | null;+ Recipient: Array<{+ id: number;+ email: string;+ name: string;+ signingStatus: string;+ signedAt: string | null;+ rejectionReason: string | null;+ }>;+ };+ createdAt: string;+};++app.post('/webhooks/documenso', (req, res) => {+ // Verify webhook signature+ const secret = req.headers['x-documenso-secret'] as string;++ if (secret !== WEBHOOK_SECRET) {+ console.error('Invalid webhook secret');+ return res.status(401).send('Unauthorized');+ }++ const { event, payload } = req.body as WebhookPayload;++ switch (event) {+ case 'DOCUMENT_SENT':+ console.log(`Document ${payload.id} sent to recipients`);+ // Update your database, notify users, etc.+ break;++ case 'DOCUMENT_OPENED':+ const opener = payload.Recipient.find((r) => r.signingStatus === 'NOT_SIGNED');+ console.log(`${opener?.name} opened document ${payload.id}`);+ break;++ case 'DOCUMENT_SIGNED':+ const signer = payload.Recipient.find((r) => r.signingStatus === 'SIGNED' && r.signedAt);+ console.log(`${signer?.name} signed document ${payload.id}`);+ // Trigger next steps in your workflow+ break;++ case 'DOCUMENT_COMPLETED':+ console.log(`Document ${payload.id} completed at ${payload.completedAt}`);+ // All signatures collected - trigger fulfillment+ handleDocumentCompleted(payload);+ break;++ case 'DOCUMENT_REJECTED':+ const rejecter = payload.Recipient.find((r) => r.signingStatus === 'REJECTED');+ console.log(`${rejecter?.name} rejected: ${rejecter?.rejectionReason}`);+ // Handle rejection - notify admin, restart process, etc.+ break;+ }++ // Always respond 200 quickly+ res.status(200).send('OK');+});++async function handleDocumentCompleted(payload: WebhookPayload['payload']) {+ // Example: Update order status, send confirmation, download PDF+ console.log(`Processing completed document: ${payload.externalId || payload.id}`);+ // Your business logic here+}++app.listen(3000, () => console.log('Webhook server running on port 3000'));+```++### Register the Webhook++Register your endpoint in the Documenso dashboard:++{/* prettier-ignore */}+<Steps>+ <Step>+ Go to **Team Settings** → **Webhooks**+ </Step>+ <Step>+ Click **Create Webhook**+ </Step>+ <Step>+ Enter your webhook URL (e.g. <code>https://your-app.com/webhooks/documenso</code>)+ </Step>+ <Step>+ Select which events to subscribe to: <code>DOCUMENT_SENT</code>, <code>DOCUMENT_OPENED</code>,{' '}+ <code>DOCUMENT_SIGNED</code>, <code>DOCUMENT_COMPLETED</code>, <code>DOCUMENT_REJECTED</code>+ </Step>+ <Step>+ Enter your webhook secret (the same value stored in <code>DOCUMENSO_WEBHOOK_SECRET</code>)+ </Step>+ <Step>+ Click **Create Webhook**+ </Step>+</Steps>++See [Webhook Setup](/docs/developers/webhooks/setup) for detailed instructions.++### Poll as Fallback++For critical workflows, implement polling as a fallback in case webhooks fail:++```typescript+async function pollForCompletion(+ envelopeId: string,+ timeoutMs = 86400000, // 24 hours+ intervalMs = 60000, // 1 minute+): Promise<boolean> {+ const startTime = Date.now();++ while (Date.now() - startTime < timeoutMs) {+ const response = await fetch(`${BASE_URL}/envelope/${envelopeId}`, {+ headers: { Authorization: API_TOKEN },+ });++ const envelope = await response.json();++ if (envelope.status === 'COMPLETED') {+ return true;+ }++ if (envelope.status === 'REJECTED') {+ throw new Error('Document was rejected');+ }++ await new Promise((resolve) => setTimeout(resolve, intervalMs));+ }++ return false;+}+```++---++## Workflow 5: Download Signed Documents++After a document is completed, download the signed PDF with all signatures embedded.++{/* prettier-ignore */}+<Steps>+ <Step>+ Get the envelope with <code>GET /envelope/:envelopeId</code> and confirm status is{' '}+ <code>COMPLETED</code>+ </Step>+ <Step>+ Use <code>envelopeItems[0].id</code> and call{' '}+ <code>GET /envelope/item/:itemId/download?version=signed</code>+ </Step>+</Steps>++<Tabs items={['TypeScript', 'curl']}>+<Tab value="TypeScript">+```typescript+const API_TOKEN = process.env.DOCUMENSO_API_TOKEN;+const BASE_URL = 'https://app.documenso.com/api/v2';++type DownloadVersion = 'signed' | 'original';++async function downloadDocument(+ envelopeId: string,+ version: DownloadVersion = 'signed',+): Promise<{ buffer: Buffer; filename: string }> {+ const envelopeResponse = await fetch(`${BASE_URL}/envelope/${envelopeId}`, {+ headers: { Authorization: API_TOKEN },+ });++ if (!envelopeResponse.ok) {+ throw new Error('Envelope not found');+ }++ const envelope = await envelopeResponse.json();++ if (version === 'signed' && envelope.status !== 'COMPLETED') {+ throw new Error('Document must be completed to download signed version');+ }++ const envelopeItem = envelope.envelopeItems[0];+ if (!envelopeItem) {+ throw new Error('No document found in envelope');+ }++ const downloadResponse = await fetch(+ `${BASE_URL}/envelope/item/${envelopeItem.id}/download?version=${version}`,+ { headers: { Authorization: API_TOKEN } },+ );++ if (!downloadResponse.ok) {+ const error = await downloadResponse.json();+ throw new Error(`Download failed: ${error.message}`);+ }++ const buffer = Buffer.from(await downloadResponse.arrayBuffer());+ const filename = `${envelope.title.replace(/[^a-z0-9]/gi, '_')}_${version}.pdf`;++ return { buffer, filename };+}++async function downloadAllCompletedDocuments(outputDir: string): Promise<void> {+ const fs = require('fs');+ const path = require('path');++ let page = 1;+ let hasMore = true;++ while (hasMore) {+ const response = await fetch(+ `${BASE_URL}/envelope?status=COMPLETED&type=DOCUMENT&page=${page}&perPage=50`,+ { headers: { Authorization: API_TOKEN } },+ );++ const { data, pagination } = await response.json();++ for (const envelope of data) {+ try {+ const { buffer, filename } = await downloadDocument(envelope.id, 'signed');+ const filepath = path.join(outputDir, filename);+ fs.writeFileSync(filepath, buffer);+ console.log(`Downloaded: ${filename}`);+ } catch (error) {+ console.error(`Failed to download ${envelope.id}:`, error);+ }+ await new Promise((resolve) => setTimeout(resolve, 500));+ }++ hasMore = page < pagination.totalPages;+ page++;+ }+}++const { buffer, filename } = await downloadDocument('envelope_abc123', 'signed');+require('fs').writeFileSync(`./downloads/${filename}`, buffer);++await downloadAllCompletedDocuments('./downloads');+````+</Tab>+<Tab value="curl">+```bash+#!/bin/bash++API_TOKEN="YOUR_API_TOKEN"+BASE_URL="https://app.documenso.com/api/v2"+ENVELOPE_ID="envelope_abc123"+OUTPUT_DIR="./downloads"++mkdir -p $OUTPUT_DIR++# Get envelope details+ENVELOPE=$(curl -s -X GET "${BASE_URL}/envelope/${ENVELOPE_ID}" \+ -H "Authorization: ${API_TOKEN}")++STATUS=$(echo $ENVELOPE | jq -r '.status')+TITLE=$(echo $ENVELOPE | jq -r '.title')+ITEM_ID=$(echo $ENVELOPE | jq -r '.envelopeItems[0].id')++# Check if completed+if [ "$STATUS" != "COMPLETED" ]; then+ echo "Error: Document status is ${STATUS}, must be COMPLETED to download signed version"+ exit 1+fi++# Download signed document+FILENAME="${TITLE// /_}_signed.pdf"+curl -s -X GET "${BASE_URL}/envelope/item/${ITEM_ID}/download?version=signed" \+ -H "Authorization: ${API_TOKEN}" \+ -o "${OUTPUT_DIR}/${FILENAME}"++echo "Downloaded: ${OUTPUT_DIR}/${FILENAME}"++# Download original (optional)+ORIG_FILENAME="${TITLE// /_}_original.pdf"+curl -s -X GET "${BASE_URL}/envelope/item/${ITEM_ID}/download?version=original" \+ -H "Authorization: ${API_TOKEN}" \+ -o "${OUTPUT_DIR}/${ORIG_FILENAME}"++echo "Downloaded: ${OUTPUT_DIR}/${ORIG_FILENAME}"+````++</Tab>+</Tabs>++<Callout type="warn">+ The signed PDF is only available after all recipients have completed signing (document status is+ `COMPLETED`). Attempting to download before completion returns the original document without+ signatures.+</Callout>++---++## Error Handling Patterns++Implement robust error handling for production integrations.++<Accordions type="multiple">+ <Accordion title="Retry with Exponential Backoff">+ Retry on 429 (rate limit) and 5xx errors with exponential backoff; respect <code>Retry-After</code> when present.++```typescript+type RetryOptions = {+ maxRetries?: number;+ baseDelayMs?: number;+ maxDelayMs?: number;+};++async function fetchWithRetry(+ url: string,+ options: RequestInit,+ retryOptions: RetryOptions = {},+): Promise<Response> {+ const { maxRetries = 3, baseDelayMs = 1000, maxDelayMs = 30000 } = retryOptions;++ let lastError: Error | null = null;++ for (let attempt = 0; attempt <= maxRetries; attempt++) {+ try {+ const response = await fetch(url, options);++ // Retry on rate limit+ if (response.status === 429) {+ const retryAfter = response.headers.get('Retry-After');+ const delay = retryAfter ? parseInt(retryAfter) * 1000 : baseDelayMs * Math.pow(2, attempt);+ console.log(`Rate limited, waiting ${delay}ms...`);+ await new Promise((resolve) => setTimeout(resolve, Math.min(delay, maxDelayMs)));+ continue;+ }++ // Retry on server errors+ if (response.status >= 500) {+ const delay = baseDelayMs * Math.pow(2, attempt);+ console.log(`Server error ${response.status}, retrying in ${delay}ms...`);+ await new Promise((resolve) => setTimeout(resolve, Math.min(delay, maxDelayMs)));+ continue;+ }++ return response;+ } catch (error) {+ lastError = error as Error;+ const delay = baseDelayMs * Math.pow(2, attempt);+ console.log(`Network error, retrying in ${delay}ms...`, error);+ await new Promise((resolve) => setTimeout(resolve, Math.min(delay, maxDelayMs)));+ }+ }++ throw lastError || new Error('Max retries exceeded');+}+```++ </Accordion>+ <Accordion title="Error Response Handling">+ Parse API errors into a typed class and handle by status code (400, 401, 404, 429, etc.).++```typescript+type ApiError = {+ message: string;+ code?: string;+ statusCode: number;+ details?: Record<string, unknown>;+};++class DocumensoApiError extends Error {+ code?: string;+ statusCode: number;+ details?: Record<string, unknown>;++ constructor(error: ApiError) {+ super(error.message);+ this.name = 'DocumensoApiError';+ this.code = error.code;+ this.statusCode = error.statusCode;+ this.details = error.details;+ }+}++async function handleApiResponse<T>(response: Response): Promise<T> {+ if (!response.ok) {+ const error = await response.json();+ throw new DocumensoApiError({+ message: error.message || 'Unknown error',+ code: error.code,+ statusCode: response.status,+ details: error.details,+ });+ }++ return response.json();+}++// Usage with specific error handling+try {+ const response = await fetch(`${BASE_URL}/envelope/create`, {+ method: 'POST',+ headers: { Authorization: API_TOKEN },+ body: formData,+ });++ const envelope = await handleApiResponse<{ id: string }>(response);+ console.log('Created:', envelope.id);+} catch (error) {+ if (error instanceof DocumensoApiError) {+ switch (error.statusCode) {+ case 400:+ console.error('Invalid request:', error.message);+ // Fix request and retry+ break;+ case 401:+ console.error('Authentication failed - check API token');+ break;+ case 404:+ console.error('Resource not found:', error.message);+ break;+ case 429:+ console.error('Rate limited - slow down requests');+ break;+ default:+ console.error('API error:', error.message);+ }+ } else {+ console.error('Network or unknown error:', error);+ }+}+```++ </Accordion>+ <Accordion title="Validation Before API Calls">+ Validate recipients (email, name, role) and PDF (magic bytes, size) before calling the API.++```typescript+function validateRecipients(recipients: Array<{ email: string; name: string; role: string }>) {+ const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;+ const validRoles = ['SIGNER', 'APPROVER', 'CC', 'VIEWER'];++ const errors: string[] = [];++ recipients.forEach((recipient, index) => {+ if (!recipient.email || !emailRegex.test(recipient.email)) {+ errors.push(`Recipient ${index + 1}: Invalid email address`);+ }+ if (!recipient.name || recipient.name.trim().length === 0) {+ errors.push(`Recipient ${index + 1}: Name is required`);+ }+ if (!validRoles.includes(recipient.role)) {+ errors.push(`Recipient ${index + 1}: Invalid role "${recipient.role}"`);+ }+ });++ if (errors.length > 0) {+ throw new Error(`Validation failed:\n${errors.join('\n')}`);+ }+}++function validatePdfFile(buffer: Buffer, maxSizeMb = 10) {+ // Check PDF magic bytes+ const pdfHeader = buffer.slice(0, 5).toString();+ if (pdfHeader !== '%PDF-') {+ throw new Error('File is not a valid PDF');+ }++ // Check file size+ const sizeMb = buffer.length / (1024 * 1024);+ if (sizeMb > maxSizeMb) {+ throw new Error(`File size ${sizeMb.toFixed(2)}MB exceeds limit of ${maxSizeMb}MB`);+ }+}+```++ </Accordion>+</Accordions>++---++## See Also++- [API Reference](https://openapi.documenso.com/) - Full endpoint documentation+- [Documents API](/docs/developers/api/documents) - Document operations+- [Templates API](/docs/developers/api/templates) - Template management+- [Webhooks](/docs/developers/webhooks/setup) - Webhook configuration+- [Webhook Events](/docs/developers/webhooks/events) - Event payload referencediff --git a/apps/docs/content/docs/developers/examples/index.mdx b/apps/docs/content/docs/developers/examples/index.mdxnew file mode 100644index 000000000..bdbcdb0b5--- /dev/null+++ b/apps/docs/content/docs/developers/examples/index.mdx@@ -0,0 +1,12 @@+---+title: Examples+description: Common integration patterns and end-to-end workflows.+---++<Cards>+ <Card+ title="Common Workflows"+ description="End-to-end examples for typical use cases."+ href="/docs/developers/examples/common-workflows"+ />+</Cards>diff --git a/apps/docs/content/docs/developers/examples/meta.json b/apps/docs/content/docs/developers/examples/meta.jsonnew file mode 100644index 000000000..b1b821a6a--- /dev/null+++ b/apps/docs/content/docs/developers/examples/meta.json@@ -0,0 +1,4 @@+{+ "title": "Examples",+ "pages": ["common-workflows"]+}diff --git a/apps/docs/content/docs/developers/getting-started/authentication.mdx b/apps/docs/content/docs/developers/getting-started/authentication.mdxnew file mode 100644index 000000000..40e595d6d--- /dev/null+++ b/apps/docs/content/docs/developers/getting-started/authentication.mdx@@ -0,0 +1,202 @@+---+title: Authentication+description: Generate an API key and authenticate your requests.+---++import { Accordion, Accordions } from 'fumadocs-ui/components/accordion';+import { Callout } from 'fumadocs-ui/components/callout';+import { Step, Steps } from 'fumadocs-ui/components/steps';++## Prerequisites++- A Documenso account (cloud or self-hosted)+- A Documenso account on any plan (Free, Individual, Team, or Enterprise)++<Callout type="info">+ Free accounts include API access with a limit of 5 documents per month. [Upgrade to a paid+ plan](https://documen.so/pricing) for higher limits.+</Callout>++## Create an API Token++{/* prettier-ignore */}+<Steps>+<Step>+### Open settings++- Log in to your Documenso account+- Click your avatar in the top right corner+- Select **Settings** from the dropdown menu++++</Step>++<Step>+### Navigate to the API Tokens tab++Go to **Settings** and open the **API Tokens** tab.++++</Step>++<Step>+### Generate a new token++- Click **Create Token**+- Enter a descriptive name (e.g., `production-backend`, `zapier-integration`)+- Select an expiration period: never expires, 7 days, 1 month, 3 months, 6 months, or 1 year+- Click **Create Token**++</Step>++<Step>+### Copy your token++Your token is displayed once after creation. Copy it immediately and store it securely.++++<Callout type="warn">+ You cannot view the token again after leaving this page. If you lose it, you must create a new+ token.+</Callout>++</Step>+</Steps>++## Using Your Token++Include the token in the `Authorization` header of your HTTP requests.++### cURL++```bash+curl https://app.documenso.com/api/v2/documents \+ -H "Authorization: api_xxxxxxxxxxxxxxxx"+```++### JavaScript / TypeScript++```typescript+const response = await fetch('https://app.documenso.com/api/v2/documents', {+ method: 'GET',+ headers: {+ Authorization: 'api_xxxxxxxxxxxxxxxx',+ },+});++const documents = await response.json();+```++### Using the TypeScript SDK++Documenso provides official SDKs that handle authentication for you:++```typescript+import { Documenso } from '@documenso/sdk-typescript';++const client = new Documenso({+ apiKey: 'api_xxxxxxxxxxxxxxxx',+});++const documents = await client.documents.find();+```++SDKs are available for [TypeScript](https://github.com/documenso/sdk-typescript), [Python](https://github.com/documenso/sdk-python), and [Go](https://github.com/documenso/sdk-go).++## API Base URLs++| Environment | Base URL |+| ----------- | -------------------------------------- |+| Production | `https://app.documenso.com/api/v2` |+| Staging | `https://stg-app.documenso.com/api/v2` |+| Self-hosted | `https://your-domain.com/api/v2` |++<Callout type="info">+ API V1 is deprecated. Use V2 for all new integrations. V1 only works with legacy documents created+ before the envelope system. If you need V1 documentation for migration purposes, see the [V1+ OpenAPI reference](https://app.documenso.com/api/v1/openapi).+</Callout>++<Callout type="info">+ The API is available on all plans, including Free (5 documents per month). [Fair+ Use](/docs/policies/fair-use) applies to all API usage.+</Callout>++## Token Security++API tokens grant full access to your account. Follow these practices to keep them secure:++- **Never commit tokens to version control.** Use environment variables instead.+- **Use descriptive names.** Names like `zapier-prod` or `backend-staging` help you identify token usage.+- **Set expiration dates.** Shorter expiration periods reduce risk if a token is compromised.+- **Rotate tokens regularly.** Create new tokens and revoke old ones periodically.+- **Use separate tokens per integration.** If one is compromised, you only need to revoke that specific token.+- **Revoke unused tokens.** Delete tokens you no longer need from the API Tokens settings page.++### Environment Variables++Store your token in an environment variable rather than hardcoding it:++```bash+# .env (do not commit this file)+DOCUMENSO_API_KEY=api_xxxxxxxxxxxxxxxx+```++```typescript+const client = new Documenso({+ apiKey: process.env.DOCUMENSO_API_KEY,+});+```++## Token Scope++API tokens have full access to your account, including:++- Creating, reading, updating, and deleting documents+- Managing recipients and fields+- Accessing templates+- Managing team resources (if the token owner has team access)++There is currently no way to create tokens with limited scopes or permissions.++## Revoking a Token++To revoke a token:++{/* prettier-ignore */}+<Steps>+ <Step>+ Go to **Settings** > **API Tokens**+ </Step>+ <Step>+ Find the token you want to revoke+ </Step>+ <Step>+ Click the delete icon next to the token+ </Step>+ <Step>+ Confirm the deletion+ </Step>+</Steps>++Revoked tokens stop working immediately. Any integrations using that token will receive `401 Unauthorized` errors.++## Troubleshooting++<Accordions type="multiple">+ <Accordion title="401 Unauthorized — Missing or invalid token">+ Check that you included the token in the `Authorization` header.+ </Accordion>+ <Accordion title="401 Unauthorized — Expired token">Create a new token in settings.</Accordion>+ <Accordion title="403 Forbidden — Token doesn't have access to the resource">+ Ensure you're accessing resources owned by the token's account.+ </Accordion>+</Accordions>++## Next Steps++- [Make your first API call](/docs/developers/getting-started/first-api-call) - Create a document via the API+- [API Reference](/docs/developers/api) - Explore available endpointsdiff --git a/apps/docs/content/docs/developers/getting-started/first-api-call.mdx b/apps/docs/content/docs/developers/getting-started/first-api-call.mdxnew file mode 100644index 000000000..5ae0a6c67--- /dev/null+++ b/apps/docs/content/docs/developers/getting-started/first-api-call.mdx@@ -0,0 +1,519 @@+---+title: First API Call+description: Create and send a document for signing using the Documenso API, from uploading a PDF to adding recipients and distributing for signature.+---++import { Callout } from 'fumadocs-ui/components/callout';+import { Step, Steps } from 'fumadocs-ui/components/steps';+import { Tab, Tabs } from 'fumadocs-ui/components/tabs';++## Prerequisites++Before starting, you need:++- A Documenso account (cloud or self-hosted)+- An API token ([create one in team settings](/docs/developers/getting-started/authentication))+- A PDF file to send for signing++<Callout type="warn">+ API tokens have full access to your account. Store them securely and never commit them to version+ control.+</Callout>++## Limitations++The API cannot:++- Sign documents on behalf of recipients (recipients must sign themselves)+- Convert non-PDF files to PDF (you must upload PDFs)+- Retrieve the signed PDF until all recipients have completed signing++## Base URL++All API requests use the following base URLs:++| Environment | Base URL |+| ----------- | -------------------------------------- |+| Production | `https://app.documenso.com/api/v2` |+| Staging | `https://stg-app.documenso.com/api/v2` |++## Example 1: List Your Documents++Start with a simple GET request to verify your API token works.++<Tabs items={['curl', 'JavaScript']}>+<Tab value="curl">+```bash+curl -X GET "https://app.documenso.com/api/v2/envelope" \+ -H "Authorization: YOUR_API_TOKEN"+```+</Tab>+<Tab value="JavaScript">+```javascript+const response = await fetch('https://app.documenso.com/api/v2/envelope', {+ method: 'GET',+ headers: {+ 'Authorization': 'YOUR_API_TOKEN',+ },+});++const data = await response.json();+console.log(data);++````+</Tab>+</Tabs>++A successful response returns a list of your documents (envelopes):++```json+{+ "data": [+ {+ "id": "envelope_abc123",+ "status": "DRAFT",+ "title": "Contract Agreement",+ "createdAt": "2025-01-15T10:30:00.000Z"+ }+ ],+ "pagination": {+ "page": 1,+ "perPage": 10,+ "totalPages": 1,+ "totalItems": 1+ }+}+````++If you receive a `401 Unauthorized` error, verify your API token is correct and includes the `api_` prefix.++## Example 2: Create a Document with Recipient and Signature Field++The V2 API uses a single endpoint to create a document with recipients and fields in one request. This is the most common pattern for sending documents.++<Tabs items={['curl', 'JavaScript']}>+<Tab value="curl">+```bash+curl -X POST "https://app.documenso.com/api/v2/envelope/create" \+ -H "Authorization: YOUR_API_TOKEN" \+ -H "Content-Type: multipart/form-data" \+ -F 'payload={+ "type": "DOCUMENT",+ "title": "Service Agreement",+ "recipients": [+ {+ "email": "[email protected]",+ "name": "John Smith",+ "role": "SIGNER",+ "fields": [+ {+ "identifier": 0,+ "type": "SIGNATURE",+ "page": 1,+ "positionX": 10,+ "positionY": 80,+ "width": 30,+ "height": 5+ },+ {+ "identifier": 0,+ "type": "DATE",+ "page": 1,+ "positionX": 50,+ "positionY": 80,+ "width": 20,+ "height": 3+ }+ ]+ }+ ]+ }' \+ -F "files=@./contract.pdf;type=application/pdf"+```+</Tab>+<Tab value="JavaScript">+```javascript+const fs = require('fs');+const FormData = require('form-data');++const form = new FormData();++const payload = {+ type: 'DOCUMENT',+ title: 'Service Agreement',+ recipients: [+ {+ email: '[email protected]',+ name: 'John Smith',+ role: 'SIGNER',+ fields: [+ {+ identifier: 0,+ type: 'SIGNATURE',+ page: 1,+ positionX: 10,+ positionY: 80,+ width: 30,+ height: 5,+ },+ {+ identifier: 0,+ type: 'DATE',+ page: 1,+ positionX: 50,+ positionY: 80,+ width: 20,+ height: 3,+ },+ ],+ },+ ],+};++form.append('payload', JSON.stringify(payload));+form.append('files', fs.createReadStream('./contract.pdf'), {+ contentType: 'application/pdf',+});++const response = await fetch('https://app.documenso.com/api/v2/envelope/create', {+ method: 'POST',+ headers: {+ Authorization: 'YOUR_API_TOKEN',+ },+ body: form,+});++const data = await response.json();+console.log('Created envelope:', data.id);+````+</Tab>+</Tabs>++### Understanding Field Positioning++Field positions use percentage values (0-100) relative to the PDF page dimensions:++| Parameter | Description |+| --------- | ----------- |+| `positionX` | Horizontal position from left edge (0 = left, 100 = right) |+| `positionY` | Vertical position from top edge (0 = top, 100 = bottom) |+| `width` | Field width as percentage of page width |+| `height` | Field height as percentage of page height |+| `page` | Page number (1-indexed) |+| `identifier` | Index of the file (0 for first file, 1 for second, etc.) |++<Callout type="info">+ To place a signature near the bottom-left of the page, use `positionX: 10` and `positionY: 80`.+</Callout>++### Recipient Roles++| Role | Description |+| ---- | ----------- |+| `SIGNER` | Must sign the document |+| `APPROVER` | Must approve before signers can sign |+| `CC` | Receives a copy but doesn't sign |+| `VIEWER` | Can view the document but takes no action |++<Callout type="info">+ See the [recipient roles](/docs/concepts/recipient-roles) page for more information.+</Callout>++## Example 3: Send the Document for Signing++After creating a document, it's in `DRAFT` status. To send it to recipients, use the distribute endpoint:++<Tabs items={['curl', 'JavaScript']}>+<Tab value="curl">+```bash+curl -X POST "https://app.documenso.com/api/v2/envelope/envelope_abc123/distribute" \+ -H "Authorization: YOUR_API_TOKEN" \+ -H "Content-Type: application/json"+````++</Tab>+<Tab value="JavaScript">+```javascript+const envelopeId = 'envelope_abc123';++const response = await fetch(+ `https://app.documenso.com/api/v2/envelope/${envelopeId}/distribute`,+ {+ method: 'POST',+ headers: {+ Authorization: 'YOUR_API_TOKEN',+ 'Content-Type': 'application/json',+ },+ },+);++const data = await response.json();+console.log('Document sent:', data);+````+</Tab>+</Tabs>++After distribution, recipients receive an email with a link to sign the document. The document status changes from `DRAFT` to `PENDING`.++## Full Workflow Example++Here's a complete script that creates and sends a document:++<Tabs items={['JavaScript', 'curl']}>+<Tab value="JavaScript">+```javascript+const fs = require('fs');+const FormData = require('form-data');++const API_TOKEN = process.env.DOCUMENSO_API_TOKEN;+const BASE_URL = 'https://app.documenso.com/api/v2';++async function createAndSendDocument(pdfPath, recipientEmail, recipientName) {+ // Step 1: Create the envelope with recipient and fields+ const form = new FormData();++ const payload = {+ type: 'DOCUMENT',+ title: 'Service Agreement',+ recipients: [+ {+ email: recipientEmail,+ name: recipientName,+ role: 'SIGNER',+ fields: [+ {+ identifier: 0,+ type: 'SIGNATURE',+ page: 1,+ positionX: 10,+ positionY: 80,+ width: 30,+ height: 5,+ },+ {+ identifier: 0,+ type: 'NAME',+ page: 1,+ positionX: 10,+ positionY: 75,+ width: 30,+ height: 3,+ },+ {+ identifier: 0,+ type: 'DATE',+ page: 1,+ positionX: 50,+ positionY: 80,+ width: 20,+ height: 3,+ },+ ],+ },+ ],+ };++ form.append('payload', JSON.stringify(payload));+ form.append('files', fs.createReadStream(pdfPath), {+ contentType: 'application/pdf',+ });++ const createResponse = await fetch(`${BASE_URL}/envelope/create`, {+ method: 'POST',+ headers: {+ 'Authorization': API_TOKEN,+ },+ body: form,+ });++ if (!createResponse.ok) {+ const error = await createResponse.json();+ throw new Error(`Failed to create envelope: ${JSON.stringify(error)}`);+ }++ const envelope = await createResponse.json();+ console.log('Created envelope:', envelope.id);++ // Step 2: Send the document for signing+ const distributeResponse = await fetch(+ `${BASE_URL}/envelope/${envelope.id}/distribute`,+ {+ method: 'POST',+ headers: {+ 'Authorization': API_TOKEN,+ 'Content-Type': 'application/json',+ },+ }+ );++ if (!distributeResponse.ok) {+ const error = await distributeResponse.json();+ throw new Error(`Failed to distribute envelope: ${JSON.stringify(error)}`);+ }++ console.log('Document sent for signing!');+ return envelope.id;+}++// Usage+createAndSendDocument(+ './contract.pdf',+ '[email protected]',+ 'John Smith'+).catch(console.error);+````++</Tab>+<Tab value="curl">+```bash+#!/bin/bash+set -e++API_TOKEN="YOUR_API_TOKEN"+BASE_URL="https://app.documenso.com/api/v2"+PDF_FILE="./contract.pdf"+RECIPIENT_EMAIL="[email protected]"+RECIPIENT_NAME="John Smith"++# Step 1: Create the envelope with recipient and fields++echo "Creating envelope..."+ENVELOPE_RESPONSE=$(curl -s -X POST "${BASE_URL}/envelope/create" \+ -H "Authorization: ${API_TOKEN}" \+ -H "Content-Type: multipart/form-data" \+ -F "payload={+ \"type\": \"DOCUMENT\",+ \"title\": \"Service Agreement\",+ \"recipients\": [+ {+ \"email\": \"${RECIPIENT_EMAIL}\",+ \"name\": \"${RECIPIENT_NAME}\",+ \"role\": \"SIGNER\",+ \"fields\": [+ {+ \"identifier\": 0,+ \"type\": \"SIGNATURE\",+ \"page\": 1,+ \"positionX\": 10,+ \"positionY\": 80,+ \"width\": 30,+ \"height\": 5+ },+ {+ \"identifier\": 0,+ \"type\": \"DATE\",+ \"page\": 1,+ \"positionX\": 50,+ \"positionY\": 80,+ \"width\": 20,+ \"height\": 3+ }+ ]+ }+ ]+ }" \+ -F "files=@${PDF_FILE};type=application/pdf")++ENVELOPE_ID=$(echo $ENVELOPE_RESPONSE | jq -r '.id')+echo "Created envelope: ${ENVELOPE_ID}"++# Step 2: Send the document for signing++echo "Sending document..."+curl -s -X POST "${BASE_URL}/envelope/${ENVELOPE_ID}/distribute" \+ -H "Authorization: ${API_TOKEN}" \+ -H "Content-Type: application/json"++echo "Document sent for signing!"++````+</Tab>+</Tabs>++## Error Handling++The API returns standard HTTP status codes and JSON error responses:++| Status Code | Meaning |+| ----------- | ------- |+| `400` | Bad request - check your request payload |+| `401` | Unauthorized - invalid or missing API token |+| `404` | Not found - resource doesn't exist |+| `429` | Rate limited - wait 60 seconds and retry |+| `500` | Server error - retry or contact support |++### Error Response Format++```json+{+ "error": "Description of what went wrong",+ "code": "ERROR_CODE",+ "statusCode": 400+}+````++### Common Errors++**Invalid file type:**++```json+{+ "error": "Invalid file type. Only PDF files are supported.",+ "statusCode": 400+}+```++**Missing required field:**++```json+{+ "error": "Recipient email is required",+ "statusCode": 400+}+```++**Envelope not found:**++```json+{+ "error": "Envelope not found",+ "statusCode": 404+}+```++### Handling Rate Limits++The API allows 100 requests per minute per IP address. When rate limited, wait at least 60 seconds before retrying:++```javascript+async function fetchWithRetry(url, options, maxRetries = 3) {+ for (let attempt = 0; attempt < maxRetries; attempt++) {+ const response = await fetch(url, options);++ if (response.status === 429) {+ console.log('Rate limited, waiting 60 seconds...');+ await new Promise((resolve) => setTimeout(resolve, 60000));+ continue;+ }++ return response;+ }++ throw new Error('Max retries exceeded');+}+```++## Next Steps++- [API Reference](https://openapi.documenso.com/) - Full endpoint documentation with request/response schemas+- [Webhooks](/docs/developers/webhooks/setup) - Get notified when documents are signed+- [Templates](/docs/developers/api/templates) - Create reusable document templates+- [SDKs](#official-sdks) - Use typed client libraries++### Official SDKs++For production applications, consider using the official SDKs:++- [TypeScript SDK](https://github.com/documenso/sdk-typescript)+- [Python SDK](https://github.com/documenso/sdk-python)+- [Go SDK](https://github.com/documenso/sdk-go)diff --git a/apps/docs/content/docs/developers/getting-started/index.mdx b/apps/docs/content/docs/developers/getting-started/index.mdxnew file mode 100644index 000000000..d2070f2b5--- /dev/null+++ b/apps/docs/content/docs/developers/getting-started/index.mdx@@ -0,0 +1,17 @@+---+title: Getting Started+description: Get your API key and make your first API call.+---++<Cards>+ <Card+ title="Authentication"+ description="Generate an API key and authenticate your requests."+ href="/docs/developers/getting-started/authentication"+ />+ <Card+ title="First API Call"+ description="Create your first document via the API."+ href="/docs/developers/getting-started/first-api-call"+ />+</Cards>diff --git a/apps/docs/content/docs/developers/getting-started/meta.json b/apps/docs/content/docs/developers/getting-started/meta.jsonnew file mode 100644index 000000000..1a8ae8c12--- /dev/null+++ b/apps/docs/content/docs/developers/getting-started/meta.json@@ -0,0 +1,4 @@+{+ "title": "Getting Started",+ "pages": ["authentication", "first-api-call"]+}diff --git a/apps/docs/content/docs/developers/index.mdx b/apps/docs/content/docs/developers/index.mdxnew file mode 100644index 000000000..541a0f5be--- /dev/null+++ b/apps/docs/content/docs/developers/index.mdx@@ -0,0 +1,87 @@+---+title: Developer Guide+description: Integrate Documenso into your applications using the REST API, webhooks, and embedding options.+---++## Getting Started++<Cards>+ <Card+ title="Authentication"+ description="Get your API key and authenticate requests."+ href="/docs/developers/getting-started/authentication"+ />+ <Card+ title="First API Call"+ description="Create and send your first document via the API."+ href="/docs/developers/getting-started/first-api-call"+ />+</Cards>++---++## Integration Options++<Cards>+ <Card+ title="API Reference"+ description="Documents, recipients, fields, templates, and teams."+ href="/docs/developers/api"+ />+ <Card+ title="Webhooks"+ description="Receive notifications when documents are signed or updated."+ href="/docs/developers/webhooks"+ />+ <Card+ title="Embedding"+ description="Embed signing experiences using direct links or React."+ href="/docs/developers/embedding"+ />+ <Card+ title="Examples"+ description="Common integration patterns and workflows."+ href="/docs/developers/examples"+ />+</Cards>++---++## API Base URL++```+https://app.documenso.com/api/v2+```++For self-hosted instances, replace with your instance URL:++```+https://your-instance.com/api/v2+```++---++## SDKs++Official SDKs are available for multiple languages:++- [TypeScript SDK](https://github.com/documenso/sdk-typescript)+- [Python SDK](https://github.com/documenso/sdk-python)+- [Go SDK](https://github.com/documenso/sdk-go)++---++## Looking for Something Else?++<Cards>+ <Card+ title="User Guide"+ description="Send documents using the web application."+ href="/docs/users"+ />+ <Card+ title="Self-Hosting"+ description="Deploy your own Documenso instance."+ href="/docs/self-hosting"+ />+</Cards>diff --git a/apps/docs/content/docs/developers/local-development/gitpod.mdx b/apps/docs/content/docs/developers/local-development/gitpod.mdxnew file mode 100644index 000000000..a41bc65de--- /dev/null+++ b/apps/docs/content/docs/developers/local-development/gitpod.mdx@@ -0,0 +1,13 @@+---+title: Run in Gitpod+description: Get started with Documenso in a ready-to-use Gitpod workspace in your browser.+---++Click below to launch a ready-to-use Gitpod workspace in your browser.++[](https://gitpod.io/#https://github.com/documenso/documenso)++## See Also++- [Developer Quickstart](/docs/developers/local-development/quickstart) - Local Docker-based setup+- [Manual Setup](/docs/developers/local-development/manual) - Manual setup without Dockerdiff --git a/apps/docs/content/docs/developers/local-development/index.mdx b/apps/docs/content/docs/developers/local-development/index.mdxnew file mode 100644index 000000000..5714a018b--- /dev/null+++ b/apps/docs/content/docs/developers/local-development/index.mdx@@ -0,0 +1,66 @@+---+title: Local Development+description: Learn how to set up Documenso for local development.+---++## Overview++There are multiple ways of setting up Documenso for local development. At the moment of writing this documentation, there are 3 ways of running Documenso locally:++- [Using the developer quickstart with Docker](/docs/developers/local-development/quickstart)+- [Manually setting up the development environment](/docs/developers/local-development/manual)+- [Using Gitpod](/docs/developers/local-development/gitpod)++Pick the one that fits your needs the best.++## Tech Stack++- [Typescript](https://www.typescriptlang.org/) - Language+- [React Router](https://reactrouter.com/) - Framework+- [Prisma](https://www.prisma.io/) - ORM+- [Tailwind](https://tailwindcss.com/) - CSS+- [shadcn/ui](https://ui.shadcn.com/) - Component Library+- [react-email](https://react.email/) - Email Templates+- [tRPC](https://trpc.io/) - API+- [@documenso/pdf-sign](https://www.npmjs.com/package/@documenso/pdf-sign) - PDF Signatures+- [React-PDF](https://github.com/wojtekmaj/react-pdf) - Viewing PDFs+- [PDF-Lib](https://github.com/Hopding/pdf-lib) - PDF manipulation+- [Stripe](https://stripe.com/) - Payments++<div className="mt-16 flex items-center justify-center gap-4">+ <a href="https://documen.so/discord">+ <img+ src="https://img.shields.io/badge/Discord-documen.so/discord-%235865F2"+ alt="Join Documenso on Discord"+ />+ </a>+ <a href="https://github.com/documenso/documenso/stargazers">+ <img src="https://img.shields.io/github/stars/documenso/documenso" alt="Github Stars" />+ </a>+ <a href="https://github.com/documenso/documenso/blob/main/LICENSE">+ <img src="https://img.shields.io/badge/license-AGPLv3-purple" alt="License" />+ </a>+ <a href="https://github.com/documenso/documenso/pulse">+ <img+ src="https://img.shields.io/github/commit-activity/m/documenso/documenso"+ alt="Commits-per-month"+ />+ </a>+ <a href="https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/documenso/documenso">+ <img+ alt="open in devcontainer"+ src="https://img.shields.io/static/v1?label=Dev%20Containers&message=Enabled&color=blue&logo=visualstudiocode"+ />+ </a>+ <a href="https://github.com/documenso/documenso/blob/main/CODE_OF_CONDUCT.md">+ <img+ src="https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg"+ alt="Contributor Covenant"+ />+ </a>+</div>++## See Also++- [Contributing](/docs/developers/contributing) - Learn how to contribute to Documenso+- [Self-Hosting](/docs/self-hosting) - Deploy your own instancediff --git a/apps/docs/content/docs/developers/local-development/manual.mdx b/apps/docs/content/docs/developers/local-development/manual.mdxnew file mode 100644index 000000000..86ec490af--- /dev/null+++ b/apps/docs/content/docs/developers/local-development/manual.mdx@@ -0,0 +1,111 @@+---+title: Manual Setup+description: Manually set up Documenso on your machine for local development.+---++import { Callout } from 'fumadocs-ui/components/callout';+import { Step, Steps } from 'fumadocs-ui/components/steps';++# Manual Setup++Follow these steps to set up Documenso on your local machine:++{/* prettier-ignore */}+<Steps>++<Step>+### Fork Documenso++Fork the [Documenso repository](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/about-forks) to your GitHub account.++</Step>++<Step>+### Clone repository++After forking the repository, clone it to your local device by using the following command:++```bash+git clone https://github.com/<your-username>/documenso+```++</Step>++<Step>+### Install dependencies++Run `npm i` in the root directory to install the dependencies required for the project.++</Step>++<Step>+### Set up environment variables++Set up the following environment variables in the `.env` file:++```bash+NEXTAUTH_SECRET+NEXT_PUBLIC_WEBAPP_URL+NEXT_PRIVATE_DATABASE_URL+NEXT_PRIVATE_DIRECT_DATABASE_URL+NEXT_PRIVATE_SMTP_FROM_NAME+NEXT_PRIVATE_SMTP_FROM_ADDRESS+```++Alternatively, you can run `cp .env.example .env` to get started with our handpicked defaults.++<Callout type="info">+ See the [Environment Variables](/docs/self-hosting/configuration/environment) page for more+ information.+</Callout>++</Step>++<Step>+### Create database schema++Create the database schema by running the following command:++```bash+npm run prisma:migrate-dev+```++</Step>++<Step>+### Optional: seed the database++Seed the database with test data by running the following command:++```bash+npm run prisma:seed -w @documenso/prisma+```++</Step>++<Step>+### Start the application++Run `npm run dev` in the root directory to start the application.++</Step>++<Step>+### Access the application++Access the Documenso application by visiting `http://localhost:3000` in your web browser.++</Step>++</Steps>++<Callout type="info">+ Optional: Create your signing certificate. To generate your own using these steps and a Linux+ Terminal or Windows Subsystem for Linux (WSL), see **[Create your signing+ certificate](/docs/developers/local-development/signing-certificate)**.+</Callout>++## See Also++- [Developer Quickstart](/docs/developers/local-development/quickstart) - Quick Docker-based setup+- [Signing Certificate](/docs/developers/local-development/signing-certificate) - Create a signing certificatediff --git a/apps/docs/content/docs/developers/local-development/meta.json b/apps/docs/content/docs/developers/local-development/meta.jsonnew file mode 100644index 000000000..e11f72bad--- /dev/null+++ b/apps/docs/content/docs/developers/local-development/meta.json@@ -0,0 +1,4 @@+{+ "title": "Local Development",+ "pages": ["quickstart", "manual", "signing-certificate", "translations", "gitpod"]+}diff --git a/apps/docs/content/docs/developers/local-development/quickstart.mdx b/apps/docs/content/docs/developers/local-development/quickstart.mdxnew file mode 100644index 000000000..705a452ca--- /dev/null+++ b/apps/docs/content/docs/developers/local-development/quickstart.mdx@@ -0,0 +1,91 @@+---+title: Developer Quickstart+description: Quickly set up Documenso on your machine for local development with Docker and Docker Compose.+---++import { Callout } from 'fumadocs-ui/components/callout';+import { Step, Steps } from 'fumadocs-ui/components/steps';++## Quickstart++<Callout type="info">+ **Note**: This guide assumes that you have both [docker](https://docs.docker.com/get-docker/) and+ [docker-compose](https://docs.docker.com/compose/) installed on your machine.+</Callout>++Want to get up and running quickly? Follow these steps:++{/* prettier-ignore */}+<Steps>++<Step>+### Fork Documenso++Fork the [Documenso repository](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/about-forks) to your GitHub account.++</Step>++<Step>+### Clone repository++After forking the repository, clone it to your local device by using the following command:++```bash+git clone https://github.com/<your-username>/documenso+```++</Step>++<Step>+### Set up environment variables++Set up your environment variables in the `.env` file using the `.env.example` file as a reference.++Alternatively, you can run `cp .env.example .env` to get started with our handpicked defaults.++</Step>++<Step>+### Start database and mail server++Run `npm run dx` in the root directory.++This will spin up a Postgres database and inbucket mailserver in a docker container.++</Step>++<Step>+### Start the application++Run `npm run dev` in the root directory to start the application.++</Step>++<Step>+### (Optional) Fasten the Process++Want it even faster? Just use:++```sh+npm run d+```++</Step>++</Steps>++### Access Points for the Project++You can access the following services:++- Main application - http://localhost:3000+- Incoming Mail Access - http://localhost:9000+- Database Connection Details:+ - Port: 54320+ - Connection: Use your favorite database client to connect to the database.+- S3 Storage Dashboard - http://localhost:9001++## See Also++- [Manual Setup](/docs/developers/local-development/manual) - Set up without Docker+- [Signing Certificate](/docs/developers/local-development/signing-certificate) - Create a certificate for local developmentdiff --git a/apps/docs/content/docs/developers/local-development/signing-certificate.mdx b/apps/docs/content/docs/developers/local-development/signing-certificate.mdxnew file mode 100644index 000000000..308489015--- /dev/null+++ b/apps/docs/content/docs/developers/local-development/signing-certificate.mdx@@ -0,0 +1,92 @@+---+title: Signing Certificate+description: Learn how to create a free, self-signed certificate for local development.+---++import { Callout } from 'fumadocs-ui/components/callout';+import { Step, Steps } from 'fumadocs-ui/components/steps';++# Create Your Signing Certificate++Digitally signing documents requires a signing certificate in `.p12` format. You can either purchase one or create a free self-signed certificate.++Follow the steps below to create a free, self-signed certificate for local development.++<Callout type="warn">+ These steps should be run on a UNIX based system, otherwise you may run into an error.+</Callout>++{/* prettier-ignore */}+<Steps>++<Step>+### Generate private key++Generate a private key using OpenSSL by running the following command:++```bash+openssl genrsa -out private.key 2048+```++This command generates a 2048-bit RSA key.++</Step>++<Step>+### Generate self-signed certificate++Using the private key, generate a self-signed certificate by running the following command:++```bash+openssl req -new -x509 -key private.key -out certificate.crt -days 365+```++You will be prompted to enter some information, such as the certificate's Common Name (CN). Ensure that you provide the correct details. The `—days` parameter specifies the certificate's validity period.++</Step>++<Step>+### Create `p12` certificate++Combine the private key and the self-signed certificate to create a `.p12` certificate. Use the following command:++```bash+openssl pkcs12 -export -out certificate.p12 -inkey private.key -in certificate.crt -legacy+```++<Callout type="warn">+When running the application in Docker, you may encounter permission issues when attempting to sign documents using your certificate (.p12) file. This happens because the application runs as a non-root user inside the container and needs read access to the certificate.++To resolve this, you'll need to update the certificate file permissions to allow the container user 1001, which runs NextJS, to read it:++```bash+sudo chown 1001 certificate.p12+```++</Callout>+</Step>++<Step>+### `p12` certificate password++When you create the `.p12` certificate, you will be prompted to enter a password. Enter a strong password and keep it secure. Remember this password, as it will be required when using the certificate.++Note that for local development, the password can be left empty.++</Step>++<Step>+### Add certificate to the project++Use the `NEXT_PRIVATE_SIGNING_LOCAL_FILE_PATH` environment variable to point at the certificate you created.++Details about environment variables associated with certificates can be found [here](/docs/self-hosting/configuration/signing-certificate).++</Step>++</Steps>++## See Also++- [Signing Certificates (Self-Hosting)](/docs/self-hosting/configuration/signing-certificate) - Production certificate configuration+- [Signing Certificates (Concepts)](/docs/concepts/signing-certificates) - How digital signing worksdiff --git a/apps/docs/content/docs/developers/local-development/translations.mdx b/apps/docs/content/docs/developers/local-development/translations.mdxnew file mode 100644index 000000000..bda9a5a39--- /dev/null+++ b/apps/docs/content/docs/developers/local-development/translations.mdx@@ -0,0 +1,93 @@+---+title: Translations+description: Handling translations in code.+---++## Overview++Documenso uses the following stack to handle translations:++- [Lingui](https://lingui.dev/) - React i10n library+- [Crowdin](https://crowdin.com/) - Handles syncing translations+- [OpenAI](https://openai.com/) - Provides AI translations++Additional reading can be found in the [Lingui documentation](https://lingui.dev/introduction).++## Quick Guide++If you require more in-depth information, please see the [Lingui documentation](https://lingui.dev/introduction).++### HTML++Wrap all text to translate in **`<Trans></Trans>`** tags exported from **@lingui/react/macro**.++```html+<h1>+ <Trans>Title</Trans>+</h1>+```++For text that is broken into elements, but represent a whole sentence, you must wrap it in a Trans tag so ensure the full message is extracted correctly.++```html+<h1>+ <Trans>+ This is one+ <span className="text-foreground/60">full</span>+ <a href="https://documenso.com">sentence</a>+ </Trans>+</h1>+```++### Constants outside of react components++```tsx+import { msg } from '@lingui/core/macro';+import { useLingui } from '@lingui/react';+import { Trans } from '@lingui/react/macro';++// Wrap text in msg`text to translate` when it's in a constant here, or another file/package.+export const CONSTANT_WITH_MSG = {+ foo: msg`Hello`,+ bar: msg`World`,+};++export const SomeComponent = () => {+ const { _ } = useLingui();++ return (+ <div>+ {/* This will render the correct translated text. */}+ <p>{_(CONSTANT_WITH_MSG.foo)}</p>+ </div>+ );+};+```++### Plurals++Lingui provides a Plural component to make it easy. See full documentation [here.](https://lingui.dev/ref/macro#plural-1)++```tsx+// Basic usage.+<Plural one="1 Recipient" other="# Recipients" value={recipients.length} />+```++### Dates++Lingui provides a [DateTime instance](https://lingui.dev/ref/core#i18n.date) with the configured locale.++```tsx+import { Trans } from '@lingui/macro';+import { useLingui } from '@lingui/react';++export const SomeComponent = () => {+ const { i18n } = useLingui();++ return <Trans>The current date is {i18n.date(new Date(), { dateStyle: 'short' })}</Trans>;+};+```++## See Also++- [Contributing Translations](/docs/developers/contributing/contributing-translations) - Help translate Documensodiff --git a/apps/docs/content/docs/developers/meta.json b/apps/docs/content/docs/developers/meta.jsonnew file mode 100644index 000000000..b47b46319--- /dev/null+++ b/apps/docs/content/docs/developers/meta.json@@ -0,0 +1,15 @@+{+ "title": "Developers",+ "description": "Integrate with Documenso",+ "root": true,+ "pages": [+ "getting-started",+ "api",+ "webhooks",+ "embedding",+ "examples",+ "local-development",+ "contributing",+ "demo-environment"+ ]+}diff --git a/apps/docs/content/docs/developers/webhooks/events.mdx b/apps/docs/content/docs/developers/webhooks/events.mdxnew file mode 100644index 000000000..038c1d695--- /dev/null+++ b/apps/docs/content/docs/developers/webhooks/events.mdx@@ -0,0 +1,679 @@+---+title: Webhook Events+description: Reference for all webhook event types and payloads.+---++import { Step, Steps } from 'fumadocs-ui/components/steps';++## Event Payload Structure++All webhook events share a common structure:++```json+{+ "event": "DOCUMENT_COMPLETED",+ "payload": {+ // Document data with recipients+ },+ "createdAt": "2024-04-22T11:52:18.277Z",+ "webhookEndpoint": "https://your-endpoint.com/webhook"+}+```++### Top-Level Fields++| Field | Type | Description |+| ----------------- | -------- | ------------------------------------------------ |+| `event` | string | Event type identifier (e.g., `DOCUMENT_CREATED`) |+| `payload` | object | Document object with metadata and recipients |+| `createdAt` | datetime | When the webhook event was created |+| `webhookEndpoint` | string | The URL receiving this webhook |++### Payload Fields++| Field | Type | Description |+| ---------------- | --------- | ------------------------------------------------------ |+| `id` | number | Document ID |+| `externalId` | string? | External identifier for integration |+| `userId` | number | Owner's user ID |+| `authOptions` | object? | Document-level authentication options |+| `formValues` | object? | PDF form values associated with the document |+| `title` | string | Document title |+| `status` | string | Current status: `DRAFT`, `PENDING`, `COMPLETED` |+| `documentDataId` | string | Reference to the document's PDF data |+| `visibility` | string | Document visibility setting |+| `createdAt` | datetime | Document creation timestamp |+| `updatedAt` | datetime | Last modification timestamp |+| `completedAt` | datetime? | Completion timestamp (when all recipients have signed) |+| `deletedAt` | datetime? | Deletion timestamp |+| `teamId` | number? | Team ID if document belongs to a team |+| `templateId` | number? | Template ID if created from a template |+| `source` | string | Source: `DOCUMENT` or `TEMPLATE` |+| `documentMeta` | object | Document metadata (subject, message, signing options) |+| `Recipient` | array | List of recipient objects |++### Document Metadata Fields++| Field | Type | Description |+| ----------------------- | ------- | --------------------------------------- |+| `id` | string | Metadata record identifier |+| `subject` | string? | Email subject line |+| `message` | string? | Email message body |+| `timezone` | string | Timezone for date display |+| `password` | string? | Document access password (if set) |+| `dateFormat` | string | Date format string |+| `redirectUrl` | string? | URL to redirect after signing |+| `signingOrder` | string | `PARALLEL` or `SEQUENTIAL` |+| `typedSignatureEnabled` | boolean | Whether typed signatures are allowed |+| `language` | string | Document language code |+| `distributionMethod` | string | How document is distributed |+| `emailSettings` | object? | Custom email settings for this document |++### Recipient Fields++| Field | Type | Description |+| ------------------- | --------- | ------------------------------------------ |+| `id` | number | Recipient ID |+| `documentId` | number | Parent document ID |+| `templateId` | number? | Template ID if created from a template |+| `email` | string | Recipient email address |+| `name` | string | Recipient name |+| `token` | string | Unique signing token |+| `documentDeletedAt` | datetime? | When the document was deleted (if deleted) |+| `expired` | boolean? | Whether the recipient's link has expired |+| `signedAt` | datetime? | When recipient signed |+| `authOptions` | object? | Per-recipient authentication options |+| `role` | string | Role: `SIGNER`, `VIEWER`, `APPROVER`, `CC` |+| `signingOrder` | number? | Position in signing sequence |+| `readStatus` | string | `NOT_OPENED` or `OPENED` |+| `signingStatus` | string | `NOT_SIGNED`, `SIGNED`, or `REJECTED` |+| `sendStatus` | string | `NOT_SENT` or `SENT` |+| `rejectionReason` | string? | Reason if recipient rejected |++---++## Document Lifecycle Events++These events track the document through its lifecycle.++### `document.created`++Triggered when a new document is uploaded.++**Event name:** `DOCUMENT_CREATED`++```json+{+ "event": "DOCUMENT_CREATED",+ "payload": {+ "id": 10,+ "externalId": null,+ "userId": 1,+ "authOptions": null,+ "formValues": null,+ "visibility": "EVERYONE",+ "title": "contract.pdf",+ "status": "DRAFT",+ "documentDataId": "hs8qz1ktr9204jn7mg6c5dxy0",+ "createdAt": "2024-04-22T11:44:43.341Z",+ "updatedAt": "2024-04-22T11:44:43.341Z",+ "completedAt": null,+ "deletedAt": null,+ "teamId": null,+ "templateId": null,+ "source": "DOCUMENT",+ "documentMeta": {+ "id": "doc_meta_123",+ "subject": "Please sign this document",+ "message": "Hello, please review and sign this document.",+ "timezone": "UTC",+ "password": null,+ "dateFormat": "MM/DD/YYYY",+ "redirectUrl": null,+ "signingOrder": "PARALLEL",+ "typedSignatureEnabled": true,+ "language": "en",+ "distributionMethod": "EMAIL",+ "emailSettings": null+ },+ "Recipient": [+ {+ "id": 52,+ "documentId": 10,+ "templateId": null,+ "email": "[email protected]",+ "name": "John Doe",+ "token": "vbT8hi3jKQmrFP_LN1WcS",+ "documentDeletedAt": null,+ "expired": null,+ "signedAt": null,+ "authOptions": null,+ "signingOrder": 1,+ "rejectionReason": null,+ "role": "SIGNER",+ "readStatus": "NOT_OPENED",+ "signingStatus": "NOT_SIGNED",+ "sendStatus": "NOT_SENT"+ }+ ]+ },+ "createdAt": "2024-04-22T11:44:44.779Z",+ "webhookEndpoint": "https://your-endpoint.com/webhook"+}+```++### `document.sent`++Triggered when a document is sent to recipients for signing.++**Event name:** `DOCUMENT_SENT`++The document status changes to `PENDING` and recipients have `sendStatus: "SENT"`.++```json+{+ "event": "DOCUMENT_SENT",+ "payload": {+ "id": 10,+ "externalId": null,+ "userId": 1,+ "authOptions": null,+ "formValues": null,+ "visibility": "EVERYONE",+ "title": "contract.pdf",+ "status": "PENDING",+ "documentDataId": "hs8qz1ktr9204jn7mg6c5dxy0",+ "createdAt": "2024-04-22T11:44:43.341Z",+ "updatedAt": "2024-04-22T11:48:07.569Z",+ "completedAt": null,+ "deletedAt": null,+ "teamId": null,+ "templateId": null,+ "source": "DOCUMENT",+ "documentMeta": {+ "id": "doc_meta_123",+ "subject": "Please sign this document",+ "message": "Hello, please review and sign this document.",+ "timezone": "UTC",+ "password": null,+ "dateFormat": "MM/DD/YYYY",+ "redirectUrl": null,+ "signingOrder": "PARALLEL",+ "typedSignatureEnabled": true,+ "language": "en",+ "distributionMethod": "EMAIL",+ "emailSettings": null+ },+ "Recipient": [+ {+ "id": 52,+ "documentId": 10,+ "templateId": null,+ "email": "[email protected]",+ "name": "John Doe",+ "token": "vbT8hi3jKQmrFP_LN1WcS",+ "documentDeletedAt": null,+ "expired": null,+ "signedAt": null,+ "authOptions": null,+ "signingOrder": 1,+ "rejectionReason": null,+ "role": "SIGNER",+ "readStatus": "NOT_OPENED",+ "signingStatus": "NOT_SIGNED",+ "sendStatus": "SENT"+ }+ ]+ },+ "createdAt": "2024-04-22T11:48:07.945Z",+ "webhookEndpoint": "https://your-endpoint.com/webhook"+}+```++### `document.completed`++Triggered when all recipients have completed their required actions.++**Event name:** `DOCUMENT_COMPLETED`++The document status changes to `COMPLETED` and `completedAt` is set.++```json+{+ "event": "DOCUMENT_COMPLETED",+ "payload": {+ "id": 10,+ "externalId": null,+ "userId": 1,+ "authOptions": null,+ "formValues": null,+ "visibility": "EVERYONE",+ "title": "contract.pdf",+ "status": "COMPLETED",+ "documentDataId": "hs8qz1ktr9204jn7mg6c5dxy0",+ "createdAt": "2024-04-22T11:44:43.341Z",+ "updatedAt": "2024-04-22T11:52:05.708Z",+ "completedAt": "2024-04-22T11:52:05.707Z",+ "deletedAt": null,+ "teamId": null,+ "templateId": null,+ "source": "DOCUMENT",+ "documentMeta": {+ "id": "doc_meta_123",+ "subject": "Please sign this document",+ "message": "Hello, please review and sign this document.",+ "timezone": "UTC",+ "password": null,+ "dateFormat": "MM/DD/YYYY",+ "redirectUrl": null,+ "signingOrder": "PARALLEL",+ "typedSignatureEnabled": true,+ "language": "en",+ "distributionMethod": "EMAIL",+ "emailSettings": null+ },+ "Recipient": [+ {+ "id": 50,+ "documentId": 10,+ "templateId": null,+ "email": "[email protected]",+ "name": "Jane Smith",+ "token": "vbT8hi3jKQmrFP_LN1WcS",+ "documentDeletedAt": null,+ "expired": null,+ "signedAt": "2024-04-22T11:51:10.055Z",+ "authOptions": {+ "accessAuth": null,+ "actionAuth": null+ },+ "signingOrder": 1,+ "rejectionReason": null,+ "role": "VIEWER",+ "readStatus": "OPENED",+ "signingStatus": "SIGNED",+ "sendStatus": "SENT"+ },+ {+ "id": 51,+ "documentId": 10,+ "templateId": null,+ "email": "[email protected]",+ "name": "John Doe",+ "token": "HkrptwS42ZBXdRKj1TyUo",+ "documentDeletedAt": null,+ "expired": null,+ "signedAt": "2024-04-22T11:52:05.688Z",+ "authOptions": {+ "accessAuth": null,+ "actionAuth": null+ },+ "signingOrder": 2,+ "rejectionReason": null,+ "role": "SIGNER",+ "readStatus": "OPENED",+ "signingStatus": "SIGNED",+ "sendStatus": "SENT"+ }+ ]+ },+ "createdAt": "2024-04-22T11:52:18.277Z",+ "webhookEndpoint": "https://your-endpoint.com/webhook"+}+```++### `document.rejected`++Triggered when a recipient rejects the document.++**Event name:** `DOCUMENT_REJECTED`++The recipient's `signingStatus` changes to `REJECTED` and `rejectionReason` contains their reason.++```json+{+ "event": "DOCUMENT_REJECTED",+ "payload": {+ "id": 10,+ "externalId": null,+ "userId": 1,+ "authOptions": null,+ "formValues": null,+ "visibility": "EVERYONE",+ "title": "contract.pdf",+ "status": "PENDING",+ "documentDataId": "hs8qz1ktr9204jn7mg6c5dxy0",+ "createdAt": "2024-04-22T11:44:43.341Z",+ "updatedAt": "2024-04-22T11:48:07.569Z",+ "completedAt": null,+ "deletedAt": null,+ "teamId": null,+ "templateId": null,+ "source": "DOCUMENT",+ "documentMeta": {+ "id": "doc_meta_123",+ "subject": "Please sign this document",+ "message": "Hello, please review and sign this document.",+ "timezone": "UTC",+ "password": null,+ "dateFormat": "MM/DD/YYYY",+ "redirectUrl": null,+ "signingOrder": "PARALLEL",+ "typedSignatureEnabled": true,+ "language": "en",+ "distributionMethod": "EMAIL",+ "emailSettings": null+ },+ "Recipient": [+ {+ "id": 52,+ "documentId": 10,+ "templateId": null,+ "email": "[email protected]",+ "name": "John Doe",+ "token": "vbT8hi3jKQmrFP_LN1WcS",+ "documentDeletedAt": null,+ "expired": null,+ "signedAt": "2024-04-22T11:48:07.569Z",+ "authOptions": {+ "accessAuth": null,+ "actionAuth": null+ },+ "signingOrder": 1,+ "rejectionReason": "I do not agree with the terms",+ "role": "SIGNER",+ "readStatus": "OPENED",+ "signingStatus": "REJECTED",+ "sendStatus": "SENT"+ }+ ]+ },+ "createdAt": "2024-04-22T11:48:07.945Z",+ "webhookEndpoint": "https://your-endpoint.com/webhook"+}+```++### `document.cancelled`++Triggered when the document owner cancels a pending document.++**Event name:** `DOCUMENT_CANCELLED`++```json+{+ "event": "DOCUMENT_CANCELLED",+ "payload": {+ "id": 7,+ "externalId": null,+ "userId": 3,+ "authOptions": null,+ "formValues": null,+ "visibility": "EVERYONE",+ "title": "contract.pdf",+ "status": "PENDING",+ "documentDataId": "cm6exvn93006hi02ru90a265a",+ "createdAt": "2025-01-27T11:02:14.393Z",+ "updatedAt": "2025-01-27T11:03:16.387Z",+ "completedAt": null,+ "deletedAt": null,+ "teamId": null,+ "templateId": null,+ "source": "DOCUMENT",+ "documentMeta": {+ "id": "cm6exvn96006ji02rqvzjvwoy",+ "subject": "",+ "message": "",+ "timezone": "Etc/UTC",+ "password": null,+ "dateFormat": "yyyy-MM-dd hh:mm a",+ "redirectUrl": "",+ "signingOrder": "PARALLEL",+ "typedSignatureEnabled": true,+ "language": "en",+ "distributionMethod": "EMAIL",+ "emailSettings": null+ },+ "Recipient": [+ {+ "id": 7,+ "documentId": 7,+ "templateId": null,+ "email": "[email protected]",+ "name": "John Doe",+ "token": "XkKx1HCs6Znm2UBJA2j6o",+ "documentDeletedAt": null,+ "expired": null,+ "signedAt": null,+ "authOptions": { "accessAuth": null, "actionAuth": null },+ "signingOrder": 1,+ "rejectionReason": null,+ "role": "SIGNER",+ "readStatus": "NOT_OPENED",+ "signingStatus": "NOT_SIGNED",+ "sendStatus": "SENT"+ }+ ]+ },+ "createdAt": "2025-01-27T11:03:27.730Z",+ "webhookEndpoint": "https://your-endpoint.com/webhook"+}+```++---++## Recipient Events++Recipient events track individual signer actions. These events use the same payload structure as document events, but focus on a specific recipient's action.++### `document.opened`++Triggered when a recipient opens the document for the first time.++**Event name:** `DOCUMENT_OPENED`++The recipient's `readStatus` changes to `OPENED`.++```json+{+ "event": "DOCUMENT_OPENED",+ "payload": {+ "id": 10,+ "externalId": null,+ "userId": 1,+ "authOptions": null,+ "formValues": null,+ "visibility": "EVERYONE",+ "title": "contract.pdf",+ "status": "PENDING",+ "documentDataId": "hs8qz1ktr9204jn7mg6c5dxy0",+ "createdAt": "2024-04-22T11:44:43.341Z",+ "updatedAt": "2024-04-22T11:48:07.569Z",+ "completedAt": null,+ "deletedAt": null,+ "teamId": null,+ "templateId": null,+ "source": "DOCUMENT",+ "documentMeta": {+ "id": "doc_meta_123",+ "subject": "Please sign this document",+ "message": "Hello, please review and sign this document.",+ "timezone": "UTC",+ "password": null,+ "dateFormat": "MM/DD/YYYY",+ "redirectUrl": null,+ "signingOrder": "PARALLEL",+ "typedSignatureEnabled": true,+ "language": "en",+ "distributionMethod": "EMAIL",+ "emailSettings": null+ },+ "Recipient": [+ {+ "id": 52,+ "documentId": 10,+ "templateId": null,+ "email": "[email protected]",+ "name": "John Doe",+ "token": "vbT8hi3jKQmrFP_LN1WcS",+ "documentDeletedAt": null,+ "expired": null,+ "signedAt": null,+ "authOptions": null,+ "signingOrder": 1,+ "rejectionReason": null,+ "role": "SIGNER",+ "readStatus": "OPENED",+ "signingStatus": "NOT_SIGNED",+ "sendStatus": "SENT"+ }+ ]+ },+ "createdAt": "2024-04-22T11:50:26.174Z",+ "webhookEndpoint": "https://your-endpoint.com/webhook"+}+```++### `document.signed`++Triggered when a recipient signs the document.++**Event name:** `DOCUMENT_SIGNED`++The recipient's `signingStatus` changes to `SIGNED` and `signedAt` is populated.++```json+{+ "event": "DOCUMENT_SIGNED",+ "payload": {+ "id": 10,+ "externalId": null,+ "userId": 1,+ "authOptions": null,+ "formValues": null,+ "visibility": "EVERYONE",+ "title": "contract.pdf",+ "status": "COMPLETED",+ "documentDataId": "hs8qz1ktr9204jn7mg6c5dxy0",+ "createdAt": "2024-04-22T11:44:43.341Z",+ "updatedAt": "2024-04-22T11:52:05.708Z",+ "completedAt": "2024-04-22T11:52:05.707Z",+ "deletedAt": null,+ "teamId": null,+ "templateId": null,+ "source": "DOCUMENT",+ "documentMeta": {+ "id": "doc_meta_123",+ "subject": "Please sign this document",+ "message": "Hello, please review and sign this document.",+ "timezone": "UTC",+ "password": null,+ "dateFormat": "MM/DD/YYYY",+ "redirectUrl": null,+ "signingOrder": "PARALLEL",+ "typedSignatureEnabled": true,+ "language": "en",+ "distributionMethod": "EMAIL",+ "emailSettings": null+ },+ "Recipient": [+ {+ "id": 51,+ "documentId": 10,+ "templateId": null,+ "email": "[email protected]",+ "name": "John Doe",+ "token": "HkrptwS42ZBXdRKj1TyUo",+ "documentDeletedAt": null,+ "expired": null,+ "signedAt": "2024-04-22T11:52:05.688Z",+ "authOptions": {+ "accessAuth": null,+ "actionAuth": null+ },+ "signingOrder": 1,+ "rejectionReason": null,+ "role": "SIGNER",+ "readStatus": "OPENED",+ "signingStatus": "SIGNED",+ "sendStatus": "SENT"+ }+ ]+ },+ "createdAt": "2024-04-22T11:52:18.577Z",+ "webhookEndpoint": "https://your-endpoint.com/webhook"+}+```++---++## Event Summary++| Event | Trigger | Key Changes |+| -------------------- | ------------------------------- | ------------------------------------------------------------ |+| `DOCUMENT_CREATED` | Document uploaded | `status: "DRAFT"` |+| `DOCUMENT_SENT` | Document sent to recipients | `status: "PENDING"`, recipients `sendStatus: "SENT"` |+| `DOCUMENT_OPENED` | Recipient opens document | Recipient `readStatus: "OPENED"` |+| `DOCUMENT_SIGNED` | Recipient signs document | Recipient `signingStatus: "SIGNED"`, `signedAt` set |+| `DOCUMENT_COMPLETED` | All recipients complete actions | `status: "COMPLETED"`, `completedAt` set |+| `DOCUMENT_REJECTED` | Recipient rejects document | Recipient `signingStatus: "REJECTED"`, `rejectionReason` set |+| `DOCUMENT_CANCELLED` | Owner cancels document | Document cancelled while pending |++---++## Handling Events++When processing webhook events:++{/* prettier-ignore */}+<Steps>+ <Step>+ **Verify the signature** — Check the `X-Documenso-Secret` header matches your configured secret+ </Step>+ <Step>+ **Check event type** — Use the `event` field to determine the action+ </Step>+ <Step>+ **Process idempotently** — Webhooks may be retried, so handle duplicate events+ </Step>+ <Step>+ **Respond quickly** — Return a 200 status code within 30 seconds+ </Step>+</Steps>++```typescript+app.post('/webhook', (req, res) => {+ const secret = req.headers['x-documenso-secret'];++ if (secret !== process.env.WEBHOOK_SECRET) {+ return res.status(401).send('Unauthorized');+ }++ const { event, payload } = req.body;++ switch (event) {+ case 'DOCUMENT_COMPLETED':+ // Handle completed document+ console.log(`Document ${payload.id} completed`);+ break;+ case 'DOCUMENT_SIGNED':+ // Handle signature+ const signer = payload.Recipient.find((r) => r.signingStatus === 'SIGNED');+ console.log(`${signer?.name} signed document ${payload.id}`);+ break;+ case 'DOCUMENT_REJECTED':+ // Handle rejection+ const rejecter = payload.Recipient.find((r) => r.signingStatus === 'REJECTED');+ console.log(`${rejecter?.name} rejected: ${rejecter?.rejectionReason}`);+ break;+ }++ res.status(200).send('OK');+});+```++---++## See Also++- [Webhook Setup](/docs/developers/webhooks/setup) - Configure webhook endpoints+- [Webhook Verification](/docs/developers/webhooks/verification) - Verify webhook signaturesdiff --git a/apps/docs/content/docs/developers/webhooks/index.mdx b/apps/docs/content/docs/developers/webhooks/index.mdxnew file mode 100644index 000000000..ef842feca--- /dev/null+++ b/apps/docs/content/docs/developers/webhooks/index.mdx@@ -0,0 +1,55 @@+---+title: Webhooks+description: Receive real-time notifications when documents are signed, completed, or updated.+---++## How Webhooks Work++1. You configure a webhook URL in Documenso+2. When an event occurs, Documenso sends an HTTP POST to your URL+3. Your application processes the event and responds with 200 OK++---++## Getting Started++<Cards>+ <Card+ title="Setup"+ description="Configure webhook endpoints."+ href="/docs/developers/webhooks/setup"+ />+ <Card+ title="Events"+ description="Available webhook event types."+ href="/docs/developers/webhooks/events"+ />+ <Card+ title="Verification"+ description="Verify webhook signatures for security."+ href="/docs/developers/webhooks/verification"+ />+</Cards>++---++## Example Payload++```json+{+ "event": "DOCUMENT_COMPLETED",+ "payload": {+ "id": 123,+ "title": "Contract",+ "status": "COMPLETED"+ },+ "createdAt": "2024-01-15T10:30:00.000Z",+ "webhookEndpoint": "https://your-endpoint.com/webhook"+}+```++---++## See Also++- [Document Lifecycle](/docs/concepts/document-lifecycle) - Understanding document statusesdiff --git a/apps/docs/content/docs/developers/webhooks/meta.json b/apps/docs/content/docs/developers/webhooks/meta.jsonnew file mode 100644index 000000000..787470cd2--- /dev/null+++ b/apps/docs/content/docs/developers/webhooks/meta.json@@ -0,0 +1,4 @@+{+ "title": "Webhooks",+ "pages": ["setup", "events", "verification"]+}diff --git a/apps/docs/content/docs/developers/webhooks/setup.mdx b/apps/docs/content/docs/developers/webhooks/setup.mdxnew file mode 100644index 000000000..db091b047--- /dev/null+++ b/apps/docs/content/docs/developers/webhooks/setup.mdx@@ -0,0 +1,355 @@+---+title: Webhook Setup+description: Configure webhooks to receive real-time notifications about document events.+---++import { Accordion, Accordions } from 'fumadocs-ui/components/accordion';+import { Callout } from 'fumadocs-ui/components/callout';+import { Step, Steps } from 'fumadocs-ui/components/steps';+import { Tab, Tabs } from 'fumadocs-ui/components/tabs';++## Overview++Webhooks are HTTP callbacks triggered by specific events in Documenso. When an event occurs (such as a document being signed), Documenso sends an HTTP POST request to your configured URL with details about the event.++Common use cases include:++- Syncing document status with your database+- Triggering automated workflows when documents are signed+- Integrating with CRM systems or other third-party services+- Sending custom notifications to stakeholders++<Callout type="info">+ Webhooks are available for teams only. Personal accounts cannot configure webhooks.+</Callout>++## Creating a Webhook Endpoint++Before configuring a webhook in Documenso, you need an endpoint that can receive HTTP POST requests. Here's a minimal example:++<Tabs items={['Node.js (Express)', 'Python (Flask)', 'Go']}>+<Tab value="Node.js (Express)">+```javascript+const express = require('express');+const app = express();++app.use(express.json());++app.post('/webhooks/documenso', (req, res) => {+ const { event, payload, createdAt } = req.body;++ console.log(`Received event: ${event}`);+ console.log(`Document ID: ${payload.id}`);+ console.log(`Document title: ${payload.title}`);++ // Process the webhook event+ switch (event) {+ case 'DOCUMENT_COMPLETED':+ // Handle completed document+ break;+ case 'DOCUMENT_SIGNED':+ // Handle signed document+ break;+ // Handle other events...+ }++ // Respond with 200 OK to acknowledge receipt+ res.status(200).json({ received: true });+});++app.listen(3000, () => {+ console.log('Webhook server running on port 3000');+});++````+</Tab>+<Tab value="Python (Flask)">+```python+from flask import Flask, request, jsonify++app = Flask(__name__)+[email protected]('/webhooks/documenso', methods=['POST'])+def handle_webhook():+ data = request.get_json()++ event = data.get('event')+ payload = data.get('payload')++ print(f"Received event: {event}")+ print(f"Document ID: {payload.get('id')}")+ print(f"Document title: {payload.get('title')}")++ # Process the webhook event+ if event == 'DOCUMENT_COMPLETED':+ # Handle completed document+ pass+ elif event == 'DOCUMENT_SIGNED':+ # Handle signed document+ pass++ # Respond with 200 OK to acknowledge receipt+ return jsonify({'received': True}), 200++if __name__ == '__main__':+ app.run(port=3000)+````++</Tab>+<Tab value="Go">+```go+package main++import (+ "encoding/json"+ "fmt"+ "net/http"+)++type WebhookPayload struct {+ Event string `json:"event"`+ Payload map[string]interface{} `json:"payload"`+ CreatedAt string `json:"createdAt"`+}++func webhookHandler(w http.ResponseWriter, r *http.Request) {+ var data WebhookPayload+ if err := json.NewDecoder(r.Body).Decode(&data); err != nil {+ http.Error(w, "Invalid payload", http.StatusBadRequest)+ return+ }++ fmt.Printf("Received event: %s\n", data.Event)+ fmt.Printf("Document ID: %v\n", data.Payload["id"])+ fmt.Printf("Document title: %v\n", data.Payload["title"])++ // Process the webhook event+ switch data.Event {+ case "DOCUMENT_COMPLETED":+ // Handle completed document+ case "DOCUMENT_SIGNED":+ // Handle signed document+ }++ // Respond with 200 OK to acknowledge receipt+ w.Header().Set("Content-Type", "application/json")+ w.WriteHeader(http.StatusOK)+ json.NewEncoder(w).Encode(map[string]bool{"received": true})+}++func main() {+ http.HandleFunc("/webhooks/documenso", webhookHandler)+ fmt.Println("Webhook server running on port 3000")+ http.ListenAndServe(":3000", nil)+}++```+</Tab>+</Tabs>++<Callout type="warn">+ Always respond with a `200 OK` status within 30 seconds. Documenso will retry failed deliveries.+</Callout>++## Configuring Webhooks in Documenso via the Dashboard++{/* prettier-ignore */}+<Steps>+<Step>+### Navigate to team settings++Click your avatar in the top right corner and select **Team settings** from the dropdown menu.+</Step>++<Step>+### Open the webhooks tab++Navigate to the **Webhooks** tab in the team settings sidebar.+++</Step>++<Step>+### Create a new webhook++Click the **Create Webhook** button to open the configuration dialog.+++</Step>++<Step>+### Configure the webhook++Fill in the following fields:++| Field | Description |+| ----- | ----------- |+| **Webhook URL** | The HTTPS endpoint that will receive webhook events |+| **Events** | Select which events should trigger this webhook |+| **Secret** (optional) | A secret key used to sign the payload for verification |+</Step>++<Step>+### Save the webhook++Click **Create Webhook** to save your configuration. The webhook is now active and will receive events.+</Step>+</Steps>++## Webhook URL Requirements++Your webhook endpoint must meet these requirements:++| Requirement | Details |+| ----------- | ------- |+| **Protocol** | HTTPS required (HTTP not allowed in production) |+| **Response** | Must return `2xx` status code within 30 seconds |+| **Method** | Must accept HTTP POST requests |+| **Content-Type** | Must accept `application/json` payloads |+| **Availability** | Must be publicly accessible from the internet |++<Callout type="info">+ For local development, use a tunneling service like [ngrok](https://ngrok.com) or [localtunnel](https://localtunnel.me) to expose your local server.+</Callout>++## Selecting Events++When creating a webhook, you can subscribe to one or more events:++| Event | Trigger |+| ----- | ------- |+| `DOCUMENT_CREATED` | A new document is created |+| `DOCUMENT_SENT` | A document is sent to recipients |+| `DOCUMENT_OPENED` | A recipient opens the document |+| `DOCUMENT_SIGNED` | A recipient signs the document |+| `DOCUMENT_COMPLETED` | All recipients have signed the document |+| `DOCUMENT_REJECTED` | A recipient rejects the document |+| `DOCUMENT_CANCELLED` | The document owner cancels the document |++You can subscribe to all events or select specific ones based on your needs. For example, if you only need to know when documents are fully signed, subscribe only to `DOCUMENT_COMPLETED`.++See [Webhook Events](/docs/developers/webhooks/events) for detailed payload information for each event type.++## Testing Webhooks++Documenso provides a built-in testing feature to verify your webhook endpoint works correctly.++{/* prettier-ignore */}+<Steps>+<Step>+### Navigate to webhook details++Go to **Team Settings > Webhooks** and click on the webhook you want to test.+++</Step>++<Step>+### Click test++Click the **Test** button in the webhook details page.+</Step>++<Step>+### Select an event type++Choose which event type you want to simulate from the dropdown.+</Step>++<Step>+### Send test payload++Click **Send** to dispatch a test webhook with sample data to your endpoint.+++</Step>+</Steps>++The test payload contains realistic sample data so you can verify your endpoint processes events correctly. After sending, you can view the response in the webhook call logs.++### Viewing Webhook Logs++Each webhook subscription maintains a log of all delivery attempts. To view logs:++{/* prettier-ignore */}+<Steps>+<Step>+Go to **Team Settings > Webhooks**+</Step>+<Step>+Click on a webhook to view its details+</Step>+<Step>+Review the logs++Each webhook call shows the following details:+- Status (success/failure)+- Event type+- Timestamp+- Response code+- Request and response bodies++Click any call to see full details including headers and response data.+</Step>+</Steps>++### Resending Failed Webhooks++If a webhook delivery fails, you can manually resend it:++{/* prettier-ignore */}+<Steps>+<Step>+Navigate to the webhook call details page+</Step>+<Step>+Click the **Resend** button+</Step>+<Step>+Documenso will attempt to deliver the same payload again+</Step>+</Steps>++## Retry Policy++When a webhook delivery fails (non-2xx response or timeout), Documenso automatically retries with exponential backoff:++| Attempt | Delay |+| ------- | ----- |+| 1 | Immediate |+| 2 | 1 minute |+| 3 | 5 minutes |+| 4 | 30 minutes |+| 5 | 2 hours |++After 5 failed attempts, the webhook is marked as failed and no further automatic retries occur. You can manually resend failed webhooks from the dashboard.++<Callout type="warn">+ If your endpoint consistently fails, consider reviewing your server logs and ensuring your endpoint meets all [URL requirements](#webhook-url-requirements).+</Callout>++## Security Best Practices++<Accordions type="multiple">+ <Accordion title="Use HTTPS">+ Always use HTTPS endpoints in production.+ </Accordion>+ <Accordion title="Verify signatures">+ Use a webhook secret and verify the `X-Documenso-Secret` header (see [Verification](/docs/developers/webhooks/verification)).+ </Accordion>+ <Accordion title="Validate payloads">+ Validate incoming data before processing.+ </Accordion>+ <Accordion title="Respond quickly">+ Return 200 OK immediately, then process asynchronously.+ </Accordion>+ <Accordion title="Idempotency">+ Handle duplicate deliveries gracefully.+ </Accordion>+</Accordions>++## Next Steps++- [Webhook Events](/docs/developers/webhooks/events) - Detailed payload structure for each event type+- [Webhook Verification](/docs/developers/webhooks/verification) - Secure your webhooks with signature verification+```diff --git a/apps/docs/content/docs/developers/webhooks/verification.mdx b/apps/docs/content/docs/developers/webhooks/verification.mdxnew file mode 100644index 000000000..8628cbae8--- /dev/null+++ b/apps/docs/content/docs/developers/webhooks/verification.mdx@@ -0,0 +1,290 @@+---+title: Webhook Verification+description: Verify webhook signatures for security.+---++import { Accordion, Accordions } from 'fumadocs-ui/components/accordion';+import { Callout } from 'fumadocs-ui/components/callout';+import { Step, Steps } from 'fumadocs-ui/components/steps';+import { Tab, Tabs } from 'fumadocs-ui/components/tabs';++## Overview++Verifying webhook requests ensures that incoming payloads originate from Documenso and have not been tampered with. Without verification, attackers could forge requests to your endpoint and trigger unintended actions.++## How Documenso Signs Webhooks++When you configure a webhook with a secret, Documenso includes that secret in every webhook request via the `X-Documenso-Secret` header. Your server should compare this header value against your stored secret to authenticate the request.++```bash+POST /your-webhook-endpoint HTTP/1.1+Host: your-server.com+Content-Type: application/json+X-Documenso-Secret: your_webhook_secret_here++{"event": "DOCUMENT_COMPLETED", "payload": {...}}+```++## Signature Header Format++| Header | Description |+| -------------------- | ------------------------------------------------------- |+| `X-Documenso-Secret` | The secret key you configured when creating the webhook |++The header contains your webhook secret as a plain string. If you did not configure a secret, the header will be an empty string.++## Verification Steps++{/* prettier-ignore */}+<Steps>+ <Step>+ Extract the `X-Documenso-Secret` header from the incoming request+ </Step>+ <Step>+ Compare it against your stored webhook secret using a constant-time comparison+ </Step>+ <Step>+ Reject the request if the values do not match+ </Step>+ <Step>+ Process the webhook payload if verification succeeds+ </Step>+</Steps>++<Callout type="warn">+ Always use constant-time string comparison to prevent timing attacks. Standard equality operators+ (`===` or `==`) can leak information about the secret through response time variations.+</Callout>++## Code Examples++<Tabs items={['Node.js (Express)', 'Python (Flask)']}>+<Tab value="Node.js (Express)">+```javascript+const express = require('express');+const crypto = require('crypto');++const app = express();+app.use(express.json());++const WEBHOOK_SECRET = process.env.DOCUMENSO_WEBHOOK_SECRET;++function verifyWebhookSignature(receivedSecret, expectedSecret) {+ if (!expectedSecret) {+ // No secret configured, skip verification+ // Not recommended for production+ return true;+ }++ if (!receivedSecret) {+ return false;+ }++ // Use constant-time comparison to prevent timing attacks+ try {+ return crypto.timingSafeEqual(+ Buffer.from(receivedSecret),+ Buffer.from(expectedSecret),+ );+ } catch {+ return false;+ }+}++app.post('/webhooks/documenso', (req, res) => {+ const receivedSecret = req.headers['x-documenso-secret'];++ if (!verifyWebhookSignature(receivedSecret, WEBHOOK_SECRET)) {+ console.error('Webhook verification failed');+ return res.status(401).json({ error: 'Invalid signature' });+ }++ // Signature verified, process the webhook+ const { event, payload } = req.body;+ console.log(`Verified webhook: ${event}`);++ // Process the event...++ res.status(200).json({ received: true });+});++app.listen(3000, () => {+ console.log('Webhook server running on port 3000');+});++````+</Tab>+<Tab value="Python (Flask)">+```python+import hmac+import os+from flask import Flask, request, jsonify++app = Flask(__name__)++WEBHOOK_SECRET = os.environ.get('DOCUMENSO_WEBHOOK_SECRET')++def verify_webhook_signature(received_secret, expected_secret):+ """Verify the webhook signature using constant-time comparison."""+ if not expected_secret:+ # No secret configured, skip verification+ # Not recommended for production+ return True++ if not received_secret:+ return False++ # Use constant-time comparison to prevent timing attacks+ return hmac.compare_digest(received_secret, expected_secret)+[email protected]('/webhooks/documenso', methods=['POST'])+def handle_webhook():+ received_secret = request.headers.get('X-Documenso-Secret', '')++ if not verify_webhook_signature(received_secret, WEBHOOK_SECRET):+ print('Webhook verification failed')+ return jsonify({'error': 'Invalid signature'}), 401++ # Signature verified, process the webhook+ data = request.get_json()+ event = data.get('event')+ payload = data.get('payload')++ print(f'Verified webhook: {event}')++ # Process the event...++ return jsonify({'received': True}), 200++if __name__ == '__main__':+ app.run(port=3000)+````++</Tab>+</Tabs>++## Handling Verification Failures++When verification fails, follow these practices:++| Action | Description |+| ------------------- | ------------------------------------------------------------------ |+| Return 401 status | Respond with `401 Unauthorized` to indicate authentication failure |+| Log the attempt | Record failed attempts for security monitoring |+| Do not process | Never process the payload if verification fails |+| Do not leak details | Avoid exposing information about why verification failed |++```javascript+app.post('/webhooks/documenso', (req, res) => {+ const receivedSecret = req.headers['x-documenso-secret'];++ if (!verifyWebhookSignature(receivedSecret, WEBHOOK_SECRET)) {+ // Log for monitoring but don't expose details+ console.error('Webhook verification failed', {+ timestamp: new Date().toISOString(),+ ip: req.ip,+ });++ // Generic error response+ return res.status(401).json({ error: 'Unauthorized' });+ }++ // Continue processing...+});+```++### Common Verification Issues++| Issue | Cause | Solution |+| --------------- | --------------------------------------- | ------------------------------------------------------------------ |+| Secret mismatch | Webhook secret changed or misconfigured | Verify the secret in your environment matches the one in Documenso |+| Empty header | Webhook created without a secret | Add a secret to the webhook configuration in Documenso |+| Encoding issues | String encoding mismatch | Ensure both secrets use the same encoding (UTF-8) |++## Security Best Practices++<Accordions type="multiple">+ <Accordion title="Use strong secrets">+ Generate a cryptographically secure random string for your webhook secret:++```bash+# Generate a 32-byte random secret+openssl rand -hex 32+```++ </Accordion>+ <Accordion title="Store secrets securely">+ Never hardcode secrets in your source code. Use environment variables or a secrets manager:++```javascript+// Good: Environment variable+const WEBHOOK_SECRET = process.env.DOCUMENSO_WEBHOOK_SECRET;++// Bad: Hardcoded+const WEBHOOK_SECRET = 'my-secret-key'; // Never do this+```++ </Accordion>+ <Accordion title="Rotate secrets periodically">+ Update your webhook secret periodically:++1. Generate a new secret+2. Update your server to accept both old and new secrets temporarily+3. Update the webhook configuration in Documenso+4. Remove the old secret from your server++</Accordion>+<Accordion title="Validate payload structure">+ After verifying the signature, validate the payload structure before processing:++```javascript+const { event, payload, createdAt } = req.body;++if (!event || !payload) {+ return res.status(400).json({ error: 'Invalid payload structure' });+}++// Validate event is a known type+const validEvents = [+ 'DOCUMENT_CREATED',+ 'DOCUMENT_SENT',+ 'DOCUMENT_OPENED',+ 'DOCUMENT_SIGNED',+ 'DOCUMENT_COMPLETED',+ 'DOCUMENT_REJECTED',+ 'DOCUMENT_CANCELLED',+];++if (!validEvents.includes(event)) {+ console.warn(`Unknown event type: ${event}`);+}+```++ </Accordion>+ <Accordion title="Use HTTPS">+ Always use HTTPS endpoints in production to encrypt data in transit, including the secret header.+ </Accordion>+ <Accordion title="Implement rate limiting">+ Protect your endpoint from abuse with rate limiting:++```javascript+const rateLimit = require('express-rate-limit');++const webhookLimiter = rateLimit({+ windowMs: 60 * 1000, // 1 minute+ max: 100, // 100 requests per minute+ message: { error: 'Too many requests' },+});++app.post('/webhooks/documenso', webhookLimiter, (req, res) => {+ // Handle webhook...+});+```++ </Accordion>+</Accordions>++## See Also++- [Webhook Setup](/docs/developers/webhooks/setup) - Configure webhook endpoints and secrets+- [Webhook Events](/docs/developers/webhooks/events) - Event types and payload structurediff --git a/apps/docs/content/docs/index.mdx b/apps/docs/content/docs/index.mdxnew file mode 100644index 000000000..f649f1d28--- /dev/null+++ b/apps/docs/content/docs/index.mdx@@ -0,0 +1,163 @@+---+title: Documenso Documentation+description: Learn how to send documents for signing, integrate with the API, or self-host your own instance.+full: true+---++import {+ BookOpenIcon,+ CodeIcon,+ FileTextIcon,+ ServerIcon,+ ShieldCheckIcon,+ UserIcon,+} from 'lucide-react';++<div className="not-prose max-w-4xl mx-auto px-4">+ <div className="mb-12 text-center pt-6">+ <p className="text-lg text-fd-muted-foreground max-w-2xl mx-auto">+ The open-source document signing platform. Send documents for signatures, integrate with your apps, or self-host with full control.+ </p>+ </div>++ <div className="grid gap-4 md:grid-cols-3 mb-12">+ <a href="/docs/users" className="group relative flex flex-col rounded-xl border bg-fd-card p-6 transition-all hover:border-fd-primary/50 hover:shadow-md">+ <div className="mb-4 flex size-12 items-center justify-center rounded-lg bg-emerald-500/10 text-emerald-600 dark:text-emerald-400">+ <UserIcon className="size-6" />+ </div>+ <h2 className="text-lg font-semibold mb-2">User Guide</h2>+ <p className="text-sm text-fd-muted-foreground mb-4 flex-1">+ Send documents, create templates, and manage your team using the web application.+ </p>+ <span className="text-sm font-medium text-fd-primary">Get started →</span>+ </a>++ <a href="/docs/developers" className="group relative flex flex-col rounded-xl border bg-fd-card p-6 transition-all hover:border-fd-primary/50 hover:shadow-md">+ <div className="mb-4 flex size-12 items-center justify-center rounded-lg bg-blue-500/10 text-blue-600 dark:text-blue-400">+ <CodeIcon className="size-6" />+ </div>+ <h2 className="text-lg font-semibold mb-2">Developer Guide</h2>+ <p className="text-sm text-fd-muted-foreground mb-4 flex-1">+ Integrate document signing into your applications with the REST API, webhooks, and embedding.+ </p>+ <span className="text-sm font-medium text-fd-primary">View API docs →</span>+ </a>++ <a href="/docs/self-hosting" className="group relative flex flex-col rounded-xl border bg-fd-card p-6 transition-all hover:border-fd-primary/50 hover:shadow-md">+ <div className="mb-4 flex size-12 items-center justify-center rounded-lg bg-purple-500/10 text-purple-600 dark:text-purple-400">+ <ServerIcon className="size-6" />+ </div>+ <h2 className="text-lg font-semibold mb-2">Self-Hosting Guide</h2>+ <p className="text-sm text-fd-muted-foreground mb-4 flex-1">+ Deploy your own Documenso instance with Docker, Kubernetes, or Railway.+ </p>+ <span className="text-sm font-medium text-fd-primary">Deploy now →</span>+ </a>++ </div>++ <div className="grid gap-8 md:grid-cols-2 mb-12">+ <div className="rounded-xl border bg-fd-card/50 p-6">+ <h3 className="font-semibold mb-4 flex items-center gap-2">+ <BookOpenIcon className="size-5 text-fd-muted-foreground" />+ Quick Start+ </h3>+ <div className="space-y-4">+ <div>+ <h4 className="text-sm font-medium mb-2">Send your first document</h4>+ <ol className="text-sm text-fd-muted-foreground space-y-1 list-decimal list-inside">+ <li><a href="/docs/users/getting-started/create-account" className="text-fd-primary hover:underline">Create an account</a></li>+ <li><a href="/docs/users/getting-started/send-first-document" className="text-fd-primary hover:underline">Upload and send a document</a></li>+ </ol>+ </div>+ <div>+ <h4 className="text-sm font-medium mb-2">Integrate with the API</h4>+ <ol className="text-sm text-fd-muted-foreground space-y-1 list-decimal list-inside">+ <li><a href="/docs/developers/getting-started/authentication" className="text-fd-primary hover:underline">Get your API key</a></li>+ <li><a href="/docs/developers/getting-started/first-api-call" className="text-fd-primary hover:underline">Make your first API call</a></li>+ </ol>+ </div>+ <div>+ <h4 className="text-sm font-medium mb-2">Deploy self-hosted</h4>+ <ol className="text-sm text-fd-muted-foreground space-y-1 list-decimal list-inside">+ <li><a href="/docs/self-hosting/getting-started/requirements" className="text-fd-primary hover:underline">Check requirements</a></li>+ <li><a href="/docs/self-hosting/getting-started/quick-start" className="text-fd-primary hover:underline">Run with Docker</a></li>+ </ol>+ </div>+ </div>+ </div>++ <div className="rounded-xl border bg-fd-card/50 p-6">+ <h3 className="font-semibold mb-4 flex items-center gap-2">+ <BookOpenIcon className="size-5 text-fd-muted-foreground" />+ Core Concepts+ </h3>+ <div className="grid grid-cols-2 gap-3">+ <a href="/docs/concepts/document-lifecycle" className="rounded-lg border bg-fd-background p-3 text-sm hover:border-fd-primary/50 transition-colors">+ <div className="font-medium mb-1">Document Lifecycle</div>+ <div className="text-xs text-fd-muted-foreground">Draft to completed</div>+ </a>+ <a href="/docs/concepts/recipient-roles" className="rounded-lg border bg-fd-background p-3 text-sm hover:border-fd-primary/50 transition-colors">+ <div className="font-medium mb-1">Recipient Roles</div>+ <div className="text-xs text-fd-muted-foreground">Signers and approvers</div>+ </a>+ <a href="/docs/concepts/field-types" className="rounded-lg border bg-fd-background p-3 text-sm hover:border-fd-primary/50 transition-colors">+ <div className="font-medium mb-1">Field Types</div>+ <div className="text-xs text-fd-muted-foreground">Signatures and inputs</div>+ </a>+ <a href="/docs/concepts/signing-certificates" className="rounded-lg border bg-fd-background p-3 text-sm hover:border-fd-primary/50 transition-colors">+ <div className="font-medium mb-1">Signing Certificates</div>+ <div className="text-xs text-fd-muted-foreground">Digital verification</div>+ </a>+ </div>+ </div>++ </div>++ <div className="grid gap-4 md:grid-cols-2 mb-12">+ <a href="/docs/compliance" className="flex items-start gap-4 rounded-xl border bg-fd-card/50 p-5 transition-all hover:border-fd-primary/50">+ <div className="flex size-10 shrink-0 items-center justify-center rounded-lg bg-amber-500/10 text-amber-600 dark:text-amber-400">+ <ShieldCheckIcon className="size-5" />+ </div>+ <div>+ <h3 className="font-semibold mb-1">Compliance & Legal</h3>+ <p className="text-sm text-fd-muted-foreground">+ ESIGN, UETA, eIDAS compliance, GDPR, and signature levels explained.+ </p>+ </div>+ </a>++ <a href="/docs/policies" className="flex items-start gap-4 rounded-xl border bg-fd-card/50 p-5 transition-all hover:border-fd-primary/50">+ <div className="flex size-10 shrink-0 items-center justify-center rounded-lg bg-slate-500/10 text-slate-600 dark:text-slate-400">+ <FileTextIcon className="size-5" />+ </div>+ <div>+ <h3 className="font-semibold mb-1">Policies & Licensing</h3>+ <p className="text-sm text-fd-muted-foreground">+ AGPL and Enterprise licenses, fair use, privacy policy, and support.+ </p>+ </div>+ </a>++ </div>++ <div className="rounded-xl border bg-gradient-to-r from-fd-primary/5 to-fd-primary/10 p-6 text-center">+ <h3 className="font-semibold mb-2">Join the Community</h3>+ <p className="text-sm text-fd-muted-foreground mb-4">+ Documenso is open source. Contribute, ask questions, or share feedback.+ </p>+ <div className="flex flex-wrap justify-center gap-3">+ <a href="https://github.com/documenso/documenso" className="inline-flex items-center gap-2 rounded-lg bg-fd-background border px-4 py-2 text-sm font-medium hover:bg-fd-accent transition-colors">+ <svg className="size-4" viewBox="0 0 24 24" fill="currentColor"><path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"></path></svg>+ GitHub+ </a>+ <a href="https://documen.so/discord" className="inline-flex items-center gap-2 rounded-lg bg-fd-background border px-4 py-2 text-sm font-medium hover:bg-fd-accent transition-colors">+ <svg className="size-4" viewBox="0 0 24 24" fill="currentColor"><path d="M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189Z"></path></svg>+ Discord+ </a>+ <a href="https://documenso.com" className="inline-flex items-center gap-2 rounded-lg bg-fd-primary text-fd-primary-foreground px-4 py-2 text-sm font-medium hover:bg-fd-primary/90 transition-colors">+ Try Documenso+ </a>+ </div>+ </div>+</div>diff --git a/apps/docs/content/docs/meta.json b/apps/docs/content/docs/meta.jsonnew file mode 100644index 000000000..9360dcdde--- /dev/null+++ b/apps/docs/content/docs/meta.json@@ -0,0 +1,13 @@+{+ "title": "Documentation",+ "pages": [+ "---Guides---",+ "users",+ "developers",+ "self-hosting",+ "---Resources---",+ "concepts",+ "compliance",+ "policies"+ ]+}diff --git a/apps/docs/content/docs/policies/community-edition.mdx b/apps/docs/content/docs/policies/community-edition.mdxnew file mode 100644index 000000000..2cd1c06fd--- /dev/null+++ b/apps/docs/content/docs/policies/community-edition.mdx@@ -0,0 +1,205 @@+---+title: Community Edition+description: The open-source version of Documenso, available under the AGPL-3.0 license. Includes core document signing functionality and can be self-hosted.+---++import { Accordion, Accordions } from 'fumadocs-ui/components/accordion';+import { Callout } from 'fumadocs-ui/components/callout';++## AGPL-3.0 License Overview++The GNU Affero General Public License version 3 (AGPL-3.0) is a copyleft license designed to ensure software freedom. It is similar to GPL-3.0 but includes an additional "network clause" that addresses software-as-a-service use cases.++Key characteristics:++- **Copyleft**: Derivative works must use the same license+- **Network clause**: Network access triggers the same obligations as distribution+- **Source availability**: Users must be able to access the source code++The full license text is available in the [LICENSE file](https://github.com/documenso/documenso/blob/main/LICENSE) in the repository.++## What You Can Do++Under the AGPL-3.0 license, you are permitted to:++| Action | Description |+| ------------------ | ------------------------------------------------------------- |+| **Use** | Run Documenso for any purpose, including commercial use |+| **Study** | Access and examine the complete source code |+| **Modify** | Make changes and customizations to the software |+| **Distribute** | Share copies of the original or modified software |+| **Self-host** | Deploy on your own servers, cloud infrastructure, or locally |+| **Offer services** | Provide document signing services to users (with obligations) |++## What You Must Do++When using or distributing the Community Edition, you must comply with these requirements:++<Accordions type="multiple">+ <Accordion title="Source Code Disclosure">+ If you modify Documenso and make it available over a network, you must:++ - Provide access to the complete source code of your modified version+ - Make the source available through the same network interface, or provide a written offer to supply it+ - Include all scripts and instructions needed to build and install the software++ <Callout type="warn">+ The network clause is the distinguishing feature of AGPL-3.0. If users interact with your modified+ Documenso instance over a network (whether internal or external), you must provide them access to+ the source code.+ </Callout>++ </Accordion>+ <Accordion title="Attribution">+ You must maintain proper attribution:++ - Keep all copyright notices intact in the source code+ - Include a copy of the AGPL-3.0 license with any distribution+ - Clearly state any modifications you have made+ - Preserve author attributions and license headers++ </Accordion>+ <Accordion title="License Continuity">+ Derivative works must be licensed under AGPL-3.0:++ - Forks must use the same license+ - Modifications cannot be made proprietary+ - Combined works that incorporate Documenso code are subject to AGPL-3.0++ </Accordion>+ <Accordion title="Enterprise Edition Boundary">+ Features located in the `packages/ee/` directory of the codebase are not licensed under AGPL-3.0 and require an active [Enterprise license](/docs/policies/enterprise-edition) to use. If you are self-hosting the Community Edition, do not enable or use features from the `packages/ee/` folder without an enterprise license.+ </Accordion>+</Accordions>++## Features Included++The Community Edition includes the core Documenso functionality:++<Accordions type="multiple">+ <Accordion title="Document Management">+ - Upload and prepare PDF documents for signing+ - Add multiple recipients with different roles (signer, approver, viewer, etc.)+ - Configure signing order and workflow+ - Track document status and completion+ </Accordion>+ <Accordion title="Field Types">+ - Signature fields (draw, type, or upload)+ - Initial fields+ - Text fields+ - Date fields+ - Checkbox fields+ - Number fields+ - Dropdown/select fields+ - Radio button fields+ </Accordion>+ <Accordion title="Signing Experience">+ - Email-based signing workflow+ - Direct signing links+ - Signing certificate integration+ - Completed document download+ </Accordion>+ <Accordion title="Templates">+ - Create reusable document templates+ - Pre-configure recipients and fields+ - Generate documents from templates via UI or API+ </Accordion>+ <Accordion title="API Access">+ - REST API for document operations+ - Webhook notifications for events+ - API token authentication+ </Accordion>+ <Accordion title="Self-Hosting">+ - Docker and Docker Compose deployment+ - Kubernetes deployment option+ - Railway one-click deployment+ - PostgreSQL database support+ - S3-compatible storage support+ - SMTP email configuration++ For the complete list of configuration options, see the [Self-Hosting Guide](/docs/self-hosting).++ </Accordion>+</Accordions>++## Support Options++Community Edition users have access to community-based support:++<Accordions type="multiple">+ <Accordion title="Discord">+ The Documenso Discord server is the primary community support channel. You can:++ - Ask questions and get help from other users+ - Share your use cases and solutions+ - Report issues and discuss features++ </Accordion>+ <Accordion title="GitHub">+ - **[GitHub Discussions](https://github.com/documenso/documenso/discussions)**: For questions, ideas, and general discussion+ - **[GitHub Issues](https://github.com/documenso/documenso/issues)**: For confirmed bug reports with reproducible steps+ </Accordion>+ <Accordion title="Documentation">+ - [Self-Hosting Guide](/docs/self-hosting) for deployment and configuration+ - [Developer Guide](/docs/developers) for API integration+ - [Troubleshooting Guide](/docs/self-hosting/maintenance/troubleshooting) for common issues+ </Accordion>+</Accordions>++<Callout type="info">+ Community support is provided on a best-effort basis by volunteers and Documenso team members. For+ guaranteed response times and dedicated support, consider the Enterprise Edition.+</Callout>++## Contributing Back++Contributions to Documenso are welcome and appreciated. You can contribute in several ways:++<Accordions type="multiple">+ <Accordion title="Code Contributions">+ 1. Fork the [Documenso repository](https://github.com/documenso/documenso)+ 2. Create a branch for your changes+ 3. Submit a pull request with a clear description+ 4. Respond to code review feedback++ All contributions are licensed under AGPL-3.0.++ </Accordion>+ <Accordion title="Other Contributions">+ - Report bugs with detailed reproduction steps+ - Suggest features through GitHub Discussions+ - Improve documentation+ - Help other users in Discord or GitHub Discussions+ - Translate the interface to other languages+ </Accordion>+ <Accordion title="Contributor Guidelines">+ Before contributing, review:++ - The [CONTRIBUTING.md](https://github.com/documenso/documenso/blob/main/CONTRIBUTING.md) file in the repository+ - Existing issues and discussions to avoid duplicates+ - The coding standards used in the project++ </Accordion>+</Accordions>++## When to Consider Enterprise Edition++The Community Edition is appropriate for many use cases. However, you may need the Enterprise Edition if you:++- Cannot comply with AGPL-3.0 source disclosure requirements+- Need to keep modifications proprietary+- Require dedicated support with guaranteed response times+- Need enterprise-specific features (SSO, advanced audit logs, etc.)+- Have corporate policies that prohibit AGPL-licensed software++See [Enterprise Edition](/docs/policies/enterprise-edition) for details on commercial licensing.++## Related++- [Licenses](/docs/policies/licenses) - Overview of both licensing options+- [Licenses](/docs/policies/licenses) - Detailed AGPL-3.0 explanation+- [Enterprise Edition](/docs/policies/enterprise-edition) - Commercial license details+- [Self-Hosting Guide](/docs/self-hosting) - Deploy your own instance+- [Support](/docs/policies/support) - All support options+- [Full AGPL-3.0 License Text](https://www.gnu.org/licenses/agpl-3.0.html) - Complete license terms+- [GitHub Repository](https://github.com/documenso/documenso) - Source code and LICENSE filediff --git a/apps/docs/content/docs/policies/enterprise-edition.mdx b/apps/docs/content/docs/policies/enterprise-edition.mdxnew file mode 100644index 000000000..c2a551b50--- /dev/null+++ b/apps/docs/content/docs/policies/enterprise-edition.mdx@@ -0,0 +1,244 @@+---+title: Enterprise Edition+description: Commercial license that removes AGPL-3.0 source code disclosure requirements, allowing organisations to integrate Documenso into proprietary products.+---++import { Accordion, Accordions } from 'fumadocs-ui/components/accordion';+import { Callout } from 'fumadocs-ui/components/callout';+import { Step, Steps } from 'fumadocs-ui/components/steps';+import { Tab, Tabs } from 'fumadocs-ui/components/tabs';++## When You Need Enterprise++The Enterprise Edition is required when you:++- **Build proprietary products**: Integrate Documenso into commercial software without releasing source code+- **Offer SaaS with modifications**: Provide document signing as part of your platform with custom modifications you want to keep private+- **Cannot comply with AGPL-3.0**: Corporate policies or legal requirements prohibit use of AGPL-licensed software+- **Need to keep modifications private**: Any changes to Documenso source code that you don't want to disclose++<Callout type="info">+ If you run Documenso without modifications, or your modifications are open source under AGPL-3.0,+ the Community Edition is sufficient.+</Callout>++### Common Use Cases++| Scenario | License Needed |+| -------------------------------------------- | ------------------ |+| Internal use without modifications | Community Edition |+| Internal use with private modifications | Enterprise Edition |+| SaaS product using Documenso API only | Community Edition |+| SaaS product with modified Documenso code | Enterprise Edition |+| White-label product with proprietary changes | Enterprise Edition |+| Open-source project under AGPL-3.0 | Community Edition |++## Features and Benefits++<Accordions type="multiple">+ <Accordion title="License Rights">+ The Enterprise license grants:++ - **No source disclosure**: Keep your modifications private. No obligation to share code with users or the public.+ - **Proprietary integration**: Embed Documenso in closed-source products without licensing conflicts.+ - **Sublicensing options**: Distribute Documenso as part of your product to your customers (terms vary by agreement).+ - **Perpetual use**: License terms that allow continued use of the licensed version.++ </Accordion>+ <Accordion title="Enterprise-Only Features">+ Enterprise licenses include access to features not available in the Community Edition:++ - Stripe Billing Module+ - Organisation Authentication Portal (SSO with SAML and OIDC)+ - Document Action Reauthentication (Passkeys and 2FA)+ - 21 CFR Part 11 Compliance+ - Email Domains (custom sender addresses)+ - Embed Authoring+ - Embed Authoring White Label+ - Custom signing certificates+ - Priority feature requests++ <Callout type="info">+ The canonical list of enterprise-gated features is maintained in the `packages/ee/FEATURES` file+ in the codebase. Features in the `packages/ee/` directory require an active Enterprise license.+ </Callout>++ </Accordion>+ <Accordion title="License Setup">+ 1. Acquire a license by contacting [sales](https://documen.so/enterprise)+ 2. Access your license key at [license.documenso.com](https://license.documenso.com)+ 3. Set the environment variable:++ ```bash+ NEXT_PRIVATE_DOCUMENSO_LICENSE_KEY="your-license-key-here"+ ```++ 4. Restart your Documenso instance+ 5. Verify the license is active in the **Admin Panel** under the **Stats** section++ </Accordion>+</Accordions>++## Licensing Terms++<Accordions type="multiple">+ <Accordion title="Grant of License">+ The Enterprise license is a commercial agreement between your organisation and Documenso. Key terms include:++ - **Scope**: License to use, modify, and distribute Documenso as specified in your agreement+ - **Exclusions**: The license does not grant rights to Documenso trademarks beyond what's specified+ - **Termination**: License remains valid as long as subscription is active and terms are followed++ </Accordion>+ <Accordion title="What the License Covers">+ - Documenso application code+ - Self-hosted deployments+ - Modifications and derivative works+ - Internal and external distribution (per agreement terms)+ </Accordion>+ <Accordion title="What the License Does Not Cover">+ - Third-party dependencies (these retain their original licenses)+ - Documenso Cloud service (separate subscription)+ - Professional services (available separately)+ </Accordion>+</Accordions>++## Pricing Model++Enterprise pricing is based on:++| Factor | Description |+| ------------------- | ----------------------------------- |+| **Deployment type** | Self-hosted or Documenso Cloud |+| **User count** | Number of users sending documents |+| **Volume** | Monthly document signing volume |+| **Support level** | Standard or premium support options |+| **Contract term** | Annual or multi-year agreements |++### Pricing Tiers++Contact [sales](https://documen.so/enterprise) for current pricing. Enterprise agreements typically include:++- Annual subscription billing+- Volume discounts for larger deployments+- Multi-year discount options+- Custom terms for specific requirements++<Callout type="warn">+ Pricing and terms are subject to change. Contact sales for current rates and availability.+</Callout>++## Support Included++Enterprise licenses include dedicated support beyond community channels.++<Tabs items={['Standard Enterprise Support', 'Premium Support Options']}>+<Tab value="Standard Enterprise Support">++- Email support with priority response+- Target response time within 4-8 business hours+- Deployment and configuration assistance+- Access to technical account resources++</Tab>+<Tab value="Premium Support Options">++Available as add-ons or with higher-tier plans:++- Dedicated support contact+- Scheduled calls for complex issues+- Implementation guidance+- Custom SLA agreements+- On-call support for critical issues++</Tab>+</Tabs>++See [Support](/docs/policies/support) for complete support options.++## How to Get Started++{/* prettier-ignore */}+<Steps>+ <Step>+ ### Evaluate your requirements++ Determine if you need the Enterprise Edition:++ - Review the [license comparison](/docs/policies/licenses) to understand AGPL-3.0 vs commercial license+ - Identify your use case from the scenarios above+ - List any enterprise features you require++ </Step>+ <Step>+ ### Contact sales++ Reach out to discuss your needs:++ - Email: [[email protected]](https://documen.so/enterprise)+ - Include: Organisation name, use case, estimated user count, deployment preference (self-hosted or cloud)++ </Step>+ <Step>+ ### Evaluation++ Options for evaluating Documenso before purchase:++ - Test with the Community Edition (same codebase, AGPL-3.0 license)+ - Request an evaluation license for Enterprise features+ - Schedule a demo with the sales team++ </Step>+ <Step>+ ### Agreement and deployment++ Once terms are agreed:++ 1. Sign the Enterprise license agreement+ 2. Receive license key and access credentials+ 3. Deploy using [self-hosting guides](/docs/self-hosting) or access Documenso Cloud+ 4. Configure Enterprise features with support assistance++ </Step>+ <Step>+ ### Ongoing++ - Renew subscription annually (or per agreement terms)+ - Access support channels for assistance+ - Receive updates and new features per your agreement++ </Step>+</Steps>++## Frequently Asked Questions++<Accordions type="multiple">+ <Accordion title="Can I switch from Community to Enterprise?">+ Yes. Your existing deployment can transition to the Enterprise license. Contact+ [sales](https://documen.so/enterprise) to discuss migration.+ </Accordion>+ <Accordion title="Does the Enterprise license include Documenso Cloud?">+ The license and cloud service are separate. Enterprise cloud plans include both the commercial+ license and hosted service. Self-hosted Enterprise licenses cover only the license rights.+ </Accordion>+ <Accordion title="What happens if I don't renew?">+ If you don't renew, you lose access to support and updates. Depending on your agreement terms,+ you may continue using the last licensed version or need to transition to the Community Edition+ (with AGPL-3.0 compliance).+ </Accordion>+ <Accordion title="Can I use Enterprise features with the Community Edition?">+ No. Enterprise-only features require an active Enterprise license. The Community Edition+ includes core document signing functionality.+ </Accordion>+ <Accordion title="Is there a trial period?">+ Contact [sales](https://documen.so/enterprise) to discuss evaluation options for your+ organisation.+ </Accordion>+</Accordions>++## Related++- [Community Edition](/docs/policies/community-edition) - AGPL-3.0 open-source license+- [Licenses](/docs/policies/licenses) - Complete licensing overview and FAQ+- [Support](/docs/policies/support) - Support channels and response times+- [Self-Hosting](/docs/self-hosting) - Deployment guides for self-hosted installationsdiff --git a/apps/docs/content/docs/policies/fair-use.mdx b/apps/docs/content/docs/policies/fair-use.mdxnew file mode 100644index 000000000..416597fcd--- /dev/null+++ b/apps/docs/content/docs/policies/fair-use.mdx@@ -0,0 +1,68 @@+---+title: Fair Use Policy+description: Fair use guidelines for Documenso Cloud to keep things sustainable for everyone.+---++import { Callout } from 'fumadocs-ui/components/callout';++We like to overdeliver, but we cannot overcommit.++Our plans are designed to be generous and flexible without forcing customers into rigid volume limits they may never use. Estimating usage at scale is hard, especially over short periods. This fair use policy exists to keep plans sustainable while allowing us to add more value wherever possible without overformalising restrictions.++We offer our plans without limits on signing or API volume because we want users and customers to make the most of their accounts. If you are on one of these plans, we ask you to abide by this fair use policy.++## Spirit of the Plan++Use the limitless plans as much as you like. They are meant to offer a lot. Please respect the spirit and intended scope of the account.++**What happens if I go beyond the scope of this policy?** We will ask you to upgrade to a fitting plan or custom pricing. We will not block your account without reaching out. You can message us with any questions.++### Do++- Sign as many documents as you need with the individual plan for your single business or organisation+- Use the API and automation tools to automate your signing workflows+- Experiment with plans and integrations while testing what you want to build++### Don't++- Use an individual account API to power a platform or product+- Run a large company signing thousands of documents per day on a small team plan+- Expect enterprise-level support on a fair support plan+- Overthink this policy — if you are a paying customer, we want you to win++## Rate Limits++API and application requests are rate-limited to protect service availability. Limits apply per user or API token.++When a limit is reached, requests return a `429 Too Many Requests` response with a `Retry-After` header indicating when to retry.++| Action | Limit | Window |+| --- | --- | --- |+| API requests (v1 and v2) | 100 requests | 1 minute |+| File uploads | 20 requests | 1 minute |+| AI features | 3 requests | 1 minute |++Authentication endpoints (login, signup, password reset, etc.) are also rate-limited to protect against abuse.++<Callout type="info">+ Rate limits may vary by plan. Enterprise plans can include higher or custom limits. Contact+ [sales](https://documen.so/sales) for details.+</Callout>++<Callout type="info">+ Self-hosted deployments can configure their own rate limits. You control all limits based on your+ infrastructure capacity. See [Self-Hosting](/docs/self-hosting) for deployment options.+</Callout>++## Fair Support++Fair support includes reasonable application-level help for self-hosted users. We will help you get unstuck and point you in the right direction when issues come up. Support is provided in good faith and within reasonable time and effort limits.++We are not your operations team and cannot take responsibility for running, monitoring, or maintaining your infrastructure.++If you are unsure whether something falls within fair use or fair support, reach out. We are happy to talk it through.++## Related++- [Enterprise Edition](/docs/policies/enterprise-edition) - Commercial licensing and custom limits+- [Self-Hosting](/docs/self-hosting) - Deploy without cloud-imposed limitsdiff --git a/apps/docs/content/docs/policies/index.mdx b/apps/docs/content/docs/policies/index.mdxnew file mode 100644index 000000000..b33a76036--- /dev/null+++ b/apps/docs/content/docs/policies/index.mdx@@ -0,0 +1,47 @@+---+title: Policies+description: License, privacy, terms, and support information+---++<Cards>+ <Card+ title="License"+ description="AGPL-3.0 license terms and what they mean for you."+ href="/docs/policies/licenses"+ />+ <Card+ title="Privacy Policy"+ description="How Documenso collects, uses, and protects your data."+ href="/docs/policies/privacy"+ />+ <Card+ title="Terms of Service"+ description="Terms governing your use of Documenso."+ href="/docs/policies/terms"+ />+ <Card+ title="Security"+ description="Security practices and vulnerability disclosure."+ href="/docs/policies/security"+ />+ <Card+ title="Support"+ description="Getting help and available support options."+ href="/docs/policies/support"+ />+</Cards>++## Full Legal Documents++The complete legal documents are available on the main Documenso website:++- [Privacy Policy](https://documenso.com/privacy)+- [Terms of Service](https://documenso.com/terms)++The pages in this documentation provide summaries and practical guidance. For binding legal terms, refer to the full documents linked above.++---++## Related++- [Compliance](/docs/compliance) - Electronic signature standards and regulationsdiff --git a/apps/docs/content/docs/policies/licenses.mdx b/apps/docs/content/docs/policies/licenses.mdxnew file mode 100644index 000000000..a8fc5d78e--- /dev/null+++ b/apps/docs/content/docs/policies/licenses.mdx@@ -0,0 +1,173 @@+---+title: Licenses+description: Documenso uses a dual licensing model with an open-source AGPL-3.0 license (Community Edition) and a commercial license (Enterprise Edition).+---++import { Accordion, Accordions } from 'fumadocs-ui/components/accordion';+import { Callout } from 'fumadocs-ui/components/callout';+import { Tab, Tabs } from 'fumadocs-ui/components/tabs';++## Dual Licensing Overview++| Aspect | Community Edition | Enterprise Edition |+| ----------------------------- | --------------------------------------------------------- | ------------------------------------------------------------- |+| **License** | AGPL-3.0 | Commercial |+| **Cost** | Free | Paid |+| **Source code disclosure** | Required for network use | Not required |+| **Proprietary modifications** | Not permitted | Permitted |+| **Support** | Community | Dedicated |+| **Use case** | Open-source projects, internal tools with AGPL compliance | Commercial products, SaaS offerings, proprietary integrations |++<Tabs items={['Community Edition', 'Enterprise Edition']}>+<Tab value="Community Edition">++## Community Edition (AGPL-3.0)++The Community Edition is licensed under the GNU Affero General Public License version 3 (AGPL-3.0). This is a copyleft license that preserves software freedom.++### What AGPL-3.0 Allows++- Use Documenso for any purpose, including commercial use+- Access, study, and modify the source code+- Distribute copies of the original or modified software+- Self-host Documenso on your own infrastructure++### What AGPL-3.0 Requires++The AGPL-3.0 has specific requirements that apply when you modify or distribute Documenso:++**Source Code Disclosure**: If you modify Documenso and make it available over a network, you must provide access to the complete source code of your modified version under AGPL-3.0.++**Attribution**: You must keep all copyright notices intact and include a copy of the AGPL-3.0 license with any distribution.++**Same License**: Derivative works must be licensed under AGPL-3.0.++<Callout type="info">+ The "network clause" is the distinguishing feature of AGPL-3.0. Unlike GPL-3.0, AGPL-3.0 treats+ network access as distribution. If users interact with your modified Documenso instance over a+ network, you must provide them access to the source code.+</Callout>++### When to Use Community Edition++The Community Edition is appropriate when you:++- Are building an open-source project+- Can comply with AGPL-3.0 requirements+- Use Documenso internally without modifications+- Want to contribute to the open-source ecosystem+- Do not need to keep modifications proprietary++See [Community Edition](/docs/policies/community-edition) for complete details.++</Tab>+<Tab value="Enterprise Edition">++## Enterprise Edition (Commercial License)++The Enterprise Edition provides a commercial license that removes the AGPL-3.0 requirements. This allows organisations to use, modify, and integrate Documenso without source code disclosure obligations.++### What the Enterprise License Provides++**No Source Code Disclosure**: Keep your modifications private. You are not required to share changes with users or the public.++**Proprietary Integration**: Integrate Documenso into proprietary products and services without licensing conflicts.++**Commercial Support**: Access to dedicated support channels and SLAs.++**Additional Features**: Enterprise-specific features not available in the Community Edition.++### When to Use Enterprise Edition++The Enterprise Edition is appropriate when you:++- Build commercial products that incorporate Documenso+- Offer document signing as part of a SaaS platform+- Cannot or prefer not to open-source your modifications+- Need to comply with corporate policies that prohibit AGPL software+- Require dedicated support and SLAs++<Callout type="warn">+ If you modify Documenso and provide network access to users (internal or external) without+ complying with AGPL-3.0 source disclosure requirements, you need an Enterprise license.+</Callout>++See [Enterprise Edition](/docs/policies/enterprise-edition) for complete details and pricing.++</Tab>+</Tabs>++## Choosing the Right License++Use this decision tree to determine which license fits your needs:++<Accordions type="multiple">+ <Accordion title="Do you modify Documenso?">+ **No modifications**: Both licenses work. Community Edition is free and sufficient if you run Documenso as-is.++ **Yes, with modifications**: Continue to the next question.++ </Accordion>+ <Accordion title="Are your modifications available as open source?">+ **Yes, under AGPL-3.0**: Community Edition is appropriate. Your modifications must be available to users who access your instance.++ **No, modifications are proprietary**: Enterprise Edition is required.++ </Accordion>+ <Accordion title="Are you embedding Documenso in a commercial product?">+ **Open-source product under AGPL-3.0**: Community Edition is appropriate.++ **Proprietary product**: Enterprise Edition is required.++ </Accordion>+ <Accordion title="Internal use only?">+ Using Documenso internally without providing network access to external users does not trigger AGPL-3.0 distribution requirements. However, if your organisation has policies against AGPL software or you make modifications you want to keep private, consider the Enterprise Edition.+ </Accordion>+</Accordions>++## License FAQ++<Accordions type="multiple">+ <Accordion title="Can I use the Community Edition for commercial purposes?">+ Yes. AGPL-3.0 permits commercial use. You must comply with the license terms, including source+ code disclosure if you modify and distribute or provide network access.+ </Accordion>+ <Accordion title="Does using the Documenso API require a commercial license?">+ No. Calling the Documenso API from your application does not create a derivative work. Your+ application remains under your chosen license. However, if you modify Documenso itself and+ provide network access, AGPL-3.0 requirements apply.+ </Accordion>+ <Accordion title='What counts as a "modification" under AGPL-3.0?'>+ Modifying the source code, forking the repository and making changes, or linking Documenso+ libraries into your application in a way that creates a combined work. Configuration changes and+ using Documenso through its API are not modifications.+ </Accordion>+ <Accordion title="Can I white-label Documenso?">+ You can change branding for your deployment under both licenses. Under AGPL-3.0, you must retain+ copyright notices and license information in the source code. Under the Enterprise license, you+ have more flexibility with branding requirements.+ </Accordion>+ <Accordion title="Do signed documents fall under the license?">+ No. The license applies to the software, not content created with the software. Documents you+ sign are your property and are not subject to AGPL-3.0.+ </Accordion>+ <Accordion title="What happens if I switch from Community to Enterprise Edition?">+ Your existing deployments can transition to the Enterprise license. Contact+ [sales](https://documen.so/enterprise) to discuss migration.+ </Accordion>+ <Accordion title="Can I contribute to Documenso under the Enterprise license?">+ Contributions to the main Documenso repository are licensed under AGPL-3.0. The Enterprise+ license applies only to your private use and modifications.+ </Accordion>+ <Accordion title="Is there a trial for the Enterprise Edition?">+ Contact [sales](https://documen.so/enterprise) to discuss evaluation options.+ </Accordion>+</Accordions>++## Related++- [Licenses](/docs/policies/licenses) - Detailed AGPL-3.0 license explanation+- [Community Edition](/docs/policies/community-edition) - Open-source edition details+- [Enterprise Edition](/docs/policies/enterprise-edition) - Commercial license details+- [Full AGPL-3.0 License Text](https://www.gnu.org/licenses/agpl-3.0.html) - Complete license terms+- [GitHub Repository](https://github.com/documenso/documenso) - Source code and LICENSE filediff --git a/apps/docs/content/docs/policies/meta.json b/apps/docs/content/docs/policies/meta.jsonnew file mode 100644index 000000000..14ba43d70--- /dev/null+++ b/apps/docs/content/docs/policies/meta.json@@ -0,0 +1,13 @@+{+ "title": "Policies",+ "pages": [+ "licenses",+ "community-edition",+ "enterprise-edition",+ "fair-use",+ "privacy",+ "terms",+ "security",+ "support"+ ]+}diff --git a/apps/docs/content/docs/policies/privacy.mdx b/apps/docs/content/docs/policies/privacy.mdxnew file mode 100644index 000000000..9e5fd1224--- /dev/null+++ b/apps/docs/content/docs/policies/privacy.mdx@@ -0,0 +1,6 @@+---+title: Privacy Policy+description: How Documenso collects, uses, and protects your data.+---++Our full Privacy Policy is available at [documenso.com/privacy](https://documenso.com/privacy).diff --git a/apps/docs/content/docs/policies/security.mdx b/apps/docs/content/docs/policies/security.mdxnew file mode 100644index 000000000..d1a57bbdb--- /dev/null+++ b/apps/docs/content/docs/policies/security.mdx@@ -0,0 +1,242 @@+---+title: Security+description: Security practices for Documenso Cloud and self-hosted deployments, along with our vulnerability disclosure process.+---++import { Accordion, Accordions } from 'fumadocs-ui/components/accordion';+import { Callout } from 'fumadocs-ui/components/callout';+import { Tab, Tabs } from 'fumadocs-ui/components/tabs';++## Security Practices++<Accordions type="multiple">+ <Accordion title="Development Security">+ - **Code review**: All code changes require review before merging - **Dependency management**:+ Dependencies are regularly updated and monitored for vulnerabilities - **Static analysis**:+ Automated security scanning is part of the CI/CD pipeline - **Open source**: The codebase is+ publicly available for security review at+ [github.com/documenso/documenso](https://github.com/documenso/documenso)+ </Accordion>+ <Accordion title="Access Controls">+ - **Role-based access**: Teams support member, manager, and admin roles with distinct+ permissions - **API token scoping**: API tokens can be scoped to specific teams and set with+ expiration dates - **Session management**: Users can view and revoke active sessions - **Audit+ logging**: Document actions are logged with timestamps and IP addresses+ </Accordion>+</Accordions>++## Infrastructure Security++### Documenso Cloud++The hosted cloud service uses the following security measures:++| Layer | Implementation |+| -------------- | ------------------------------------------------------ |+| **Hosting** | Infrastructure hosted in EU data centers |+| **Network** | TLS 1.2+ for all connections |+| **Database** | Managed PostgreSQL with automated backups |+| **Storage** | Encrypted object storage for documents |+| **Monitoring** | 24/7 infrastructure monitoring and alerting |+| **Updates** | Regular security patches applied to all infrastructure |++### Self-Hosted++Self-hosted deployments are responsible for their own infrastructure security. See [Self-Hosted Security Considerations](#self-hosted-security-considerations) below.++## Data Encryption++<Accordions type="multiple">+ <Accordion title="Encryption in Transit">+ All data transmitted to and from Documenso is encrypted using TLS 1.2 or higher. This includes:++ - Web application traffic+ - API requests+ - Email delivery (when supported by the receiving server)+ - Webhook payloads++ </Accordion>+ <Accordion title="Encryption at Rest">+ For Documenso Cloud:++ - Database contents are encrypted at rest+ - Document storage uses encrypted object storage+ - Backups are encrypted++ For self-hosted deployments, encryption at rest depends on your infrastructure configuration.++ </Accordion>+ <Accordion title="Application-Level Encryption">+ Documenso encrypts sensitive data at the application level:++ - Encryption keys are configured via `NEXT_PRIVATE_ENCRYPTION_KEY` and `NEXT_PRIVATE_ENCRYPTION_SECONDARY_KEY`+ - Session tokens are signed using `NEXTAUTH_SECRET`+ - Passwords are hashed using bcrypt++ </Accordion>+</Accordions>++## Authentication Security++### Supported Authentication Methods++| Method | Description |+| ----------------------------- | ------------------------------------------------ |+| **Email and password** | Traditional authentication with hashed passwords |+| **OAuth providers** | Google and Microsoft authentication |+| **Generic OIDC** | Any OpenID Connect provider |+| **Team SSO** | SAML-based single sign-on for enterprise teams |+| **Two-factor authentication** | TOTP-based 2FA with recovery codes |+| **Passkeys** | WebAuthn-based passwordless authentication |++### Password Requirements++- Minimum length enforced+- Passwords are hashed using bcrypt before storage+- Password reset tokens are time-limited and single-use++### Session Security++- Sessions can be viewed and revoked from account settings+- Session tokens are rotated on authentication events+- Idle sessions expire after a configurable period++## Vulnerability Disclosure++Documenso operates a responsible disclosure process for security vulnerabilities.++<Accordions type="multiple">+ <Accordion title="Reporting a Vulnerability">+ If you discover a security vulnerability, please report it by emailing:++ **[email protected]**++ Include the following information:++ - Description of the vulnerability+ - Steps to reproduce+ - Potential impact+ - Any suggested fixes (optional)++ </Accordion>+ <Accordion title="Response Timeline">+ | Stage | Timeline |+ | --------------------- | ------------------- |+ | **Acknowledgment** | Within 48 hours |+ | **Initial triage** | Within 5 days |+ | **Status update** | Within 10 days |+ | **Resolution target** | Depends on severity |+ </Accordion>+ <Accordion title="Scope">+ <Tabs items={['In scope', 'Out of scope']}>+ <Tab value="In scope">++The following are in scope for vulnerability reports:++- Documenso application code+- Authentication and authorization flaws+- Data exposure vulnerabilities+- Injection vulnerabilities+- Cross-site scripting (XSS)+- Cross-site request forgery (CSRF)++</Tab>+<Tab value="Out of scope">++The following are out of scope:++- Social engineering attacks+- Denial of service attacks+- Issues in third-party dependencies (report to the upstream project)+- Issues requiring physical access to a user's device+- Theoretical vulnerabilities without proof of concept++</Tab>+</Tabs>++ </Accordion>+ <Accordion title="Recognition">+ We acknowledge security researchers who responsibly disclose vulnerabilities. With your permission, we will credit you when the fix is released.+ </Accordion>+</Accordions>++<Callout type="warn">+ Do not publicly disclose vulnerabilities until they have been addressed. Public disclosure of+ unpatched vulnerabilities puts users at risk.+</Callout>++## Security Updates++### Notification++Security updates are announced through:++- [GitHub releases](https://github.com/documenso/documenso/releases)+- [GitHub security advisories](https://github.com/documenso/documenso/security/advisories)++### Update Policy++- Critical vulnerabilities are patched as quickly as possible+- Security patches are backported to supported versions when feasible+- Release notes include security-related changes++### Staying Updated++For self-hosted deployments:++1. Watch the [GitHub repository](https://github.com/documenso/documenso) for releases+2. Subscribe to security advisories+3. Apply updates promptly, especially security patches++See [Upgrades](/docs/self-hosting/maintenance/upgrades) for update procedures.++## Self-Hosted Security Considerations++When self-hosting Documenso, you are responsible for the security of your deployment. The following recommendations apply:++<Accordions type="multiple">+ <Accordion title="Infrastructure">+ - **Use HTTPS**: Configure TLS certificates for all traffic - **Firewall rules**: Restrict+ access to necessary ports only - **Network isolation**: Place the database on a private network+ - **Regular updates**: Keep the host OS and dependencies updated+ </Accordion>+ <Accordion title="Configuration">+ - **Strong secrets**: Generate cryptographically random values for: - `NEXTAUTH_SECRET` -+ `NEXT_PRIVATE_ENCRYPTION_KEY` - `NEXT_PRIVATE_ENCRYPTION_SECONDARY_KEY` - **Database security**:+ Use strong passwords and restrict database access - **Environment variables**: Store secrets+ securely (do not commit to version control)+ </Accordion>+ <Accordion title="Operations">+ - **Backups**: Implement regular encrypted backups - **Monitoring**: Set up logging and alerting+ for security events - **Access control**: Limit who has access to the server and database -+ **Incident response**: Have a plan for responding to security incidents+ </Accordion>+ <Accordion title="Signing Certificates">+ - Store signing certificates securely - Use hardware security modules (HSM) for high-security+ requirements - Rotate certificates according to your security policy+ </Accordion>+</Accordions>++See [Environment Variables](/docs/self-hosting/configuration/environment) for security-related configuration options.++<Callout type="info">+ Self-hosted deployments have full control over security but also full responsibility. Consider+ your organisation's security requirements and compliance obligations when configuring your+ deployment.+</Callout>++## Contact++For security-related inquiries:++- **Security vulnerabilities**: [email protected]+- **General questions**: [email protected]+- **GitHub**: [github.com/documenso/documenso](https://github.com/documenso/documenso)++## Related++- [Security Settings](/docs/users/settings/security) - Account security configuration+- [Privacy Policy](/docs/policies/privacy) - Data handling practices+- [GDPR](/docs/compliance/gdpr) - Data protection compliance+- [Self-Hosting](/docs/self-hosting) - Deploy on your own infrastructure+- [Environment Variables](/docs/self-hosting/configuration/environment) - Configuration referencediff --git a/apps/docs/content/docs/policies/support.mdx b/apps/docs/content/docs/policies/support.mdxnew file mode 100644index 000000000..2b8e846c3--- /dev/null+++ b/apps/docs/content/docs/policies/support.mdx@@ -0,0 +1,240 @@+---+title: Support+description: Support channels and options available depending on your needs and subscription level.+---++import { Callout } from 'fumadocs-ui/components/callout';+import { Step, Steps } from 'fumadocs-ui/components/steps';+import { Tab, Tabs } from 'fumadocs-ui/components/tabs';++## Support Channels++| Channel | Availability | Best For |+| --------------------------- | ------------ | --------------------------------------- |+| Community (Discord, GitHub) | All users | General questions, community discussion |+| Email Support | Paid plans | Account issues, billing questions |+| Priority Support | Enterprise | Urgent issues, dedicated assistance |++## Community Support++Community support is available to all users, including those on free plans and self-hosted deployments.++<Tabs items={['Discord', 'GitHub']}>+<Tab value="Discord">++Join the Documenso Discord server to:++- Ask questions and get help from the community+- Share feedback and feature requests+- Connect with other Documenso users+- Stay updated on announcements++Discord is best for general questions and discussions. Response times vary based on community availability.++</Tab>+<Tab value="GitHub">++Use GitHub for technical discussions and bug reports:++- **[GitHub Discussions](https://github.com/documenso/documenso/discussions)**: Ask questions, share ideas, and discuss features+- **[GitHub Issues](https://github.com/documenso/documenso/issues)**: Report confirmed bugs with reproducible steps++When opening an issue, include:++1. Documenso version+2. Deployment method (Cloud, self-hosted Docker, Kubernetes, etc.)+3. Steps to reproduce the problem+4. Expected vs actual behavior+5. Relevant logs (with sensitive information redacted)++</Tab>+</Tabs>++<Callout type="warn">+ Do not report security vulnerabilities through public GitHub issues. See the [Security+ Issues](#security-issues) section below.+</Callout>++## Paid Support Tiers++Paid plans include access to direct support from the Documenso team.++<Tabs items={['Standard Support', 'Platform and Above', 'Enterprise Support']}>+<Tab value="Standard Support">++Available on paid subscription plans:++- Email support at [email protected]+- Account and billing assistance+- Technical guidance for Documenso Cloud usage+- Response during business hours++</Tab>+<Tab value="Platform and Above">++Available on [Platform plans](https://documen.so/platform-cta-pricing) and above:++- All standard support channels+- Private Discord channel for direct communication with the Documenso team+- Private Slack workspace for closer collaboration++</Tab>+<Tab value="Enterprise Support">++Available with Enterprise subscriptions:++- All Platform support channels+- Priority response times+- Dedicated support contact+- Assistance with deployment and integration+- Custom configuration guidance+- Scheduled calls for complex issues++Contact [sales](https://documen.so/enterprise) for Enterprise support options.++</Tab>+</Tabs>++<Callout type="info">+ If you prefer Discord or Slack, contact support to be invited to a private channel or workspace.+</Callout>++## Self-Hosted Support++Self-hosted deployments have access to community support through Discord and GitHub. The following resources are available:++- [Self-Hosting Documentation](/docs/self-hosting) - Setup and configuration guides+- [Troubleshooting Guide](/docs/self-hosting/maintenance/troubleshooting) - Common issues and solutions+- [GitHub Discussions](https://github.com/documenso/documenso/discussions) - Community Q&A++<Callout type="info">+ Enterprise licenses for self-hosted deployments can include dedicated support. Contact+ [sales](https://documen.so/enterprise) for details.+</Callout>++## Response Times++Response times depend on the support channel and plan:++| Plan | Channel | Target Response Time |+| ------------------ | --------------------------- | ------------------------- |+| Free / Self-Hosted | Community (Discord, GitHub) | Best effort |+| Paid Plans | Email | 1-2 business days |+| Enterprise | Priority Support | Within 4-8 business hours |++Response times are targets, not guarantees. Actual times may vary based on issue complexity and volume.++## What's Included++<Tabs items={['Included', 'Not included']}>+<Tab value="Included">++- Guidance on Documenso features and functionality+- Help with configuration and settings+- Troubleshooting application errors+- Account and billing questions (paid plans)+- Bug reports and issue investigation+- Upgrade assistance++</Tab>+<Tab value="Not included">++- Custom development or code modifications+- Third-party integration development+- Infrastructure setup (servers, databases, networking)+- Training sessions (available separately)+- Support for modified or forked versions++</Tab>+</Tabs>++<Callout type="info">+ Professional services for custom development, training, and dedicated implementation support are+ available separately. Contact [sales](https://documen.so/sales) for details.+</Callout>++## Escalation Process++If your issue is not resolved through initial support channels:++{/* prettier-ignore */}+<Steps>+ <Step>+ ### Community support++ If you don't receive a response on Discord or GitHub within a reasonable time, try the other channel or provide additional details.++ </Step>+ <Step>+ ### Email support++ Reply to your existing support thread with additional information. Avoid opening duplicate tickets.++ </Step>+ <Step>+ ### Request escalation++ For urgent issues on paid plans, request escalation in your support email.++ </Step>+ <Step>+ ### Enterprise customers++ Contact your dedicated support representative directly.++ </Step>+</Steps>++For billing disputes or account issues, email [email protected] with your account details.++## Security Issues++Do not report security vulnerabilities through public channels (GitHub Issues, Discord, etc.).++{/* prettier-ignore */}+<Steps>+ <Step>+ ### Email the security team++ Email [email protected].++ </Step>+ <Step>+ ### Include details++ Include a detailed description of the vulnerability.++ </Step>+ <Step>+ ### Provide steps to reproduce++ Provide steps to reproduce if possible.++ </Step>+ <Step>+ ### Allow time for investigation++ Allow time for investigation before public disclosure.++ </Step>+</Steps>++Documenso follows responsible disclosure practices. Security researchers who report valid vulnerabilities responsibly will be acknowledged.++## Contact++| Purpose | Contact |+| ---------------- | -------------------------------------------------------------- |+| General support | [email protected] |+| Security issues | [email protected] |+| Enterprise sales | [[email protected]](https://documen.so/enterprise) |+| Privacy requests | [email protected] |+| Community | [Discord](https://documen.so/discord) |+| Bug reports | [GitHub Issues](https://github.com/documenso/documenso/issues) |++## Related++- [Troubleshooting](/docs/self-hosting/maintenance/troubleshooting) - Self-hosted issue resolution+- [Self-Hosting](/docs/self-hosting) - Deployment and configuration guides+- [Enterprise Edition](/docs/policies/enterprise-edition) - Commercial licensing options+- [Privacy Policy](/docs/policies/privacy) - How Documenso handles your datadiff --git a/apps/docs/content/docs/policies/terms.mdx b/apps/docs/content/docs/policies/terms.mdxnew file mode 100644index 000000000..e8f11614a--- /dev/null+++ b/apps/docs/content/docs/policies/terms.mdx@@ -0,0 +1,6 @@+---+title: Terms of Service+description: The terms that govern your use of Documenso.+---++Our full Terms of Service are available at [documenso.com/terms](https://documenso.com/terms).diff --git a/apps/docs/content/docs/self-hosting/configuration/advanced/ai-features.mdx b/apps/docs/content/docs/self-hosting/configuration/advanced/ai-features.mdxnew file mode 100644index 000000000..d2979910b--- /dev/null+++ b/apps/docs/content/docs/self-hosting/configuration/advanced/ai-features.mdx@@ -0,0 +1,106 @@+---+title: AI Recipient & Field Detection (Self-hosting)+description: Configure Google Vertex AI so Documenso can detect recipients and fields automatically.+---++import { Accordion, Accordions } from 'fumadocs-ui/components/accordion';+import { Callout } from 'fumadocs-ui/components/callout';+import { Step, Steps } from 'fumadocs-ui/components/steps';++## Overview++This guide covers how to enable the AI recipient and field detection features when you self-host Documenso.++## What This Enables++- Detect recipients from uploaded PDFs (roles, names, emails when present).+- Detect and place fields (signature, initials, name, email, date, text, number, radio, checkbox) onto draft envelopes.+- Built-in rate limits (3 requests per minute per IP) to prevent abuse.++## Prerequisites++- A Google Cloud project with the **Vertex AI API** enabled and billing active.+- A **Vertex AI Express API key** with access to Gemini models (create via the [Vertex AI Express flow](https://cloud.google.com/vertex-ai/generative-ai/docs/start/express-mode/overview) and manage keys in [API keys](https://cloud.google.com/vertex-ai/generative-ai/docs/start/api-keys)).+- Documenso version that includes the AI detection feature and the corresponding database migration.++## Configure Environment Variables++Add these variables to your deployment `.env` (or secret manager):++```+GOOGLE_VERTEX_PROJECT_ID="<your-gcp-project-id>"+GOOGLE_VERTEX_API_KEY="<your-vertex-api-key>"+# Optional, defaults to "global"+GOOGLE_VERTEX_LOCATION="global"+```++<Callout type="info">+ Use a region close to your users if you need data residency considerations (e.g. `europe-west1`).+ If you omit the location, Documenso uses `global`. Not all models are available in every region;+ if a model is unavailable, switch to a supported region.+</Callout>++## Deploy with the Published Container++- Use the official Documenso image (DockerHub or GHCR) and supply the Vertex env vars above.+- Ensure migrations run on startup (the container runs `prisma migrate deploy` in production mode).+- Restart the container after adding or changing Vertex env vars.++## Enable the Feature in Documenso++Once the service is running with the Vertex env vars:++{/* prettier-ignore */}+<Steps>+<Step>+### Organisation settings++Go to **Settings** → **Document Preferences** → **AI Features** and set to **Enabled**.++Teams that inherit organisation defaults will get this automatically.++</Step>+<Step>+### Team settings++If a team overrides organisation defaults:++- Go to **Team Settings** → **Document Preferences** → **AI Features**+- Choose **Enabled**, or **Inherit** to follow the organisation++</Step>+<Step>+### Verify in the editor++Open a draft envelope and check:++- **Recipients**: sparkle button for AI detection is visible+- **Fields**: **Detect with AI** is available++</Step>+</Steps>++## Troubleshooting++<Accordions type="multiple">+ <Accordion title="Too many requests">+ Wait a minute or two and retry (rate limit is 3/min per IP).+ </Accordion>+ <Accordion title="AI options hidden">+ Ensure the env vars are set, the server was restarted after setting them, and+ `aiFeaturesEnabled` is enabled at organisation/team level.+ </Accordion>+ <Accordion title="Detection fails immediately">+ Confirm the Vertex API key is valid and the project has Vertex AI enabled. Check server logs for+ status codes from Vertex.+ </Accordion>+</Accordions>++If issues persist, recheck env vars, restart the service, and confirm the Prisma migration was applied.++---++## See Also++- [AI Detection (User Guide)](/docs/users/documents/advanced/ai-detection) - How to use AI detection features+- [Environment Variables](/docs/self-hosting/configuration/environment) - All configuration optionsdiff --git a/apps/docs/content/docs/self-hosting/configuration/advanced/index.mdx b/apps/docs/content/docs/self-hosting/configuration/advanced/index.mdxnew file mode 100644index 000000000..e00698d9d--- /dev/null+++ b/apps/docs/content/docs/self-hosting/configuration/advanced/index.mdx@@ -0,0 +1,17 @@+---+title: Advanced+description: Optional configuration for OAuth providers, AI features, and other advanced settings.+---++<Cards>+ <Card+ title="OAuth Providers"+ description="Configure Google, GitHub, and OIDC authentication."+ href="/docs/self-hosting/configuration/advanced/oauth-providers"+ />+ <Card+ title="AI Features"+ description="Enable AI-powered recipient and field detection."+ href="/docs/self-hosting/configuration/advanced/ai-features"+ />+</Cards>diff --git a/apps/docs/content/docs/self-hosting/configuration/advanced/meta.json b/apps/docs/content/docs/self-hosting/configuration/advanced/meta.jsonnew file mode 100644index 000000000..5278c14a3--- /dev/null+++ b/apps/docs/content/docs/self-hosting/configuration/advanced/meta.json@@ -0,0 +1,4 @@+{+ "title": "Advanced",+ "pages": ["oauth-providers", "ai-features"]+}diff --git a/apps/docs/content/docs/self-hosting/configuration/advanced/oauth-providers.mdx b/apps/docs/content/docs/self-hosting/configuration/advanced/oauth-providers.mdxnew file mode 100644index 000000000..abb7dd558--- /dev/null+++ b/apps/docs/content/docs/self-hosting/configuration/advanced/oauth-providers.mdx@@ -0,0 +1,155 @@+---+title: Setting up OAuth Providers+description: Learn how to set up OAuth providers for your own instance of Documenso.+---++import { Step, Steps } from 'fumadocs-ui/components/steps';++## Google OAuth (Gmail)++To use Google OAuth, you will need to create a Google Cloud Platform project and enable the Google Identity and Access Management (IAM) API. You will also need to create a new OAuth client ID and download the client secret.++### Create and configure a new OAuth client ID++{/* prettier-ignore */}+<Steps>+<Step>+### Open Google Cloud Console++Go to the [Google Cloud Platform Console](https://console.cloud.google.com/) and select a project or create a new one from the projects list.++</Step>+<Step>+### Open APIs & services++From the console's left side menu, select **APIs & services** (if not already open).++</Step>+<Step>+### Open Credentials++On the left, click **Credentials**.++</Step>+<Step>+### Create OAuth client ID++Click **New Credentials**, then select **OAuth client ID**. When prompted, select **Web application**.++</Step>+<Step>+### Name and create the client++Enter a name for your client ID and click **Create**. Click the download button to download the client secret.++</Step>+<Step>+### Set authorized origins and redirect URIs++Set:++- **Authorized JavaScript origins**: `https://<documenso-domain>`+- **Authorized redirect URIs**: `https://<documenso-domain>/api/auth/callback/google`++</Step>+<Step>+### Set environment variables++In your Documenso environment, set:++```+NEXT_PRIVATE_GOOGLE_CLIENT_ID=<your-client-id>+NEXT_PRIVATE_GOOGLE_CLIENT_SECRET=<your-client-secret>+```++</Step>+</Steps>++Finally verify sign-in with Google by signing in with your Google account and checking the email address in your profile.++## Microsoft OAuth (Azure AD)++To use Microsoft OAuth, you will need to create an Azure AD application registration in the Microsoft Azure portal. This will allow users to sign in with their Microsoft accounts.++### Create and configure a new Azure AD application++{/* prettier-ignore */}+<Steps>+<Step>+### Open Azure Portal++Go to the [Azure Portal](https://portal.azure.com/) and navigate to **Azure Active Directory** (or **Microsoft Entra ID** in newer portals).++</Step>+<Step>+### Start app registration++In the left sidebar, click **App registrations**, then **New registration**.++</Step>+<Step>+### Name and choose account types++Enter a name (e.g. "Documenso").++Under **Supported account types**, select both:++- Accounts in any organizational directory (Any Azure AD directory - Multitenant)+- Personal Microsoft accounts (e.g. Skype, Xbox)++This allows any Microsoft account to sign in.++</Step>+<Step>+### Set redirect URI and register++Under **Redirect URI**, select **Web** and enter:++```bash+https://<documenso-domain>/api/auth/callback/microsoft+```++Click **Register**.++</Step>+</Steps>++### Configure the application++{/* prettier-ignore */}+<Steps>+<Step>+### Copy the Application (client) ID++After registration you're on the app overview page. Copy the **Application (client) ID** for `NEXT_PRIVATE_MICROSOFT_CLIENT_ID`.++</Step>+<Step>+### Create a client secret++- In the left sidebar, click **Certificates & secrets**+- Under **Client secrets**, click **New client secret**+- Add a description and select an expiration period, then click **Add**+- Copy the **Value** (not the Secret ID): this is your `NEXT_PRIVATE_MICROSOFT_CLIENT_SECRET`++</Step>+<Step>+### Set environment variables++In your Documenso environment, set:++```+NEXT_PRIVATE_MICROSOFT_CLIENT_ID=<your-application-client-id>+NEXT_PRIVATE_MICROSOFT_CLIENT_SECRET=<your-client-secret-value>+```++</Step>+</Steps>++---++## See Also++- [Environment Variables](/docs/self-hosting/configuration/environment) - All configuration options+- [Single Sign-On](/docs/users/organisations/single-sign-on) - Configure SSO for your organisation+- [Microsoft Entra ID](/docs/users/organisations/single-sign-on/microsoft-entra-id) - Detailed Entra ID setup guidediff --git a/apps/docs/content/docs/self-hosting/configuration/database.mdx b/apps/docs/content/docs/self-hosting/configuration/database.mdxnew file mode 100644index 000000000..a9cc1d93f--- /dev/null+++ b/apps/docs/content/docs/self-hosting/configuration/database.mdx@@ -0,0 +1,490 @@+---+title: Database Configuration+description: Configure PostgreSQL connection strings, pooling, SSL, migrations, and performance tuning for your Documenso deployment.+---++import { Accordion, Accordions } from 'fumadocs-ui/components/accordion';+import { Callout } from 'fumadocs-ui/components/callout';+import { Tab, Tabs } from 'fumadocs-ui/components/tabs';++## Supported Databases++Documenso requires **PostgreSQL 14 or later**. No other databases are supported.++PostgreSQL provides the reliability, performance, and feature set required for document signing workflows, including:++- ACID compliance for transaction integrity+- JSON support for flexible metadata storage+- Full-text search capabilities+- Robust backup and replication options++## Connection String Format++PostgreSQL connection strings follow this format:++```+postgresql://[user]:[password]@[host]:[port]/[database]?[parameters]+```++### Components++| Component | Description | Example |+| ------------ | ------------------------------- | ----------------- |+| `user` | Database username | `documenso` |+| `password` | Database password (URL-encoded) | `secretpass` |+| `host` | Database server hostname or IP | `localhost` |+| `port` | Database port | `5432` |+| `database` | Database name | `documenso` |+| `parameters` | Additional connection options | `sslmode=require` |++### Examples++**Local development:**++```+postgresql://documenso:password@localhost:5432/documenso+```++**Remote server with SSL:**++```+postgresql://documenso:[email protected]:5432/documenso?sslmode=require+```++**With special characters in password:**++URL-encode special characters in passwords. For example, `p@ss#word` becomes `p%40ss%23word`:++```+postgresql://documenso:p%40ss%23word@localhost:5432/documenso+```++## Environment Variables++Documenso uses two database connection variables:++| Variable | Purpose |+| ---------------------------------- | --------------------------------------------------- |+| `NEXT_PRIVATE_DATABASE_URL` | Primary connection for application queries |+| `NEXT_PRIVATE_DIRECT_DATABASE_URL` | Direct connection for migrations and schema changes |++### Basic Configuration++When not using a connection pooler, set both variables to the same value:++```bash+NEXT_PRIVATE_DATABASE_URL=postgresql://user:password@host:5432/documenso+NEXT_PRIVATE_DIRECT_DATABASE_URL=postgresql://user:password@host:5432/documenso+```++### Automatic Detection++Documenso automatically detects common database environment variable formats used by hosting providers:++| Provider Variable | Maps To |+| -------------------------- | ---------------------------------- |+| `DATABASE_URL` | `NEXT_PRIVATE_DATABASE_URL` |+| `POSTGRES_URL` | `NEXT_PRIVATE_DATABASE_URL` |+| `POSTGRES_PRISMA_URL` | `NEXT_PRIVATE_DATABASE_URL` |+| `DATABASE_URL_UNPOOLED` | `NEXT_PRIVATE_DIRECT_DATABASE_URL` |+| `POSTGRES_URL_NON_POOLING` | `NEXT_PRIVATE_DIRECT_DATABASE_URL` |++If your hosting provider sets these variables, Documenso will use them automatically.++## Connection Pooling++Connection pooling improves performance by reusing database connections instead of creating new ones for each request.++### When to Use Pooling++Use connection pooling when:++- Running multiple application instances+- Deploying to serverless environments+- Handling high concurrent request volumes+- Your database has connection limits++### PgBouncer Configuration++When using PgBouncer or similar poolers, configure two connection strings:++1. **Pooled connection** for application queries+2. **Direct connection** for migrations (bypasses the pooler)++```bash+# Pooled connection (through PgBouncer)+NEXT_PRIVATE_DATABASE_URL=postgresql://user:password@pooler-host:6432/documenso?pgbouncer=true++# Direct connection (bypasses PgBouncer)+NEXT_PRIVATE_DIRECT_DATABASE_URL=postgresql://user:password@db-host:5432/documenso+```++<Callout type="warn">+ Migrations must use a direct connection. Running migrations through a connection pooler will fail.+</Callout>++### Prisma Connection Pool++Documenso uses Prisma, which maintains its own connection pool. Configure pool size with connection string parameters:++```+postgresql://user:password@host:5432/documenso?connection_limit=10&pool_timeout=30+```++| Parameter | Description | Default |+| ------------------ | ---------------------------------------- | ------- |+| `connection_limit` | Maximum connections in the pool | 10 |+| `pool_timeout` | Seconds to wait for available connection | 10 |++## SSL/TLS Connections++### Enabling SSL++Add SSL parameters to your connection string:++```+postgresql://user:password@host:5432/documenso?sslmode=require+```++### SSL Modes++| Mode | Description |+| ------------- | --------------------------------------------------- |+| `disable` | No SSL (not recommended for production) |+| `allow` | Try non-SSL first, fall back to SSL |+| `prefer` | Try SSL first, fall back to non-SSL |+| `require` | Require SSL, but don't verify certificate |+| `verify-ca` | Require SSL and verify server certificate |+| `verify-full` | Require SSL, verify certificate, and check hostname |++For production, use `require` at minimum. Use `verify-full` when your CA certificate is available.++### Custom Certificates++When connecting to databases with self-signed or private CA certificates:++```+postgresql://user:password@host:5432/documenso?sslmode=verify-full&sslrootcert=/path/to/ca.crt+```++For Docker deployments, mount the certificate file:++```bash+docker run -d \+ -v /path/to/ca.crt:/etc/ssl/certs/db-ca.crt:ro \+ -e NEXT_PRIVATE_DATABASE_URL="postgresql://user:password@host:5432/documenso?sslmode=verify-full&sslrootcert=/etc/ssl/certs/db-ca.crt" \+ documenso/documenso:latest+```++## Running Migrations++Database migrations update your schema when upgrading Documenso.++### Automatic Migrations++When running Documenso via Docker, migrations run automatically on container startup. No manual intervention is required.++### Manual Migrations++For manual deployments or troubleshooting:++```bash+# Apply pending migrations+npm run prisma:migrate-deploy++# Or using npx directly+npx prisma migrate deploy+```++<Callout type="info">+ Always back up your database before running migrations, especially for major version upgrades.+</Callout>++### Migration Commands++| Command | Purpose |+| ----------------------- | ----------------------------------------- |+| `prisma:migrate-deploy` | Apply pending migrations (production) |+| `prisma:migrate-dev` | Create and apply migrations (development) |+| `prisma:migrate-reset` | Reset database and apply all migrations |++### Troubleshooting Migrations++<Accordions type="multiple">+ <Accordion title="Migration failed midway">+ Check the `_prisma_migrations` table:++ ```sql+ SELECT * FROM _prisma_migrations WHERE finished_at IS NULL;+ ```++ To retry, fix the underlying issue (disk space, permissions, etc.), mark as rolled back:++ ```sql+ UPDATE _prisma_migrations SET rolled_back_at = NOW() WHERE migration_name = 'failed_migration_name';+ ```++ Run migrations again.++ </Accordion>+ <Accordion title="Connection timeout during migration">+ Use the direct database URL and increase timeout:++ ```bash+ NEXT_PRIVATE_DIRECT_DATABASE_URL="postgresql://user:password@host:5432/documenso?connect_timeout=60"+ ```+ </Accordion>+</Accordions>++## Managed Database Services++<Accordions type="multiple">+ <Accordion title="Supabase">+ Supabase provides PostgreSQL with built-in connection pooling via Supavisor.++ **Configuration:**++ ```bash+ # Pooled connection (Session mode - port 5432)+ NEXT_PRIVATE_DATABASE_URL=postgresql://postgres.[project-ref]:[password]@aws-0-[region].pooler.supabase.com:5432/postgres++ # Direct connection for migrations (port 5432, direct host)+ NEXT_PRIVATE_DIRECT_DATABASE_URL=postgresql://postgres:[password]@db.[project-ref].supabase.co:5432/postgres+ ```++ Find your connection strings in the Supabase dashboard under **Settings > Database > Connection string**.++ </Accordion>+ <Accordion title="Neon">+ Neon provides serverless PostgreSQL with automatic scaling.++ **Configuration:**++ ```bash+ # Pooled connection+ NEXT_PRIVATE_DATABASE_URL=postgresql://[user]:[password]@[endpoint]-pooler.region.aws.neon.tech/documenso?sslmode=require++ # Direct connection for migrations+ NEXT_PRIVATE_DIRECT_DATABASE_URL=postgresql://[user]:[password]@[endpoint].region.aws.neon.tech/documenso?sslmode=require+ ```++ The pooler endpoint includes `-pooler` in the hostname.++ </Accordion>+ <Accordion title="AWS RDS">+ **Configuration:**++ ```bash+ NEXT_PRIVATE_DATABASE_URL=postgresql://documenso:[password]@your-instance.region.rds.amazonaws.com:5432/documenso?sslmode=require+ NEXT_PRIVATE_DIRECT_DATABASE_URL=postgresql://documenso:[password]@your-instance.region.rds.amazonaws.com:5432/documenso?sslmode=require+ ```++ **Recommended settings:**++ - Instance class: `db.t3.medium` or larger for production+ - Storage: General Purpose SSD (gp3), minimum 20GB+ - Enable automated backups with 7+ day retention+ - Enable Multi-AZ for high availability++ </Accordion>+ <Accordion title="Google Cloud SQL">+ **Configuration:**++ ```bash+ NEXT_PRIVATE_DATABASE_URL=postgresql://documenso:[password]@/documenso?host=/cloudsql/[project]:[region]:[instance]+ ```++ When connecting via Cloud SQL Proxy, use Unix socket connections.++ For public IP connections:++ ```bash+ NEXT_PRIVATE_DATABASE_URL=postgresql://documenso:[password]@[public-ip]:5432/documenso?sslmode=require+ ```++ </Accordion>+ <Accordion title="Azure Database for PostgreSQL">+ **Configuration:**++ ```bash+ NEXT_PRIVATE_DATABASE_URL=postgresql://documenso@[server-name]:[password]@[server-name].postgres.database.azure.com:5432/documenso?sslmode=require+ ```++ Note: Azure requires the username format `user@servername`.++ </Accordion>+ <Accordion title="DigitalOcean Managed Databases">+ **Configuration:**++ ```bash+ NEXT_PRIVATE_DATABASE_URL=postgresql://doadmin:[password]@[cluster-host]:25060/documenso?sslmode=require+ ```++ DigitalOcean uses port 25060 by default and requires SSL.++ </Accordion>+</Accordions>++## Backup Recommendations++### Backup Strategies++| Strategy | Frequency | Retention | Use Case |+| ---------------------- | ------------ | ----------- | ---------------------- |+| Automated snapshots | Daily | 7-30 days | Point-in-time recovery |+| Logical backups | Daily/Weekly | 30-90 days | Long-term retention |+| Continuous replication | Real-time | 24-72 hours | Disaster recovery |++### PostgreSQL Backup Commands++**Create a logical backup:**++```bash+pg_dump -h host -U user -d documenso -F c -f documenso_backup.dump+```++**Restore from backup:**++```bash+pg_restore -h host -U user -d documenso -c documenso_backup.dump+```++### Managed Service Backups++Most managed database services provide automated backups:++<Tabs items={['Supabase', 'Neon', 'AWS RDS', 'Google Cloud SQL', 'Azure']}>+ <Tab value="Supabase">Daily backups with point-in-time recovery (Pro plan)</Tab>+ <Tab value="Neon">Automatic branching for instant recovery</Tab>+ <Tab value="AWS RDS">Automated backups with configurable retention</Tab>+ <Tab value="Google Cloud SQL">Automated and on-demand backups</Tab>+ <Tab value="Azure">Automatic backups with geo-redundancy options</Tab>+</Tabs>++<Callout type="warn">+ Always test your backup restoration process. Untested backups may not work when needed.+</Callout>++## Performance Tuning++### PostgreSQL Configuration++Key parameters for Documenso workloads:++| Parameter | Recommended Value | Description |+| ---------------------- | ----------------- | ------------------------------------- |+| `shared_buffers` | 25% of RAM | Memory for caching data |+| `effective_cache_size` | 75% of RAM | Planner's estimate of available cache |+| `work_mem` | 64MB-256MB | Memory per sort/hash operation |+| `maintenance_work_mem` | 512MB-1GB | Memory for maintenance operations |+| `max_connections` | 100-200 | Maximum concurrent connections |++### Connection Limits++Calculate your connection limit:++```+max_connections = (application_instances × connection_pool_size) + admin_overhead+```++Example: 3 app instances with pool size 10 = `(3 × 10) + 10 = 40` connections minimum.++### Indexing++Documenso includes necessary indexes by default. Additional indexes may help for:++- Custom reporting queries+- High-volume document searches+- Audit log analysis++Check for slow queries:++```sql+SELECT query, calls, mean_time, total_time+FROM pg_stat_statements+ORDER BY total_time DESC+LIMIT 10;+```++### Monitoring++Monitor these metrics:++| Metric | Warning Threshold | Action |+| -------------------- | ----------------- | ------------------------------- |+| Connection usage | > 80% | Increase limits or add pooling |+| Disk usage | > 80% | Add storage or archive old data |+| Cache hit ratio | < 95% | Increase `shared_buffers` |+| Long-running queries | > 30 seconds | Optimize query or add indexes |++## Troubleshooting++<Accordions type="multiple">+ <Accordion title="Connection refused">+ Causes:+ - PostgreSQL not running+ - Incorrect host or port+ - Firewall blocking++ Solutions:+ - Verify PostgreSQL is running with `pg_isready -h host -p 5432`+ - Check the connection string+ - Verify firewall rules+ with `pg_isready -h host -p 5432`, check the connection string, verify firewall rules.+ </Accordion>+ <Accordion title="Authentication failed">+ Causes:+ - Incorrect password+ - User doesn't exist+ - Password contains special characters++ Solutions:+ - Reset password with `ALTER USER documenso WITH PASSWORD 'newpassword';`+ - Verify credentials in `pg_hba.conf`+ - Verify URL-encoded special characters+ </Accordion>+ <Accordion title="SSL connection required">+ Add SSL mode to your connection string:++ ```bash+ postgresql://user:password@host:5432/documenso?sslmode=require+ ```++ </Accordion>+ <Accordion title="Too many connections">+ Causes:+ - Connection pool exhausted+ - Connections not released+ - Multiple instances exceeding limits++ Solutions:+ - Reduce `connection_limit`+ - Increase `max_connections`+ - Implement PgBouncer+ </Accordion>+ <Accordion title="Database does not exist">+ Create the database:++ ```sql+ CREATE DATABASE documenso;+ GRANT ALL PRIVILEGES ON DATABASE documenso TO documenso;+ ```+ </Accordion>+ <Accordion title="Permission denied">+ Grant permissions:++ ```sql+ GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO documenso;+ GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public TO documenso;+ ```+ </Accordion>+</Accordions>++---++## See Also++- [Environment Variables](/docs/self-hosting/configuration/environment) - Complete configuration reference+- [Storage Configuration](/docs/self-hosting/configuration/storage) - Set up document storage+- [Backups](/docs/self-hosting/maintenance/backups) - Backup strategies and procedures+- [Upgrades](/docs/self-hosting/maintenance/upgrades) - Upgrade procedures and migration handlingdiff --git a/apps/docs/content/docs/self-hosting/configuration/email.mdx b/apps/docs/content/docs/self-hosting/configuration/email.mdxnew file mode 100644index 000000000..bc7c729fa--- /dev/null+++ b/apps/docs/content/docs/self-hosting/configuration/email.mdx@@ -0,0 +1,473 @@+---+title: Email Configuration+description: Configure email delivery for notifications and document signing invitations.+---++import { Accordion, Accordions } from 'fumadocs-ui/components/accordion';+import { Callout } from 'fumadocs-ui/components/callout';+import { Step, Steps } from 'fumadocs-ui/components/steps';++## Supported Email Transports++Documenso supports four email transport methods:++| Transport | Use Case | Configuration Complexity |+| -------------- | ------------------------------------- | ------------------------ |+| `smtp-auth` | Standard SMTP with username/password | Low |+| `smtp-api` | SMTP with API key authentication | Low |+| `resend` | Resend.com email API | Low |+| `mailchannels` | MailChannels API (Cloudflare Workers) | Medium |++Select a transport by setting the `NEXT_PRIVATE_SMTP_TRANSPORT` environment variable. The default is `smtp-auth`.++## Sender Configuration++All transports require sender configuration:++| Variable | Description | Required |+| -------------------------------- | --------------------------------- | -------- |+| `NEXT_PRIVATE_SMTP_FROM_ADDRESS` | Email address shown as the sender | Yes |+| `NEXT_PRIVATE_SMTP_FROM_NAME` | Display name shown as the sender | Yes |++```bash+NEXT_PRIVATE_SMTP_FROM_ADDRESS="[email protected]"+NEXT_PRIVATE_SMTP_FROM_NAME="Documenso"+```++<Callout type="warn">+ The sender address must be authorized to send from your email provider. Using an unauthorized+ address will cause delivery failures.+</Callout>++## SMTP Configuration++SMTP is the most common email transport. Documenso supports two SMTP authentication methods.++### SMTP with Username/Password (smtp-auth)++Use this for standard SMTP servers that authenticate with username and password.++**Environment Variables:**++| Variable | Description | Default |+| ------------------------------------- | ----------------------------------------- | ----------- |+| `NEXT_PRIVATE_SMTP_TRANSPORT` | Set to `smtp-auth` | `smtp-auth` |+| `NEXT_PRIVATE_SMTP_HOST` | SMTP server hostname | `127.0.0.1` |+| `NEXT_PRIVATE_SMTP_PORT` | SMTP server port | `587` |+| `NEXT_PRIVATE_SMTP_USERNAME` | Authentication username | |+| `NEXT_PRIVATE_SMTP_PASSWORD` | Authentication password | |+| `NEXT_PRIVATE_SMTP_SECURE` | Use TLS on connection (`true` or `false`) | `false` |+| `NEXT_PRIVATE_SMTP_UNSAFE_IGNORE_TLS` | Disable TLS entirely (not recommended) | `false` |+| `NEXT_PRIVATE_SMTP_SERVICE` | Nodemailer service preset (e.g., `gmail`) | |++**Example Configuration:**++```bash+NEXT_PRIVATE_SMTP_TRANSPORT="smtp-auth"+NEXT_PRIVATE_SMTP_HOST="smtp.example.com"+NEXT_PRIVATE_SMTP_PORT="587"+NEXT_PRIVATE_SMTP_USERNAME="your-username"+NEXT_PRIVATE_SMTP_PASSWORD="your-password"+NEXT_PRIVATE_SMTP_FROM_ADDRESS="[email protected]"+NEXT_PRIVATE_SMTP_FROM_NAME="Documenso"+```++### Common SMTP Provider Examples++**Gmail / Google Workspace:**++```bash+NEXT_PRIVATE_SMTP_TRANSPORT="smtp-auth"+NEXT_PRIVATE_SMTP_HOST="smtp.gmail.com"+NEXT_PRIVATE_SMTP_PORT="587"+NEXT_PRIVATE_SMTP_USERNAME="[email protected]"+NEXT_PRIVATE_SMTP_PASSWORD="your-app-password"+NEXT_PRIVATE_SMTP_FROM_ADDRESS="[email protected]"+NEXT_PRIVATE_SMTP_FROM_NAME="Documenso"+```++<Callout type="info">+ Gmail requires an App Password when 2FA is enabled. Generate one at [Google Account+ Security](https://myaccount.google.com/apppasswords).+</Callout>++**Microsoft 365 / Outlook:**++```bash+NEXT_PRIVATE_SMTP_TRANSPORT="smtp-auth"+NEXT_PRIVATE_SMTP_HOST="smtp.office365.com"+NEXT_PRIVATE_SMTP_PORT="587"+NEXT_PRIVATE_SMTP_USERNAME="[email protected]"+NEXT_PRIVATE_SMTP_PASSWORD="your-password"+NEXT_PRIVATE_SMTP_FROM_ADDRESS="[email protected]"+NEXT_PRIVATE_SMTP_FROM_NAME="Documenso"+```++**Amazon SES:**++```bash+NEXT_PRIVATE_SMTP_TRANSPORT="smtp-auth"+NEXT_PRIVATE_SMTP_HOST="email-smtp.us-east-1.amazonaws.com"+NEXT_PRIVATE_SMTP_PORT="587"+NEXT_PRIVATE_SMTP_USERNAME="your-ses-smtp-username"+NEXT_PRIVATE_SMTP_PASSWORD="your-ses-smtp-password"+NEXT_PRIVATE_SMTP_FROM_ADDRESS="[email protected]"+NEXT_PRIVATE_SMTP_FROM_NAME="Documenso"+```++**Postmark:**++```bash+NEXT_PRIVATE_SMTP_TRANSPORT="smtp-auth"+NEXT_PRIVATE_SMTP_HOST="smtp.postmarkapp.com"+NEXT_PRIVATE_SMTP_PORT="587"+NEXT_PRIVATE_SMTP_USERNAME="your-postmark-server-api-token"+NEXT_PRIVATE_SMTP_PASSWORD="your-postmark-server-api-token"+NEXT_PRIVATE_SMTP_FROM_ADDRESS="[email protected]"+NEXT_PRIVATE_SMTP_FROM_NAME="Documenso"+```++### SMTP with API Key (smtp-api)++Some providers use API key authentication instead of username/password. Use this transport for services like SendGrid.++**Environment Variables:**++| Variable | Description | Default |+| ------------------------------- | --------------------- | -------- |+| `NEXT_PRIVATE_SMTP_TRANSPORT` | Set to `smtp-api` | |+| `NEXT_PRIVATE_SMTP_HOST` | SMTP server hostname | |+| `NEXT_PRIVATE_SMTP_PORT` | SMTP server port | `587` |+| `NEXT_PRIVATE_SMTP_APIKEY_USER` | API key username | `apikey` |+| `NEXT_PRIVATE_SMTP_APIKEY` | API key value | |+| `NEXT_PRIVATE_SMTP_SECURE` | Use TLS on connection | `false` |++**SendGrid Example:**++```bash+NEXT_PRIVATE_SMTP_TRANSPORT="smtp-api"+NEXT_PRIVATE_SMTP_HOST="smtp.sendgrid.net"+NEXT_PRIVATE_SMTP_PORT="587"+NEXT_PRIVATE_SMTP_APIKEY_USER="apikey"+NEXT_PRIVATE_SMTP_APIKEY="SG.xxxxxxxxxxxxxxxxxxxx"+NEXT_PRIVATE_SMTP_FROM_ADDRESS="[email protected]"+NEXT_PRIVATE_SMTP_FROM_NAME="Documenso"+```++## Resend Configuration++[Resend](https://resend.com) provides a developer-friendly email API with excellent deliverability.++**Environment Variables:**++| Variable | Description |+| ----------------------------- | ------------------- |+| `NEXT_PRIVATE_SMTP_TRANSPORT` | Set to `resend` |+| `NEXT_PRIVATE_RESEND_API_KEY` | Your Resend API key |++**Example Configuration:**++```bash+NEXT_PRIVATE_SMTP_TRANSPORT="resend"+NEXT_PRIVATE_RESEND_API_KEY="re_xxxxxxxxxxxxxxxxxxxx"+NEXT_PRIVATE_SMTP_FROM_ADDRESS="[email protected]"+NEXT_PRIVATE_SMTP_FROM_NAME="Documenso"+```++**Setup Steps:**++{/* prettier-ignore */}+<Steps>+<Step>+### Create an account++Sign up at [resend.com](https://resend.com).++</Step>+<Step>+### Add and verify your sending domain++Configure your domain in the Resend dashboard so you can send from your own address.++</Step>+<Step>+### Create an API key++Generate an API key in the Resend dashboard for Documenso to use.++</Step>+<Step>+### Configure environment variables++Set the variables in the table above, including `NEXT_PRIVATE_RESEND_API_KEY` and your sender address.++</Step>+</Steps>++## MailChannels Configuration++[MailChannels](https://www.mailchannels.com) is an email delivery service often used with Cloudflare Workers.++**Environment Variables:**++| Variable | Description | Default |+| -------------------------------------------- | -------------------------------------- | ----------------------------------------- |+| `NEXT_PRIVATE_SMTP_TRANSPORT` | Set to `mailchannels` | |+| `NEXT_PRIVATE_MAILCHANNELS_API_KEY` | API key for authentication | |+| `NEXT_PRIVATE_MAILCHANNELS_ENDPOINT` | Custom API endpoint (for proxy setups) | `https://api.mailchannels.net/tx/v1/send` |+| `NEXT_PRIVATE_MAILCHANNELS_DKIM_DOMAIN` | Domain for DKIM signing | |+| `NEXT_PRIVATE_MAILCHANNELS_DKIM_SELECTOR` | DKIM selector | |+| `NEXT_PRIVATE_MAILCHANNELS_DKIM_PRIVATE_KEY` | DKIM private key for signing | |++**Example Configuration:**++```bash+NEXT_PRIVATE_SMTP_TRANSPORT="mailchannels"+NEXT_PRIVATE_MAILCHANNELS_API_KEY="your-api-key"+NEXT_PRIVATE_SMTP_FROM_ADDRESS="[email protected]"+NEXT_PRIVATE_SMTP_FROM_NAME="Documenso"+```++**With DKIM Signing:**++```bash+NEXT_PRIVATE_SMTP_TRANSPORT="mailchannels"+NEXT_PRIVATE_MAILCHANNELS_API_KEY="your-api-key"+NEXT_PRIVATE_MAILCHANNELS_DKIM_DOMAIN="yourdomain.com"+NEXT_PRIVATE_MAILCHANNELS_DKIM_SELECTOR="mailchannels"+NEXT_PRIVATE_MAILCHANNELS_DKIM_PRIVATE_KEY="-----BEGIN RSA PRIVATE KEY-----\n...\n-----END RSA PRIVATE KEY-----"+NEXT_PRIVATE_SMTP_FROM_ADDRESS="[email protected]"+NEXT_PRIVATE_SMTP_FROM_NAME="Documenso"+```++## Email Templates++Documenso uses React Email templates for all outgoing emails. The templates are located in `packages/email/templates/` and include:++| Template | Purpose |+| ------------------------- | ----------------------------------------- |+| `document-invite.tsx` | Signing invitation sent to recipients |+| `document-completed.tsx` | Notification when all parties have signed |+| `document-pending.tsx` | Reminder for pending signatures |+| `document-cancel.tsx` | Notification when a document is cancelled |+| `document-rejected.tsx` | Notification when a recipient rejects |+| `confirm-email.tsx` | Email verification for new accounts |+| `forgot-password.tsx` | Password reset request |+| `reset-password.tsx` | Password reset confirmation |+| `organisation-invite.tsx` | Team/organisation invitation |++### Branding Customization++Email templates support branding customization through organisation settings. When branding is enabled:++- Custom logo replaces the Documenso logo+- Branding colors are applied to email elements++Configure branding in the application under **Organisation Settings > Preferences > Branding**.++<Callout type="info">+ Template modifications require rebuilding the application. For simple customizations, use the+ branding settings instead.+</Callout>++## Testing Email Delivery++### Verify Configuration++Test your email configuration by creating an account or resetting a password. These actions trigger emails that confirm delivery is working.++### Using a Test SMTP Server++For development or testing, use a local SMTP server like [Mailhog](https://github.com/mailhog/MailHog) or [Mailpit](https://github.com/axllent/mailpit):++```bash+# Using Docker+docker run -d -p 1025:1025 -p 8025:8025 mailhog/mailhog+```++Configure Documenso to use the test server:++```bash+NEXT_PRIVATE_SMTP_TRANSPORT="smtp-auth"+NEXT_PRIVATE_SMTP_HOST="localhost"+NEXT_PRIVATE_SMTP_PORT="1025"+NEXT_PRIVATE_SMTP_FROM_ADDRESS="test@localhost"+NEXT_PRIVATE_SMTP_FROM_NAME="Documenso Test"+```++View sent emails at `http://localhost:8025`.++### Checking Logs++Email sending errors appear in the application logs. Check container or server logs for messages containing `mailer` or `email`:++```bash+# Docker+docker logs documenso 2>&1 | grep -i email++# Docker Compose+docker compose logs app 2>&1 | grep -i email+```++## Email Deliverability++### SPF Configuration++SPF (Sender Policy Framework) authorizes servers to send email for your domain. Add a TXT record to your DNS:++```+v=spf1 include:_spf.example.com ~all+```++Replace `_spf.example.com` with your email provider's SPF include. Common examples:++| Provider | SPF Include |+| ------------- | ------------------------------------ |+| Gmail | `include:_spf.google.com` |+| Microsoft 365 | `include:spf.protection.outlook.com` |+| SendGrid | `include:sendgrid.net` |+| Amazon SES | `include:amazonses.com` |+| Resend | `include:_spf.resend.com` |+| Postmark | `include:spf.mtasv.net` |++### DKIM Configuration++DKIM (DomainKeys Identified Mail) adds a digital signature to emails. Configuration varies by provider:++{/* prettier-ignore */}+<Steps>+<Step>+### Generate DKIM keys++Create DKIM keys in your email provider's dashboard.++</Step>+<Step>+### Add the TXT record to DNS++Add the provided TXT record to your DNS.++</Step>+<Step>+### Enable DKIM signing++Enable DKIM signing in your provider settings.++</Step>+</Steps>++For MailChannels, configure DKIM directly in Documenso using the environment variables described above.++### DMARC Configuration++DMARC (Domain-based Message Authentication, Reporting, and Conformance) tells receiving servers how to handle emails that fail SPF or DKIM checks. Add a TXT record:++```+_dmarc.yourdomain.com TXT "v=DMARC1; p=quarantine; rua=mailto:[email protected]"+```++DMARC policies:++| Policy | Behavior |+| -------------- | ------------------------------ |+| `p=none` | Monitor only, no action taken |+| `p=quarantine` | Move failing emails to spam |+| `p=reject` | Reject failing emails entirely |++Start with `p=none` to monitor, then move to stricter policies once deliverability is confirmed.++## Common Issues++<Accordions type="multiple">+ <Accordion title="Emails Not Sending">+ **Symptoms:** No emails received, no errors in logs.++ **Possible causes:**++ - Incorrect SMTP credentials+ - Firewall blocking outbound SMTP ports+ - From address not authorized++ **Solutions:**++ - Verify credentials with your email provider+ - Check that ports 25, 465, or 587 are open outbound+ - Verify the from address is authorized to send++ </Accordion>+ <Accordion title="Connection Timeout">+ **Symptoms:** Error logs show connection timeout to SMTP server.++ **Possible causes:**++ - Incorrect hostname or port+ - Firewall blocking connection+ - SMTP server down++ **Solutions:**++ - Verify hostname and port match provider documentation+ - Test connectivity: `telnet smtp.example.com 587`+ - Check provider status page++ </Accordion>+ <Accordion title="Authentication Failed">+ **Symptoms:** Error logs show authentication failure.++ **Possible causes:**++ - Wrong username or password+ - Account requires app-specific password+ - Account security restrictions++ **Solutions:**++ - Double-check credentials+ - Generate an app password if using Gmail or Microsoft with 2FA+ - Check for account security alerts from your provider++ </Accordion>+ <Accordion title="Emails Going to Spam">+ **Symptoms:** Emails deliver but land in spam folders.++ **Possible causes:**++ - Missing or incorrect SPF record+ - Missing DKIM signature+ - No DMARC policy+ - Poor sender reputation++ **Solutions:**++ - Configure SPF, DKIM, and DMARC as described above+ - Use a reputable email provider+ - Verify your domain with your email provider+ - Monitor deliverability with tools like [mail-tester.com](https://www.mail-tester.com)++ </Accordion>+ <Accordion title="TLS/SSL Errors">+ **Symptoms:** Errors mentioning TLS, SSL, or certificate issues.++ **Possible causes:**++ - Server requires TLS but `NEXT_PRIVATE_SMTP_SECURE` is false+ - Self-signed certificate on SMTP server+ - Port mismatch (465 for implicit TLS, 587 for STARTTLS)++ **Solutions:**++ - Set `NEXT_PRIVATE_SMTP_SECURE="true"` for port 465+ - Keep `NEXT_PRIVATE_SMTP_SECURE="false"` for port 587 (STARTTLS)+ - As a last resort, set `NEXT_PRIVATE_SMTP_UNSAFE_IGNORE_TLS="true"` (not recommended for production)++ </Accordion>+</Accordions>++---++## See Also++- [Environment Variables](/docs/self-hosting/configuration/environment) - Complete configuration reference+- [Storage Configuration](/docs/self-hosting/configuration/storage) - Set up document storage+- [Signing Certificate](/docs/self-hosting/configuration/signing-certificate) - Configure document signing+- [Troubleshooting](/docs/self-hosting/maintenance/troubleshooting) - Common issues and solutionsdiff --git a/apps/docs/content/docs/self-hosting/configuration/environment.mdx b/apps/docs/content/docs/self-hosting/configuration/environment.mdxnew file mode 100644index 000000000..a1548c32c--- /dev/null+++ b/apps/docs/content/docs/self-hosting/configuration/environment.mdx@@ -0,0 +1,339 @@+---+title: Environment Variables+description: Complete reference for all environment variables used to configure a self-hosted Documenso instance.+---++## Required Variables++These variables must be set for Documenso to function:++| Variable | Description |+| --------------------------------------- | ------------------------------------------------------------------------------------------ |+| `NEXTAUTH_SECRET` | Secret key for NextAuth.js encryption and signing. Generate with `openssl rand -base64 32` |+| `NEXT_PRIVATE_ENCRYPTION_KEY` | Primary encryption key for symmetric encryption (minimum 32 characters) |+| `NEXT_PRIVATE_ENCRYPTION_SECONDARY_KEY` | Secondary encryption key for symmetric encryption (minimum 32 characters) |+| `NEXT_PUBLIC_WEBAPP_URL` | Public URL of your Documenso instance (e.g., `https://sign.example.com`) |+| `NEXT_PRIVATE_DATABASE_URL` | PostgreSQL connection URL with connection pooling |+| `NEXT_PRIVATE_SMTP_FROM_ADDRESS` | Email address used as the sender for all outgoing emails |+| `NEXT_PRIVATE_SMTP_FROM_NAME` | Display name for the sender of outgoing emails |++---++## Server Configuration++| Variable | Description | Default |+| ---------------------------------- | ------------------------------------------------------------ | -------------------------------- |+| `PORT` | Port the server listens on | `3000` |+| `NEXT_PRIVATE_INTERNAL_WEBAPP_URL` | Internal URL for the app to request itself (background jobs) | Same as `NEXT_PUBLIC_WEBAPP_URL` |++---++## Database Configuration++Documenso requires PostgreSQL 14 or higher.++| Variable | Required | Description |+| ---------------------------------- | ------------ | ------------------------------------------------------------------------------------------ |+| `NEXT_PRIVATE_DATABASE_URL` | Yes | PostgreSQL connection URL. Supports connection pooling (e.g., PgBouncer) |+| `NEXT_PRIVATE_DIRECT_DATABASE_URL` | When pooling | Direct PostgreSQL URL for migrations. Defaults to `NEXT_PRIVATE_DATABASE_URL` when not set |++**Connection string format:**++```+postgres://user:password@host:port/database+```++For detailed database setup, see [Database Configuration](/docs/self-hosting/configuration/database).++---++## Authentication and Security++### Core Authentication++| Variable | Required | Description |+| --------------------------------------- | -------- | ------------------------------------------------------------------------- |+| `NEXTAUTH_SECRET` | Yes | Secret for NextAuth.js session encryption. Must be at least 32 characters |+| `NEXT_PRIVATE_ENCRYPTION_KEY` | Yes | Primary key for encrypting sensitive data. Must be at least 32 characters |+| `NEXT_PRIVATE_ENCRYPTION_SECONDARY_KEY` | Yes | Secondary encryption key for key rotation. Must be at least 32 characters |++### Google OAuth++| Variable | Required | Description |+| ----------------------------------- | -------- | -------------------------- |+| `NEXT_PRIVATE_GOOGLE_CLIENT_ID` | No | Google OAuth client ID |+| `NEXT_PRIVATE_GOOGLE_CLIENT_SECRET` | No | Google OAuth client secret |++Callback URL: `https://<your-domain>/api/auth/callback/google`++### Microsoft OAuth++| Variable | Required | Description |+| -------------------------------------- | -------- | ---------------------------------------- |+| `NEXT_PRIVATE_MICROSOFT_CLIENT_ID` | No | Microsoft/Azure AD application client ID |+| `NEXT_PRIVATE_MICROSOFT_CLIENT_SECRET` | No | Microsoft/Azure AD client secret |++Callback URL: `https://<your-domain>/api/auth/callback/microsoft`++### Generic OIDC++| Variable | Default | Description |+| ---------------------------------- | ------- | -------------------------------------------------- |+| `NEXT_PRIVATE_OIDC_WELL_KNOWN` | - | OIDC provider well-known configuration URL |+| `NEXT_PRIVATE_OIDC_CLIENT_ID` | - | OIDC client ID |+| `NEXT_PRIVATE_OIDC_CLIENT_SECRET` | - | OIDC client secret |+| `NEXT_PRIVATE_OIDC_PROVIDER_LABEL` | `OIDC` | Label displayed on the OIDC sign-in button |+| `NEXT_PRIVATE_OIDC_SKIP_VERIFY` | `false` | Skip email verification for OIDC accounts |+| `NEXT_PRIVATE_OIDC_PROMPT` | `login` | OIDC prompt parameter. Set to empty string to omit |++---++## Email Configuration++Documenso supports multiple email transports for sending notifications.++### Transport Selection++| Variable | Description | Default |+| ----------------------------- | --------------------------------------------------------------------- | ----------- |+| `NEXT_PRIVATE_SMTP_TRANSPORT` | Email transport: `smtp-auth`, `smtp-api`, `resend`, or `mailchannels` | `smtp-auth` |++### SMTP Authentication (smtp-auth)++| Variable | Default | Description |+| ------------------------------------- | ----------- | ---------------------------------------- |+| `NEXT_PRIVATE_SMTP_HOST` | `127.0.0.1` | SMTP server hostname |+| `NEXT_PRIVATE_SMTP_PORT` | `587` | SMTP server port |+| `NEXT_PRIVATE_SMTP_USERNAME` | - | SMTP authentication username |+| `NEXT_PRIVATE_SMTP_PASSWORD` | - | SMTP authentication password |+| `NEXT_PRIVATE_SMTP_SECURE` | `false` | Force TLS connection (`true` or `false`) |+| `NEXT_PRIVATE_SMTP_UNSAFE_IGNORE_TLS` | `false` | Disable TLS entirely (not recommended) |+| `NEXT_PRIVATE_SMTP_SERVICE` | - | Nodemailer service name (e.g., `gmail`) |++### SMTP API (smtp-api)++| Variable | Default | Description |+| ------------------------------- | -------- | ------------------------------------ |+| `NEXT_PRIVATE_SMTP_HOST` | - | SMTP server hostname |+| `NEXT_PRIVATE_SMTP_PORT` | `587` | SMTP server port |+| `NEXT_PRIVATE_SMTP_APIKEY_USER` | `apikey` | API key user for SMTP authentication |+| `NEXT_PRIVATE_SMTP_APIKEY` | - | API key for SMTP authentication |++### Resend++| Variable | Description |+| ----------------------------- | ----------------------- |+| `NEXT_PRIVATE_RESEND_API_KEY` | API key from Resend.com |++### MailChannels++| Variable | Description | Default |+| -------------------------------------------- | --------------------------------- | ----------------------------------------- |+| `NEXT_PRIVATE_MAILCHANNELS_API_KEY` | MailChannels API key | - |+| `NEXT_PRIVATE_MAILCHANNELS_ENDPOINT` | Custom API endpoint (for proxies) | `https://api.mailchannels.net/tx/v1/send` |+| `NEXT_PRIVATE_MAILCHANNELS_DKIM_DOMAIN` | Domain for DKIM signing | - |+| `NEXT_PRIVATE_MAILCHANNELS_DKIM_SELECTOR` | DKIM selector | - |+| `NEXT_PRIVATE_MAILCHANNELS_DKIM_PRIVATE_KEY` | DKIM private key | - |++### Sender Configuration++| Variable | Description |+| -------------------------------- | ------------------------------- |+| `NEXT_PRIVATE_SMTP_FROM_ADDRESS` | Sender email address (required) |+| `NEXT_PRIVATE_SMTP_FROM_NAME` | Sender display name (required) |++For detailed email setup, see [Email Configuration](/docs/self-hosting/configuration/email).++---++## Storage Configuration++Documenso can store documents in the database or S3-compatible storage.++| Variable | Description | Default |+| ---------------------------------------- | ------------------------------------------- | ---------- |+| `NEXT_PUBLIC_UPLOAD_TRANSPORT` | Storage backend: `database` or `s3` | `database` |+| `NEXT_PUBLIC_DOCUMENT_SIZE_UPLOAD_LIMIT` | Maximum upload size displayed to users (MB) | `5` |++### S3 Configuration++Required when `NEXT_PUBLIC_UPLOAD_TRANSPORT` is set to `s3`:++| Variable | Description | Default |+| --------------------------------------- | ---------------------------------------------- | ----------- |+| `NEXT_PRIVATE_UPLOAD_BUCKET` | S3 bucket name | |+| `NEXT_PRIVATE_UPLOAD_REGION` | S3 region | `us-east-1` |+| `NEXT_PRIVATE_UPLOAD_ACCESS_KEY_ID` | S3 access key ID | |+| `NEXT_PRIVATE_UPLOAD_SECRET_ACCESS_KEY` | S3 secret access key | |+| `NEXT_PRIVATE_UPLOAD_ENDPOINT` | Custom S3 endpoint for S3-compatible providers | |+| `NEXT_PRIVATE_UPLOAD_FORCE_PATH_STYLE` | Use path-style URLs instead of virtual hosts | `false` |++### CloudFront Distribution (Optional)++| Variable | Description |+| ----------------------------------------------- | ------------------------------- |+| `NEXT_PRIVATE_UPLOAD_DISTRIBUTION_DOMAIN` | CloudFront distribution domain |+| `NEXT_PRIVATE_UPLOAD_DISTRIBUTION_KEY_ID` | CloudFront key pair ID |+| `NEXT_PRIVATE_UPLOAD_DISTRIBUTION_KEY_CONTENTS` | CloudFront private key contents |++For detailed storage setup, see [Storage Configuration](/docs/self-hosting/configuration/storage).++---++## Signing Certificate Configuration++Documenso requires a certificate to digitally sign documents.++### Transport Selection++| Variable | Description | Default |+| -------------------------------- | ---------------------------------------- | ------- |+| `NEXT_PRIVATE_SIGNING_TRANSPORT` | Signing backend: `local` or `gcloud-hsm` | `local` |++### Local Signing++| Variable | Description |+| ------------------------------------------ | -------------------------------------------------------------- |+| `NEXT_PRIVATE_SIGNING_LOCAL_FILE_PATH` | Path to the `.p12` certificate file |+| `NEXT_PRIVATE_SIGNING_LOCAL_FILE_CONTENTS` | Base64-encoded `.p12` file contents (alternative to file path) |+| `NEXT_PRIVATE_SIGNING_PASSPHRASE` | Passphrase for the certificate |++### Google Cloud HSM++| Variable | Description |+| -------------------------------------------------------------- | ---------------------------------------------------- |+| `NEXT_PRIVATE_SIGNING_GCLOUD_HSM_KEY_PATH` | Google Cloud HSM key path |+| `NEXT_PRIVATE_SIGNING_GCLOUD_HSM_PUBLIC_CRT_FILE_PATH` | Path to the public certificate file |+| `NEXT_PRIVATE_SIGNING_GCLOUD_HSM_PUBLIC_CRT_FILE_CONTENTS` | Base64-encoded public certificate |+| `NEXT_PRIVATE_SIGNING_GCLOUD_APPLICATION_CREDENTIALS_CONTENTS` | Base64-encoded Google Cloud credentials |+| `NEXT_PRIVATE_SIGNING_GCLOUD_HSM_CERT_CHAIN_FILE_PATH` | Path to the certificate chain file |+| `NEXT_PRIVATE_SIGNING_GCLOUD_HSM_CERT_CHAIN_CONTENTS` | Base64-encoded certificate chain |+| `NEXT_PRIVATE_SIGNING_GCLOUD_HSM_SECRET_MANAGER_CERT_PATH` | Google Secret Manager path for certificate retrieval |++### Signature Options++| Variable | Description | Default |+| ------------------------------------------- | ----------------------------------------------------------- | ---------- |+| `NEXT_PRIVATE_SIGNING_TIMESTAMP_AUTHORITY` | Comma-separated timestamp authority URLs for LTV signatures | |+| `NEXT_PUBLIC_SIGNING_CONTACT_INFO` | Contact info embedded in PDF signatures | Webapp URL |+| `NEXT_PRIVATE_USE_LEGACY_SIGNING_SUBFILTER` | Use `adbe.pkcs7.detached` instead of `ETSI.CAdES.detached` | `false` |++For detailed certificate setup, see [Signing Certificate](/docs/self-hosting/configuration/signing-certificate).++---++## Feature Flags++| Variable | Description | Default |+| ------------------------------------- | ----------------------------------------------- | ------- |+| `NEXT_PUBLIC_DISABLE_SIGNUP` | Disable public user registration | `false` |+| `NEXT_PUBLIC_POSTHOG_KEY` | PostHog API key for analytics and feature flags | |+| `NEXT_PUBLIC_FEATURE_BILLING_ENABLED` | Enable billing features | `false` |++---++## AI Features++Documenso can use Google Vertex AI for recipient and field detection.++| Variable | Description | Default |+| -------------------------- | ---------------------------------------------- | -------- |+| `GOOGLE_VERTEX_PROJECT_ID` | Google Cloud project ID with Vertex AI enabled | |+| `GOOGLE_VERTEX_API_KEY` | Vertex AI Express API key | |+| `GOOGLE_VERTEX_LOCATION` | Vertex AI region | `global` |++AI features must also be enabled in organisation/team settings after configuration.++---++## Background Jobs++Documenso uses a PostgreSQL-based job queue by default. Jobs (email delivery, document processing, webhook dispatch) are stored in the `BackgroundJob` table and processed via internal HTTP requests. No external queue service like Redis is required.++| Variable | Description | Default |+| ---------------------------- | ------------------------------------------------------------------------------ | ------- |+| `NEXT_PRIVATE_JOBS_PROVIDER` | Jobs provider: `local` (PostgreSQL-based queue) or `inngest` (managed service) | `local` |++### Inngest Configuration++| Variable | Description |+| -------------------------------- | -------------------------------------------- |+| `NEXT_PRIVATE_INNGEST_EVENT_KEY` | Inngest event key |+| `INNGEST_EVENT_KEY` | Alternative Inngest event key |+| `INNGEST_SIGNING_KEY` | Inngest signing key for webhook verification |+| `NEXT_PRIVATE_INNGEST_APP_ID` | Custom Inngest app ID |++---++## Telemetry++| Variable | Description | Default |+| ----------------------------- | -------------------------------------------- | ------- |+| `DOCUMENSO_DISABLE_TELEMETRY` | Set to `true` to disable anonymous telemetry | `false` |++Telemetry collects only: app version, installation ID, and node ID. No personal data is collected.++---++## Debugging and Logging++| Variable | Description |+| ------------------------------------------ | -------------------------------------------------- |+| `NEXT_PRIVATE_LOGGER_FILE_PATH` | File path for log output. Disables stdout when set |+| `NEXT_PRIVATE_BROWSERLESS_URL` | Browserless.io URL for PDF generation |+| `NEXT_PUBLIC_USE_INTERNAL_URL_BROWSERLESS` | Use internal webapp URL in browserless requests |++---++## Enterprise Features++These variables require an active [Enterprise Edition](/docs/policies/enterprise-edition) license. Obtain a license key from [license.documenso.com](https://license.documenso.com) and set it below to unlock enterprise features such as SSO, embed authoring, and 21 CFR Part 11 compliance.++| Variable | Description |+| ------------------------------------ | ------------------------------------------------ |+| `NEXT_PRIVATE_DOCUMENSO_LICENSE_KEY` | License key for enterprise features |+| `NEXT_PRIVATE_STRIPE_API_KEY` | Stripe API key for billing |+| `NEXT_PRIVATE_STRIPE_WEBHOOK_SECRET` | Stripe webhook secret |+| `NEXT_PRIVATE_SES_ACCESS_KEY_ID` | AWS SES access key for email domain verification |+| `NEXT_PRIVATE_SES_SECRET_ACCESS_KEY` | AWS SES secret key |+| `NEXT_PRIVATE_SES_REGION` | AWS SES region |++---++## Example .env File++A minimal production configuration:++```bash+# Required+NEXTAUTH_SECRET="your-random-secret-at-least-32-chars"+NEXT_PRIVATE_ENCRYPTION_KEY="your-encryption-key-at-least-32-chars"+NEXT_PRIVATE_ENCRYPTION_SECONDARY_KEY="your-secondary-key-at-least-32-chars"+NEXT_PUBLIC_WEBAPP_URL="https://sign.example.com"++# Database+NEXT_PRIVATE_DATABASE_URL="postgres://user:password@localhost:5432/documenso"+NEXT_PRIVATE_DIRECT_DATABASE_URL="postgres://user:password@localhost:5432/documenso"++NEXT_PRIVATE_SMTP_TRANSPORT="smtp-auth"+NEXT_PRIVATE_SMTP_HOST="smtp.example.com"+NEXT_PRIVATE_SMTP_PORT=587+NEXT_PRIVATE_SMTP_USERNAME="your-smtp-user"+NEXT_PRIVATE_SMTP_PASSWORD="your-smtp-password"+NEXT_PRIVATE_SMTP_FROM_NAME="Documenso"+NEXT_PRIVATE_SMTP_FROM_ADDRESS="[email protected]"++# Signing (certificate must be configured)+NEXT_PRIVATE_SIGNING_PASSPHRASE="your-certificate-password"+```++---++## See Also++- [Database Configuration](/docs/self-hosting/configuration/database) - Set up PostgreSQL+- [Email Configuration](/docs/self-hosting/configuration/email) - Configure email delivery+- [Storage Configuration](/docs/self-hosting/configuration/storage) - Set up S3 storage+- [Signing Certificate](/docs/self-hosting/configuration/signing-certificate) - Configure document signing+- [Troubleshooting](/docs/self-hosting/maintenance/troubleshooting) - Common configuration issuesdiff --git a/apps/docs/content/docs/self-hosting/configuration/index.mdx b/apps/docs/content/docs/self-hosting/configuration/index.mdxnew file mode 100644index 000000000..0e80e0efc--- /dev/null+++ b/apps/docs/content/docs/self-hosting/configuration/index.mdx@@ -0,0 +1,47 @@+---+title: Configuration+description: Configure your self-hosted Documenso instance with environment variables, database, email, storage, and signing.+---++<Cards>+ <Card+ title="Environment Variables"+ description="Complete reference of all configuration options."+ href="/docs/self-hosting/configuration/environment"+ />+ <Card+ title="Database"+ description="PostgreSQL setup and configuration."+ href="/docs/self-hosting/configuration/database"+ />+ <Card+ title="Email"+ description="SMTP and email delivery configuration."+ href="/docs/self-hosting/configuration/email"+ />+ <Card+ title="Storage"+ description="File storage with S3 or compatible services."+ href="/docs/self-hosting/configuration/storage"+ />+ <Card+ title="Signing Certificate"+ description="Digital signature certificate setup."+ href="/docs/self-hosting/configuration/signing-certificate"+ />+</Cards>++## Required Configuration++At minimum, you need to configure:++1. **Database** - PostgreSQL connection+2. **Email** - SMTP for sending notifications+3. **Base URL** - Your instance's public URL++---++## See Also++- [Quick Start](/docs/self-hosting/getting-started/quick-start) - Get running first, configure later+- [Troubleshooting](/docs/self-hosting/maintenance/troubleshooting) - Common configuration issuesdiff --git a/apps/docs/content/docs/self-hosting/configuration/meta.json b/apps/docs/content/docs/self-hosting/configuration/meta.jsonnew file mode 100644index 000000000..88d922748--- /dev/null+++ b/apps/docs/content/docs/self-hosting/configuration/meta.json@@ -0,0 +1,12 @@+{+ "title": "Configuration",+ "pages": [+ "environment",+ "database",+ "email",+ "storage",+ "signing-certificate",+ "telemetry",+ "advanced"+ ]+}diff --git a/apps/docs/content/docs/self-hosting/configuration/signing-certificate/google-cloud-hsm.mdx b/apps/docs/content/docs/self-hosting/configuration/signing-certificate/google-cloud-hsm.mdxnew file mode 100644index 000000000..0a9f65f55--- /dev/null+++ b/apps/docs/content/docs/self-hosting/configuration/signing-certificate/google-cloud-hsm.mdx@@ -0,0 +1,95 @@+---+title: Google Cloud HSM+description: Configure Google Cloud HSM for hardware-based signing key protection.+---++import { Callout } from 'fumadocs-ui/components/callout';+import { Step, Steps } from 'fumadocs-ui/components/steps';++Google Cloud HSM provides hardware-based key protection. The private key never leaves the HSM.++## Prerequisites++{/* prettier-ignore */}+<Steps>+<Step>+### Enable Cloud KMS++Create or use a Google Cloud project and enable the Cloud KMS API.++</Step>+<Step>+### Create HSM key++Create an HSM key ring and an asymmetric signing key in Cloud KMS (see [Creating an HSM Key](#creating-an-hsm-key) below).++</Step>+<Step>+### Create service account++Create a service account with the `cloudkms.signerVerifier` role so Documenso can use the key.++</Step>+<Step>+### Export public certificate++Export the public certificate from the HSM key; Documenso needs it to embed in signatures.++</Step>+</Steps>++## Environment Variables++| Variable | Description |+| -------------------------------------------------------------- | ---------------------------------------------------- |+| `NEXT_PRIVATE_SIGNING_TRANSPORT` | Set to `gcloud-hsm` |+| `NEXT_PRIVATE_SIGNING_GCLOUD_HSM_KEY_PATH` | Full resource path to the HSM key version |+| `NEXT_PRIVATE_SIGNING_GCLOUD_HSM_PUBLIC_CRT_FILE_PATH` | Path to the public certificate file |+| `NEXT_PRIVATE_SIGNING_GCLOUD_HSM_PUBLIC_CRT_FILE_CONTENTS` | Base64-encoded public certificate |+| `NEXT_PRIVATE_SIGNING_GCLOUD_APPLICATION_CREDENTIALS_CONTENTS` | Base64-encoded Google Cloud service account JSON |+| `NEXT_PRIVATE_SIGNING_GCLOUD_HSM_CERT_CHAIN_FILE_PATH` | Path to the certificate chain file |+| `NEXT_PRIVATE_SIGNING_GCLOUD_HSM_CERT_CHAIN_CONTENTS` | Base64-encoded certificate chain |+| `NEXT_PRIVATE_SIGNING_GCLOUD_HSM_SECRET_MANAGER_CERT_PATH` | Google Secret Manager path for certificate retrieval |++## Configuration Example++```bash+NEXT_PRIVATE_SIGNING_TRANSPORT=gcloud-hsm+NEXT_PRIVATE_SIGNING_GCLOUD_HSM_KEY_PATH=projects/my-project/locations/global/keyRings/documenso/cryptoKeys/signing-key/cryptoKeyVersions/1+NEXT_PRIVATE_SIGNING_GCLOUD_HSM_PUBLIC_CRT_FILE_PATH=/opt/documenso/public.crt+NEXT_PRIVATE_SIGNING_GCLOUD_APPLICATION_CREDENTIALS_CONTENTS=eyJ0eXBlIjoic2VydmljZV9hY2NvdW50Ii...+```++## Key Path Format++The HSM key path follows this format:++```+projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{key}/cryptoKeyVersions/{version}+```++Example:++```+projects/my-company/locations/us-east1/keyRings/document-signing/cryptoKeys/prod-signing/cryptoKeyVersions/1+```++## Creating an HSM Key++Using gcloud CLI:++```bash+# Create a key ring+gcloud kms keyrings create document-signing \+ --location=us-east1 \+ --project=my-project++# Create an asymmetric signing key+gcloud kms keys create prod-signing \+ --keyring=document-signing \+ --location=us-east1 \+ --purpose=asymmetric-signing \+ --default-algorithm=rsa-sign-pkcs1-2048-sha256 \+ --protection-level=hsm \+ --project=my-project+```diff --git a/apps/docs/content/docs/self-hosting/configuration/signing-certificate/index.mdx b/apps/docs/content/docs/self-hosting/configuration/signing-certificate/index.mdxnew file mode 100644index 000000000..89a12a327--- /dev/null+++ b/apps/docs/content/docs/self-hosting/configuration/signing-certificate/index.mdx@@ -0,0 +1,85 @@+---+title: Signing Certificate+description: Configure the X.509 signing certificate used for digital signatures in self-hosted Documenso.+---++import { Tab, Tabs } from 'fumadocs-ui/components/tabs';++When a document is completed in Documenso, it is digitally signed using an X.509 certificate. This cryptographic signature provides:++- Proof of document authenticity+- Verification that the document has not been modified since signing+- Identity information about the signing entity++Self-hosted Documenso instances require a signing certificate. You can generate a self-signed certificate or purchase one from a Certificate Authority (CA).++<Cards>+ <Card+ title="Local Certificate"+ description="Configure a local .p12 certificate file or base64-encoded contents."+ href="/docs/self-hosting/configuration/signing-certificate/local"+ />+ <Card+ title="Google Cloud HSM"+ description="Hardware-based key protection with Google Cloud KMS."+ href="/docs/self-hosting/configuration/signing-certificate/google-cloud-hsm"+ />+ <Card+ title="Timestamp Server"+ description="Add trusted timestamps and customise signature appearance."+ href="/docs/self-hosting/configuration/signing-certificate/timestamp-server"+ />+ <Card+ title="Troubleshooting"+ description="Common certificate errors and solutions."+ href="/docs/self-hosting/configuration/signing-certificate/troubleshooting"+ />+</Cards>++## Certificate Options++<Tabs items={['Self-Signed', 'CA-Issued', 'Google Cloud HSM']}>+<Tab value="Self-Signed">++A self-signed certificate is sufficient for most use cases where your industry has no special signing regulations.++**Advantages:**++- Free to create+- Full control over certificate details+- Works for internal and business documents++**Limitations:**++- PDF readers like Adobe Acrobat will not show a green checkmark+- Not recognized by Adobe's trust list+- Recipients see a warning that the signature cannot be verified++The certificate still includes your organisation details and guarantees document integrity.++</Tab>+<Tab value="CA-Issued">++Purchase a certificate from a Certificate Authority if you need:++- Green checkmark in Adobe PDF readers+- Industry-specific compliance requirements+- Third-party signature validation++For Adobe recognition, choose a vendor from the [Adobe Approved Trust List](https://helpx.adobe.com/acrobat/kb/approved-trust-list1.html).++</Tab>+<Tab value="Google Cloud HSM">++For organisations requiring hardware-based key protection, Documenso supports Google Cloud HSM. This provides:++- FIPS 140-2 Level 3 certified key storage+- Keys never leave the HSM+- Audit logging of all cryptographic operations++See [Google Cloud HSM](/docs/self-hosting/configuration/signing-certificate/google-cloud-hsm) for setup instructions.++</Tab>+</Tabs>++diff --git a/apps/docs/content/docs/self-hosting/configuration/signing-certificate/local.mdx b/apps/docs/content/docs/self-hosting/configuration/signing-certificate/local.mdxnew file mode 100644index 000000000..737abba84--- /dev/null+++ b/apps/docs/content/docs/self-hosting/configuration/signing-certificate/local.mdx@@ -0,0 +1,202 @@+---+title: Local Certificate+description: Generate or convert a .p12 certificate and configure it for document signing.+---++import { Callout } from 'fumadocs-ui/components/callout';+import { Step, Steps } from 'fumadocs-ui/components/steps';+import { Tab, Tabs } from 'fumadocs-ui/components/tabs';++## Generating a Self-Signed Certificate++Create a self-signed certificate using OpenSSL. These commands work on Linux, macOS, and Windows Subsystem for Linux (WSL).++{/* prettier-ignore */}+<Steps>+<Step>++### Generate a private key++Create a 2048-bit RSA private key:++```bash+openssl genrsa -out private.key 2048+```++</Step>+<Step>++### Create a self-signed certificate++Generate a certificate valid for one year:++```bash+openssl req -new -x509 -key private.key -out certificate.crt -days 365+```++When prompted, enter your organisation details:++| Field | Example |+| ------------------- | ----------------------- |+| Country Name | US |+| State or Province | California |+| Locality Name | San Francisco |+| Organization Name | Your Company Inc |+| Organizational Unit | Engineering |+| Common Name | Your Company Signing CA |+| Email Address | [email protected] |++</Step>+<Step>++### Create the .p12 certificate++Combine the private key and certificate into a PKCS#12 (.p12) file:++```bash+openssl pkcs12 -export -out certificate.p12 -inkey private.key -in certificate.crt+```++<Callout type="warn">+ You must set a password when prompted. Certificates without passwords cause signing failures with+ the error "Failed to get private key bags".+</Callout>++To set the password non-interactively:++```bash+# Set password securely (won't appear in command history)+read -s -p "Enter certificate password: " CERT_PASS+echo++openssl pkcs12 -export -out certificate.p12 -inkey private.key -in certificate.crt \+ -password env:CERT_PASS+```++</Step>+<Step>++### Clean up++Remove the intermediate files:++```bash+rm private.key certificate.crt+```++Keep `certificate.p12` and the password secure.++</Step>+</Steps>++## Using an Existing Certificate++If you have an existing certificate from a CA, convert it to PKCS#12 format.++<Tabs items={['From PEM files', 'From other formats']}>+<Tab value="From PEM files">++If you have separate certificate and key files:++```bash+openssl pkcs12 -export -out certificate.p12 \+ -inkey private.key \+ -in certificate.crt \+ -certfile chain.crt+```++Include `-certfile chain.crt` if you have intermediate certificates.++</Tab>+<Tab value="From other formats">++**Convert from DER to PEM first:**++```bash+openssl x509 -inform DER -in certificate.der -out certificate.crt+openssl rsa -inform DER -in private.der -out private.key+```++**PFX files** are the same format as P12. You can use them directly by renaming to `.p12`.++</Tab>+</Tabs>++## Certificate Validation++Verify your certificate is valid:++```bash+# Check certificate details+openssl pkcs12 -in certificate.p12 -info -nokeys++# Verify password works+openssl pkcs12 -in certificate.p12 -noout+```++## Environment Variables++| Variable | Description |+| ------------------------------------------ | -------------------------------------------------------------- |+| `NEXT_PRIVATE_SIGNING_TRANSPORT` | Set to `local` (default) |+| `NEXT_PRIVATE_SIGNING_LOCAL_FILE_PATH` | Path to the `.p12` certificate file |+| `NEXT_PRIVATE_SIGNING_LOCAL_FILE_CONTENTS` | Base64-encoded `.p12` file contents (alternative to file path) |+| `NEXT_PRIVATE_SIGNING_PASSPHRASE` | Passphrase for the certificate |++## Using File Path++Mount the certificate file and set the path:++```bash+NEXT_PRIVATE_SIGNING_TRANSPORT=local+NEXT_PRIVATE_SIGNING_LOCAL_FILE_PATH=/opt/documenso/cert.p12+NEXT_PRIVATE_SIGNING_PASSPHRASE=your-certificate-password+```++**Docker example:**++```bash+docker run -d \+ -v /path/to/certificate.p12:/opt/documenso/cert.p12:ro \+ -e NEXT_PRIVATE_SIGNING_LOCAL_FILE_PATH=/opt/documenso/cert.p12 \+ -e NEXT_PRIVATE_SIGNING_PASSPHRASE="your-certificate-password" \+ documenso/documenso:latest+```++## Using Base64-Encoded Contents++For environments where file mounting is not available (e.g., Railway, Vercel):++```bash+# Encode the certificate+base64 -i certificate.p12+```++Set the encoded string as an environment variable:++```bash+NEXT_PRIVATE_SIGNING_TRANSPORT=local+NEXT_PRIVATE_SIGNING_LOCAL_FILE_CONTENTS=MIIKEQIBAzCCCdcGCSqGSIb3DQEHAaCCCcg...+NEXT_PRIVATE_SIGNING_PASSPHRASE=your-certificate-password+```++<Callout type="info">+ The `NEXT_PRIVATE_SIGNING_LOCAL_FILE_CONTENTS` variable takes precedence over+ `NEXT_PRIVATE_SIGNING_LOCAL_FILE_PATH` if both are set.+</Callout>++## Docker File Permissions++When running in Docker, the application runs as user 1001. The certificate file must be readable:++```bash+# On the host, before mounting+sudo chown 1001 certificate.p12+chmod 400 certificate.p12+```++Or mount as read-only and ensure group readability:++```bash+chmod 440 certificate.p12+```diff --git a/apps/docs/content/docs/self-hosting/configuration/signing-certificate/meta.json b/apps/docs/content/docs/self-hosting/configuration/signing-certificate/meta.jsonnew file mode 100644index 000000000..d37038af3--- /dev/null+++ b/apps/docs/content/docs/self-hosting/configuration/signing-certificate/meta.json@@ -0,0 +1,4 @@+{+ "title": "Signing Certificate",+ "pages": ["...index", "local", "google-cloud-hsm", "timestamp-server", "troubleshooting"]+}diff --git a/apps/docs/content/docs/self-hosting/configuration/signing-certificate/timestamp-server.mdx b/apps/docs/content/docs/self-hosting/configuration/signing-certificate/timestamp-server.mdxnew file mode 100644index 000000000..3627f1600--- /dev/null+++ b/apps/docs/content/docs/self-hosting/configuration/signing-certificate/timestamp-server.mdx@@ -0,0 +1,68 @@+---+title: Timestamp Server+description: Configure timestamp servers and signature appearance for document signing.+---++import { Callout } from 'fumadocs-ui/components/callout';++Timestamp servers add a trusted timestamp to signatures, proving when the document was signed. This enables Long-Term Validation (LTV) and archival timestamps.++## Environment Variable++| Variable | Description |+| ------------------------------------------ | ------------------------------------------------ |+| `NEXT_PRIVATE_SIGNING_TIMESTAMP_AUTHORITY` | Comma-separated list of timestamp authority URLs |++## Configuration++```bash+NEXT_PRIVATE_SIGNING_TIMESTAMP_AUTHORITY=http://timestamp.digicert.com,http://timestamp.globalsign.com/tsa/r6advanced1+```++## Free Timestamp Servers++| Provider | URL |+| ---------- | ------------------------------------------------- |+| DigiCert | `http://timestamp.digicert.com` |+| GlobalSign | `http://timestamp.globalsign.com/tsa/r6advanced1` |+| FreeTSA | `https://freetsa.org/tsr` |+| Sectigo | `http://timestamp.sectigo.com` |++<Callout type="info">+ Timestamp servers add latency to the signing process. Each server in the list is tried in order+ until one succeeds.+</Callout>++## Benefits of Timestamping++- Proves when the document was signed+- Signature remains valid after certificate expiration+- Required for some compliance standards+- Enables long-term archival++## Signature Appearance++### Contact Information++Set contact information embedded in PDF signatures:++```bash+```++If not set, defaults to your `NEXT_PUBLIC_WEBAPP_URL`.++### Legacy Signature Format++For compatibility with older PDF readers, use the legacy signature subfilter:++```bash+NEXT_PRIVATE_USE_LEGACY_SIGNING_SUBFILTER=true+```++| Subfilter | Description | Default |+| --------------------- | ----------------------------- | ------- |+| `ETSI.CAdES.detached` | Modern CAdES-based signatures | Yes |+| `adbe.pkcs7.detached` | Legacy PKCS#7 signatures | No |++Use the legacy format only if recipients report compatibility issues with older software.diff --git a/apps/docs/content/docs/self-hosting/configuration/signing-certificate/troubleshooting.mdx b/apps/docs/content/docs/self-hosting/configuration/signing-certificate/troubleshooting.mdxnew file mode 100644index 000000000..6806a5aaa--- /dev/null+++ b/apps/docs/content/docs/self-hosting/configuration/signing-certificate/troubleshooting.mdx@@ -0,0 +1,91 @@+---+title: Troubleshooting+description: Common signing certificate errors and their solutions.+---++import { Accordion, Accordions } from 'fumadocs-ui/components/accordion';++<Accordions type="multiple">+ <Accordion title="Failed to get private key bags">+ Cause:+ - Certificate has no password set++ Solution:+ - Verify the certificate has a password set+ - Re-create with a password:++ ```bash+ openssl pkcs12 -export -out new-certificate.p12 -inkey private.key -in certificate.crt+ ```++ </Accordion>+ <Accordion title="No certificate found for local signing">+ Cause:+ - Certificate path or contents not configured++ Solution:+ - Verify that `NEXT_PRIVATE_SIGNING_LOCAL_FILE_PATH` or `NEXT_PRIVATE_SIGNING_LOCAL_FILE_CONTENTS` is set+ - Check the file exists at the configured path+ - Verify file permissions allow reading++ </Accordion>+ <Accordion title="Permission denied reading certificate">+ Cause:+ - Application cannot read the certificate file++ Solution:+ - For Docker, run `sudo chown 1001 certificate.p12` and `chmod 400 certificate.p12` on the host before mounting++ </Accordion>+ <Accordion title="Invalid password (mac verify failure)">+ Cause:+ - Incorrect passphrase++ Solution:+ - Verify `NEXT_PRIVATE_SIGNING_PASSPHRASE` matches the certificate password+ - Check for trailing whitespace+ - Test with `openssl pkcs12 -in certificate.p12 -noout`++ </Accordion>+ <Accordion title="Certificate has expired">+ Cause:+ - Certificate validity period has ended++ Solution:+ - Generate a new certificate or obtain a renewed one+ - Update the certificate file and restart Documenso+ - Check expiration:++ ```bash+ openssl pkcs12 -in certificate.p12 -nokeys | openssl x509 -noout -dates+ ```++ </Accordion>+ <Accordion title="Base64 decode error">+ Cause:+ - Incorrect base64 encoding or line breaks++ Solution:+ - Encode without line breaks:++ ```bash+ # macOS+ base64 -i certificate.p12 | tr -d '\n'++ # Linux+ base64 -w 0 certificate.p12+ ```+ - Ensure the entire base64 string is on one line++ </Accordion>+ <Accordion title="Google Cloud HSM authentication failed">+ Cause:+ - Google Cloud credentials not configured or invalid++ Solution:+ - Verify that `NEXT_PRIVATE_SIGNING_GCLOUD_APPLICATION_CREDENTIALS_CONTENTS` is set+ - Check the service account has `cloudkms.signerVerifier` role+ - Verify the base64 encoding of the service account JSON++ </Accordion>+</Accordions>diff --git a/apps/docs/content/docs/self-hosting/configuration/storage.mdx b/apps/docs/content/docs/self-hosting/configuration/storage.mdxnew file mode 100644index 000000000..3ddd5eac8--- /dev/null+++ b/apps/docs/content/docs/self-hosting/configuration/storage.mdx@@ -0,0 +1,569 @@+---+title: Storage Configuration+description: Configure file storage for uploaded documents and signed PDFs using database storage (default) or S3-compatible object storage.+---++import { Accordion, Accordions } from 'fumadocs-ui/components/accordion';+import { Callout } from 'fumadocs-ui/components/callout';+import { Step, Steps } from 'fumadocs-ui/components/steps';+import { Tab, Tabs } from 'fumadocs-ui/components/tabs';++## Storage Options++| Backend | Best For | Scalability | Configuration |+| ---------- | -------------------------------- | ----------- | ------------- |+| `database` | Small deployments, simplicity | Limited | None required |+| `s3` | Production, large files, backups | High | Required |++Select the storage backend with the `NEXT_PUBLIC_UPLOAD_TRANSPORT` environment variable:++```bash+# Database storage (default)+NEXT_PUBLIC_UPLOAD_TRANSPORT=database++# S3-compatible storage+NEXT_PUBLIC_UPLOAD_TRANSPORT=s3+```++---++## Database Storage++Database storage is the default option and requires no additional configuration. Documents are stored as base64-encoded data directly in PostgreSQL.++<Tabs items={['Advantages', 'Limitations']}>+<Tab value="Advantages">++- No external dependencies+- Simple deployment+- Automatic backups with database++</Tab>+<Tab value="Limitations">++- Increases database size significantly+- Slower for large files+- Database backup/restore takes longer+- Not recommended for files larger than 10MB++</Tab>+</Tabs>++### Configuration++No configuration required. Database storage is enabled when `NEXT_PUBLIC_UPLOAD_TRANSPORT` is unset or set to `database`.++---++## S3 Configuration++S3 storage is recommended for production deployments. Documenso supports AWS S3 and any S3-compatible storage service.++### Required Variables++| Variable | Description |+| --------------------------------------- | --------------------------------- |+| `NEXT_PUBLIC_UPLOAD_TRANSPORT` | Set to `s3` |+| `NEXT_PRIVATE_UPLOAD_BUCKET` | S3 bucket name |+| `NEXT_PRIVATE_UPLOAD_REGION` | AWS region (default: `us-east-1`) |+| `NEXT_PRIVATE_UPLOAD_ACCESS_KEY_ID` | AWS access key ID |+| `NEXT_PRIVATE_UPLOAD_SECRET_ACCESS_KEY` | AWS secret access key |++### Optional Variables++| Variable | Description | Default |+| -------------------------------------- | --------------------------------------------- | ----------- |+| `NEXT_PRIVATE_UPLOAD_ENDPOINT` | Custom S3 endpoint for S3-compatible services | |+| `NEXT_PRIVATE_UPLOAD_FORCE_PATH_STYLE` | Use path-style URLs instead of virtual-hosted | `false` |+| `NEXT_PRIVATE_UPLOAD_REGION` | S3 region | `us-east-1` |++---++## AWS S3 Setup++{/* prettier-ignore */}+<Steps>+<Step>+### Create an S3 Bucket++Create a bucket in the AWS Console or using the CLI:++```bash+aws s3 mb s3://your-documenso-bucket --region us-east-1+```++</Step>+<Step>+### Configure Bucket Policy++Block public access and configure CORS for presigned URL uploads:++**CORS Configuration:**++```json+[+ {+ "AllowedHeaders": ["*"],+ "AllowedMethods": ["GET", "PUT", "POST"],+ "AllowedOrigins": ["https://your-documenso-domain.com"],+ "ExposeHeaders": ["ETag"]+ }+]+```++Apply via AWS Console (Bucket > Permissions > CORS configuration) or CLI:++```bash+aws s3api put-bucket-cors --bucket your-documenso-bucket --cors-configuration file://cors.json+```++</Step>+<Step>+### Create IAM User++Create an IAM user with programmatic access and attach this policy:++```json+{+ "Version": "2012-10-17",+ "Statement": [+ {+ "Effect": "Allow",+ "Action": ["s3:PutObject", "s3:GetObject", "s3:DeleteObject"],+ "Resource": "arn:aws:s3:::your-documenso-bucket/*"+ }+ ]+}+```++</Step>+<Step>+### Configure Environment Variables++```bash+NEXT_PUBLIC_UPLOAD_TRANSPORT=s3+NEXT_PRIVATE_UPLOAD_BUCKET=your-documenso-bucket+NEXT_PRIVATE_UPLOAD_REGION=us-east-1+NEXT_PRIVATE_UPLOAD_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE+NEXT_PRIVATE_UPLOAD_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY+```++</Step>+</Steps>++---++## MinIO Setup++MinIO is a self-hosted S3-compatible object storage server.++{/* prettier-ignore */}+<Steps>+<Step>+### Deploy MinIO++Using Docker:++```bash+docker run -d \+ --name minio \+ -p 9000:9000 \+ -p 9001:9001 \+ -e MINIO_ROOT_USER=minioadmin \+ -e MINIO_ROOT_PASSWORD=minioadmin \+ -v minio_data:/data \+ minio/minio server /data --console-address ":9001"+```++Using Docker Compose with Documenso:++```yaml+services:+ minio:+ image: minio/minio+ command: server /data --console-address ":9001"+ ports:+ - '9000:9000'+ - '9001:9001'+ environment:+ MINIO_ROOT_USER: minioadmin+ MINIO_ROOT_PASSWORD: minioadmin+ volumes:+ - minio_data:/data++volumes:+ minio_data:+```++</Step>+<Step>+### Create a Bucket++Access the MinIO Console at `http://localhost:9001` and create a bucket, or use the CLI:++```bash+# Install MinIO client+mc alias set myminio http://localhost:9000 minioadmin minioadmin++# Create bucket+mc mb myminio/documenso+```++</Step>+<Step>+### Configure Environment Variables++```bash+NEXT_PUBLIC_UPLOAD_TRANSPORT=s3+NEXT_PRIVATE_UPLOAD_BUCKET=documenso+NEXT_PRIVATE_UPLOAD_ENDPOINT=http://minio:9000+NEXT_PRIVATE_UPLOAD_FORCE_PATH_STYLE=true+NEXT_PRIVATE_UPLOAD_ACCESS_KEY_ID=minioadmin+NEXT_PRIVATE_UPLOAD_SECRET_ACCESS_KEY=minioadmin+NEXT_PRIVATE_UPLOAD_REGION=us-east-1+```++</Step>+</Steps>++<Callout type="info">+ Set `NEXT_PRIVATE_UPLOAD_FORCE_PATH_STYLE=true` for MinIO and other S3-compatible services that+ don't support virtual-hosted bucket URLs.+</Callout>++---++## Other S3-Compatible Services++Documenso works with any S3-compatible storage service. Configure the endpoint and enable path-style URLs if required.++### Cloudflare R2++```bash+NEXT_PUBLIC_UPLOAD_TRANSPORT=s3+NEXT_PRIVATE_UPLOAD_BUCKET=documenso+NEXT_PRIVATE_UPLOAD_ENDPOINT=https://<account-id>.r2.cloudflarestorage.com+NEXT_PRIVATE_UPLOAD_ACCESS_KEY_ID=your-r2-access-key+NEXT_PRIVATE_UPLOAD_SECRET_ACCESS_KEY=your-r2-secret-key+NEXT_PRIVATE_UPLOAD_REGION=auto+```++### DigitalOcean Spaces++```bash+NEXT_PUBLIC_UPLOAD_TRANSPORT=s3+NEXT_PRIVATE_UPLOAD_BUCKET=documenso+NEXT_PRIVATE_UPLOAD_ENDPOINT=https://nyc3.digitaloceanspaces.com+NEXT_PRIVATE_UPLOAD_ACCESS_KEY_ID=your-spaces-key+NEXT_PRIVATE_UPLOAD_SECRET_ACCESS_KEY=your-spaces-secret+NEXT_PRIVATE_UPLOAD_REGION=nyc3+```++### Backblaze B2++```bash+NEXT_PUBLIC_UPLOAD_TRANSPORT=s3+NEXT_PRIVATE_UPLOAD_BUCKET=documenso+NEXT_PRIVATE_UPLOAD_ENDPOINT=https://s3.us-west-004.backblazeb2.com+NEXT_PRIVATE_UPLOAD_ACCESS_KEY_ID=your-b2-key-id+NEXT_PRIVATE_UPLOAD_SECRET_ACCESS_KEY=your-b2-application-key+NEXT_PRIVATE_UPLOAD_REGION=us-west-004+```++### Wasabi++```bash+NEXT_PUBLIC_UPLOAD_TRANSPORT=s3+NEXT_PRIVATE_UPLOAD_BUCKET=documenso+NEXT_PRIVATE_UPLOAD_ENDPOINT=https://s3.us-east-1.wasabisys.com+NEXT_PRIVATE_UPLOAD_ACCESS_KEY_ID=your-wasabi-key+NEXT_PRIVATE_UPLOAD_SECRET_ACCESS_KEY=your-wasabi-secret+NEXT_PRIVATE_UPLOAD_REGION=us-east-1+```++---++## CloudFront CDN (Optional)++Use Amazon CloudFront to serve documents with lower latency and reduced S3 costs. CloudFront integration uses signed URLs for secure access.++### Prerequisites++- An S3 bucket configured for Documenso+- A CloudFront distribution with the S3 bucket as origin+- A CloudFront key pair for signing URLs++{/* prettier-ignore */}+<Steps>+<Step>+### Create a CloudFront Distribution++- Go to CloudFront in the AWS Console+- Create a distribution with your S3 bucket as the origin+- Configure Origin Access Control (OAC) to restrict direct S3 access+- Set the default cache behavior to allow GET requests++</Step>+<Step>+### Create a Key Pair++CloudFront signed URLs require a key pair:++- Go to CloudFront > Key management > Public keys+- Create a new public key+- Create a key group containing the public key+- Associate the key group with your distribution++Keep the private key secure - you'll need it for the environment variable.++</Step>+<Step>+### Configure Environment Variables++```bash+# CloudFront distribution domain (without https://)+NEXT_PRIVATE_UPLOAD_DISTRIBUTION_DOMAIN=d1234567890.cloudfront.net++# CloudFront key pair ID+NEXT_PRIVATE_UPLOAD_DISTRIBUTION_KEY_ID=K1234567890ABC++# Private key contents (PEM format)+NEXT_PRIVATE_UPLOAD_DISTRIBUTION_KEY_CONTENTS="-----BEGIN RSA PRIVATE KEY-----+MIIEpAIBAAKCAQEA...+-----END RSA PRIVATE KEY-----"+```++<Callout type="warn">+ Store the private key securely. Use environment variables or secrets management rather than+ committing it to version control.+</Callout>++</Step>+</Steps>++### How It Works++When CloudFront is configured:++{/* prettier-ignore */}+<Steps>+<Step>+### Uploads++File uploads still go directly to S3 via presigned URLs.++</Step>+<Step>+### Downloads++File downloads use CloudFront signed URLs.++</Step>+<Step>+### Caching++CloudFront caches files at edge locations.++</Step>+<Step>+### Expiration++Signed URLs expire after 1 hour.++</Step>+</Steps>++---++## Migration Between Storage Backends++Documenso does not provide automatic migration between storage backends. Each document's storage location is recorded in the database.++<Callout type="warn">+ Documents uploaded to one storage backend cannot be automatically migrated to another. Plan your+ storage strategy before deploying to production.+</Callout>++### Manual Migration Process++To migrate existing documents from database to S3 storage:++{/* prettier-ignore */}+<Steps>+<Step>+### Export documents++Extract document blobs from the database (e.g. via a script querying `DocumentData` where `type` is `BYTES_64`).++</Step>+<Step>+### Upload to S3++Upload each exported file to your S3 bucket and note the resulting object keys or paths.++</Step>+<Step>+### Update DocumentData records++Point each record to the new S3 location by updating `DocumentData` with the S3 path and setting `type` to `S3_PATH`.++</Step>+</Steps>++This requires custom scripts and database modifications.++<Callout type="info">+ For production deployments, we recommend starting with S3 storage from the beginning.+</Callout>++### Hybrid Operation++During migration, Documenso can read from both backends. The `DocumentData.type` field indicates where each document is stored.++- `BYTES_64`: Stored in database+- `S3_PATH`: Stored in S3++New uploads use the configured `NEXT_PUBLIC_UPLOAD_TRANSPORT` backend.++---++## Storage Sizing++### Database Storage Estimates++When using database storage, plan for significant database growth:++| Documents/Month | Avg Size | Monthly Growth | Annual Growth |+| --------------- | -------- | -------------- | ------------- |+| 100 | 500KB | ~50MB | ~600MB |+| 1,000 | 500KB | ~500MB | ~6GB |+| 10,000 | 500KB | ~5GB | ~60GB |++Database storage includes base64 encoding overhead (~33% increase).++### S3 Storage Estimates++S3 stores files without encoding overhead:++| Documents/Month | Avg Size | Monthly Growth | Annual Growth |+| --------------- | -------- | -------------- | ------------- |+| 100 | 500KB | ~50MB | ~600MB |+| 1,000 | 500KB | ~500MB | ~6GB |+| 10,000 | 500KB | ~5GB | ~60GB |++### Cost Comparison++For high-volume deployments, S3 is more cost-effective:++| Aspect | Database Storage | S3 Storage |+| ------------- | ---------------------------- | ----------------------- |+| Storage cost | Database pricing (~$0.10/GB) | S3 pricing (~$0.023/GB) |+| Transfer cost | Database I/O | S3 requests + egress |+| Backup cost | Larger database backups | Separate S3 backups |+| Performance | Degrades with size | Consistent |++---++## Upload Size Limits++Configure the maximum upload size displayed to users:++```bash+NEXT_PUBLIC_DOCUMENT_SIZE_UPLOAD_LIMIT=10+```++This value is in megabytes. The default is 5MB.++<Callout type="info">+ This environment variable controls the UI display. Actual limits may also be enforced by your+ reverse proxy, web server, or S3 configuration.+</Callout>++Ensure your infrastructure supports the configured limit:++<Tabs items={['Nginx', 'S3', 'CloudFront']}>+<Tab value="Nginx">++Set `client_max_body_size` to match or exceed your upload limit.++</Tab>+<Tab value="S3">++Default object size limit is 5GB; multipart upload may be required for large files.++</Tab>+<Tab value="CloudFront">++Default limit is 50MB per request.++</Tab>+</Tabs>++---++## Troubleshooting++<Accordions type="multiple">+ <Accordion title="Access Denied when uploading">+ Causes:+ - Incorrect IAM credentials+ - Bucket policy doesn't allow required operations+ - CORS not configured for presigned URL uploads++ Solutions:+ - Verify IAM user has `s3:PutObject` permission+ - Check bucket policy allows writes+ - Configure CORS to allow your domain++ </Accordion>+ <Accordion title="Invalid endpoint (getaddrinfo ENOTFOUND)">+ Causes:+ - Incorrect region configuration+ - Bucket doesn't exist+ - Network connectivity issues++ Solutions:+ - Verify the bucket exists in the specified region+ - Check the endpoint URL is correct+ - Verify network access to S3++ </Accordion>+ <Accordion title="SignatureDoesNotMatch">+ Causes:+ - Incorrect secret access key+ - Clock skew between server and S3++ Solutions:+ - Verify credentials are correct and not expired+ - Ensure server time is synchronized (use NTP)++ </Accordion>+ <Accordion title="Path-style access required">+ Set path-style access for S3-compatible services:++ ```bash+ NEXT_PRIVATE_UPLOAD_FORCE_PATH_STYLE=true+ ```++ </Accordion>+ <Accordion title="CloudFront signed URL errors (Missing required key 'Key')">+ Causes:+ - Key pair not configured correctly+ - Private key format invalid++ Solutions:+ - Verify the key pair ID matches the CloudFront configuration+ - Ensure the private key is in PEM format+ - Check for whitespace or encoding issues in the key contents++ </Accordion>+</Accordions>++---++## See Also++- [Database Configuration](/docs/self-hosting/configuration/database) - Configure PostgreSQL+- [Environment Variables](/docs/self-hosting/configuration/environment) - Complete configuration reference+- [Backups](/docs/self-hosting/maintenance/backups) - Backup strategies for both storage backends+- [Docker Compose](/docs/self-hosting/deployment/docker-compose) - Deploy with MinIO for local storagediff --git a/apps/docs/content/docs/self-hosting/configuration/telemetry.mdx b/apps/docs/content/docs/self-hosting/configuration/telemetry.mdxnew file mode 100644index 000000000..7db3b652a--- /dev/null+++ b/apps/docs/content/docs/self-hosting/configuration/telemetry.mdx@@ -0,0 +1,123 @@+---+title: Telemetry+description: Learn about the telemetry data that Documenso collects from self-hosted instances.+---++import { Accordion, Accordions } from 'fumadocs-ui/components/accordion';+import { Tab, Tabs } from 'fumadocs-ui/components/tabs';++## Overview++Documenso collects anonymous telemetry data from self-hosted instances to help us understand how the software is being used and make improvements to the product. This telemetry is enabled by default, but you can easily disable it if you prefer.++## What We Collect++We collect minimal, privacy-preserving information that helps us understand the health and adoption of self-hosted installations:++- **App Version**: The version of Documenso you are running. This helps us understand which versions are in use and prioritize support for older versions.++- **Installation ID**: A unique identifier for your installation. This is stored in your database and helps us count distinct installations without knowing who you are.++- **Node ID**: A unique identifier for each server or container instance. This is stored in your operating system's temporary directory and helps us understand deployment patterns (for example, how many instances are running in a cluster).++### What We Don't Collect++We do **not** collect any of the following:++- Personal information about you or your users+- Document contents or file names+- User email addresses or names+- Usage patterns or feature usage statistics+- Server logs or error messages+- Any data that could identify your organisation or users++## Why We Collect Telemetry++The telemetry data we collect serves several important purposes:++<Accordions type="multiple">+ <Accordion title="Product Improvement">+ Understanding which versions are in use helps us prioritize bug fixes and security updates for+ the versions that matter most.+ </Accordion>+ <Accordion title="Support Planning">+ Knowing how many installations exist and their deployment patterns helps us plan support+ resources and documentation.+ </Accordion>+ <Accordion title="Feature Development">+ Understanding deployment patterns (like cluster sizes) helps us make better architectural+ decisions for future features.+ </Accordion>+ <Accordion title="Community Health">+ Tracking adoption helps us understand the growth of the self-hosted community and allocate+ resources accordingly.+ </Accordion>+</Accordions>++All of this is done anonymously and in aggregate. We cannot identify you, your organisation, or your users from the telemetry data we collect.++## Events We Track++We track two simple events:++<Tabs items={['Server Startup', 'Server Heartbeat']}>+<Tab value="Server Startup">++Captured once when your server starts. This tells us when installations are first set up or restarted.++</Tab>+<Tab value="Server Heartbeat">++Captured every hour while your server is running. This helps us understand how many active installations exist and their uptime patterns.++</Tab>+</Tabs>++## How to Disable Telemetry++If you prefer not to send telemetry data, you can disable it by setting an environment variable.++### Using Environment Variables++Add the following to your environment configuration:++```bash+DOCUMENSO_DISABLE_TELEMETRY=true+```++### Docker++If you're using Docker, you can set this in your `docker-compose.yml`:++```yaml+services:+ app:+ environment:+ - DOCUMENSO_DISABLE_TELEMETRY=true+```++Or pass it when running a container:++```bash+docker run -e DOCUMENSO_DISABLE_TELEMETRY=true ...+```++### After Disabling++Once you set `DOCUMENSO_DISABLE_TELEMETRY=true` and restart your server, no telemetry data will be sent. The telemetry client will not initialize, and no network requests will be made to our telemetry servers.++<Callout type="info">+ If you previously had telemetry enabled, the installation ID stored in your database will remain,+ but it will no longer be used or sent anywhere.+</Callout>++## Questions or Concerns++If you have questions about our telemetry practices or concerns about privacy, please reach out to us. We're committed to transparency and respect your choice to disable telemetry if you prefer.++---++## See Also++- [Environment Variables](/docs/self-hosting/configuration/environment) - All configuration options+- [Quick Start](/docs/self-hosting/getting-started/quick-start) - Get started with self-hostingdiff --git a/apps/docs/content/docs/self-hosting/deployment/docker-compose.mdx b/apps/docs/content/docs/self-hosting/deployment/docker-compose.mdxnew file mode 100644index 000000000..87f33610d--- /dev/null+++ b/apps/docs/content/docs/self-hosting/deployment/docker-compose.mdx@@ -0,0 +1,483 @@+---+title: Docker Compose+description: Deploy Documenso with Docker Compose, including PostgreSQL. This production-ready setup is suitable for most self-hosted deployments.+---++import { Accordion, Accordions } from 'fumadocs-ui/components/accordion';+import { Callout } from 'fumadocs-ui/components/callout';+import { Step, Steps } from 'fumadocs-ui/components/steps';++## Prerequisites++Before starting, ensure you have:++- [Docker](https://docs.docker.com/get-docker/) 20.10 or later+- [Docker Compose](https://docs.docker.com/compose/install/) v2.0 or later+- SMTP credentials for sending emails+- At least 2GB of available RAM+- A domain name (for production deployments)++Verify your installation:++```bash+docker --version+docker compose version+```++## Clone and Configure++{/* prettier-ignore */}+<Steps>+<Step>+### Download the compose file++Download the production Docker Compose file:++```bash+mkdir documenso && cd documenso+curl -O https://raw.githubusercontent.com/documenso/documenso/release/docker/production/compose.yml+```++Alternatively, clone the full repository:++```bash+git clone https://github.com/documenso/documenso.git+cd documenso/docker/production+```++</Step>++<Step>+### Create environment file++Create a `.env` file in the same directory as `compose.yml`:++```bash+touch .env+```++Add the required configuration (see [Environment Configuration](#environment-configuration) below).++</Step>+</Steps>++<Callout type="warn">+ The `compose.yml` in the repository may be outdated. Use it as a starting point and verify the+ configuration against the environment variables documented here.+</Callout>++## Docker Compose File Overview++The production `compose.yml` includes two services:++```yaml+name: documenso-production++services:+ database:+ image: postgres:15+ environment:+ - POSTGRES_USER=${POSTGRES_USER:?err}+ - POSTGRES_PASSWORD=${POSTGRES_PASSWORD:?err}+ - POSTGRES_DB=${POSTGRES_DB:?err}+ healthcheck:+ test: ['CMD-SHELL', 'pg_isready -U ${POSTGRES_USER}']+ interval: 10s+ timeout: 5s+ retries: 5+ volumes:+ - database:/var/lib/postgresql/data++ documenso:+ image: documenso/documenso:latest+ depends_on:+ database:+ condition: service_healthy+ environment:+ # See environment configuration below+ ports:+ - ${PORT:-3000}:${PORT:-3000}+ volumes:+ - /opt/documenso/cert.p12:/opt/documenso/cert.p12:ro++volumes:+ database:+```++| Service | Purpose |+| ----------- | ------------------------------------------------------------ |+| `database` | PostgreSQL 15 database with persistent storage |+| `documenso` | Main application container, waits for database to be healthy |++The Documenso container waits for the database health check to pass before starting.++## Environment Configuration++Create a `.env` file with the following variables:++### Required Variables++```bash+# Database (used by both database and documenso services)+POSTGRES_USER=documenso+POSTGRES_PASSWORD=your-secure-database-password+POSTGRES_DB=documenso++# Application secrets (generate with: openssl rand -base64 32)+NEXTAUTH_SECRET=your-nextauth-secret+NEXT_PRIVATE_ENCRYPTION_KEY=your-encryption-key-min-32-characters+NEXT_PRIVATE_ENCRYPTION_SECONDARY_KEY=your-secondary-key-min-32-characters++# Public URL where Documenso is accessible+NEXT_PUBLIC_WEBAPP_URL=https://sign.example.com+NEXT_PRIVATE_INTERNAL_WEBAPP_URL=http://localhost:3000++# Database connection (uses Docker service name)+NEXT_PRIVATE_DATABASE_URL=postgresql://documenso:your-secure-database-password@database:5432/documenso++# Email configuration+NEXT_PRIVATE_SMTP_TRANSPORT=smtp-auth+NEXT_PRIVATE_SMTP_HOST=smtp.example.com+NEXT_PRIVATE_SMTP_PORT=587+NEXT_PRIVATE_SMTP_USERNAME=your-smtp-username+NEXT_PRIVATE_SMTP_PASSWORD=your-smtp-password+NEXT_PRIVATE_SMTP_FROM_NAME=Documenso+```++### Optional Variables++```bash+# Application port (default: 3000)+PORT=3000++# Signing certificate (see Signing Certificate section)+NEXT_PRIVATE_SIGNING_PASSPHRASE=your-certificate-password++# Disable public signups+NEXT_PUBLIC_DISABLE_SIGNUP=false+```++<Callout type="info">Generate secure secrets using: `openssl rand -base64 32`</Callout>++For the complete list of environment variables, see [Environment Variables](/docs/self-hosting/configuration/environment).++### Generating Secrets++Generate the required secrets:++```bash+# Generate NEXTAUTH_SECRET+echo "NEXTAUTH_SECRET=$(openssl rand -base64 32)"++# Generate encryption keys+echo "NEXT_PRIVATE_ENCRYPTION_KEY=$(openssl rand -base64 32)"+echo "NEXT_PRIVATE_ENCRYPTION_SECONDARY_KEY=$(openssl rand -base64 32)"++# Generate database password+echo "POSTGRES_PASSWORD=$(openssl rand -base64 24)"+```++## Signing Certificate++A signing certificate is required for document signing. Generate a `.p12` certificate on your host machine and mount it into the container. See [Local Certificate](/docs/self-hosting/configuration/signing-certificate/local) for how to generate one.++Place the certificate on the host and set permissions so the container can read it (UID 1001):++```bash+sudo mkdir -p /opt/documenso+sudo cp /path/to/your/cert.p12 /opt/documenso/cert.p12+sudo chown 1001:1001 /opt/documenso/cert.p12+sudo chmod 400 /opt/documenso/cert.p12+```++The `compose.yml` mounts this path into the container. Add the passphrase to your `.env` file:++```bash+NEXT_PRIVATE_SIGNING_PASSPHRASE=your-certificate-password+```++If file mounting is not available, you can set `NEXT_PRIVATE_SIGNING_LOCAL_FILE_CONTENTS` with the base64-encoded certificate string instead.++For production deployments that require Adobe Approved Trust List recognition, consider using a [Google Cloud HSM](/docs/self-hosting/configuration/signing-certificate/google-cloud-hsm) or another external HSM.++<Callout type="warn">+ Do not generate or store the signing certificate inside the container. If the container is+ destroyed and rebuilt, or if you run multiple instances, the certificate will be lost or+ inconsistent. Always provide the certificate externally.+</Callout>++## Starting Services++Start all services:++```bash+docker compose --env-file .env up -d+```++Check that containers are running:++```bash+docker compose ps+```++Expected output:++```+NAME STATUS PORTS+documenso-production-database-1 running (healthy) 5432/tcp+documenso-production-documenso-1 running 0.0.0.0:3000->3000/tcp+```++Wait for the database to be healthy and for migrations to complete. Check the logs:++```bash+docker compose logs -f documenso+```++Look for "Ready" or "Listening on port 3000" in the output.++## Accessing Documenso++Once the containers are running:++- **Local access**: Open [http://localhost:3000](http://localhost:3000)+- **Remote access**: Use the URL configured in `NEXT_PUBLIC_WEBAPP_URL`++### First Account Setup++Navigate to the signup page and create your account. Verify your email address — if emails are not being delivered, check the container logs for SMTP errors.++<Callout type="info">+ All accounts created through signup are regular user accounts. Admin access must be granted+ directly in the database. Once your accounts are set up, consider disabling public signups by+ setting `NEXT_PUBLIC_DISABLE_SIGNUP=true`.+</Callout>++## Managing Services++### View Logs++View all service logs:++```bash+docker compose logs -f+```++View logs for a specific service:++```bash+docker compose logs -f documenso+docker compose logs -f database+```++### Restart Services++Restart all services:++```bash+docker compose --env-file .env restart+```++Restart a specific service:++```bash+docker compose --env-file .env restart documenso+```++### Stop Services++Stop without removing containers:++```bash+docker compose stop+```++Stop and remove containers (preserves volumes):++```bash+docker compose down+```++Stop, remove containers, and delete data:++```bash+docker compose down -v+```++<Callout type="error">+ Using `down -v` deletes the database volume. Back up your data first.+</Callout>++### Update Documenso++{/* prettier-ignore */}+<Steps>+ <Step>+ Pull the latest image:++```bash+docker compose pull+```++ </Step>+ <Step>+ Recreate containers:++```bash+docker compose --env-file .env up -d+```++ </Step>+</Steps>++Database migrations run automatically on container startup.++<Callout type="warn">+ Back up your database before upgrading. See [Backups](/docs/self-hosting/maintenance/backups).+</Callout>++## Production Considerations++### Reverse Proxy++For production, place Documenso behind a reverse proxy for SSL termination:++**nginx example:**++```nginx+server {+ listen 443 ssl http2;+ server_name sign.example.com;++ ssl_certificate /path/to/cert.pem;+ ssl_certificate_key /path/to/key.pem;++ location / {+ proxy_pass http://localhost:3000;+ proxy_http_version 1.1;+ proxy_set_header Upgrade $http_upgrade;+ proxy_set_header Connection 'upgrade';+ proxy_set_header Host $host;+ proxy_set_header X-Real-IP $remote_addr;+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;+ proxy_set_header X-Forwarded-Proto $scheme;+ proxy_cache_bypass $http_upgrade;+ }+}+```++**Caddy example:**++```+sign.example.com {+ reverse_proxy localhost:3000+}+```++### Database Backups++Set up automated database backups:++```bash+# Manual backup+docker compose exec database pg_dump -U documenso documenso > backup.sql++# Restore from backup+docker compose exec -T database psql -U documenso documenso < backup.sql+```++See [Backups](/docs/self-hosting/maintenance/backups) for automated backup strategies.++### Resource Limits++Add resource limits to prevent container resource exhaustion:++```yaml+services:+ documenso:+ deploy:+ resources:+ limits:+ cpus: '2'+ memory: 2G+ reservations:+ cpus: '0.5'+ memory: 512M+```++### External Database++For production, consider using a managed PostgreSQL service:++{/* prettier-ignore */}+<Steps>+ <Step>+ Remove the `database` service from `compose.yml`+ </Step>+ <Step>+ Update environment variables:++```bash+NEXT_PRIVATE_DATABASE_URL=postgresql://user:password@your-db-host:5432/documenso+NEXT_PRIVATE_DIRECT_DATABASE_URL=postgresql://user:password@your-db-host:5432/documenso+```++ </Step>+</Steps>++### S3 Storage++For high-volume deployments, configure S3-compatible storage:++```bash+NEXT_PUBLIC_UPLOAD_TRANSPORT=s3+NEXT_PRIVATE_UPLOAD_BUCKET=your-bucket+NEXT_PRIVATE_UPLOAD_REGION=us-east-1+NEXT_PRIVATE_UPLOAD_ACCESS_KEY_ID=your-access-key+NEXT_PRIVATE_UPLOAD_SECRET_ACCESS_KEY=your-secret-key+```++See [Storage Configuration](/docs/self-hosting/configuration/storage).++## Troubleshooting++<Accordions type="multiple">+ <Accordion title="Container fails to start">+ Check logs: `docker compose logs documenso`. Common causes: missing environment variables+ (ensure all required variables are in `.env`), database not ready (the container waits for+ database health check), port conflict (change `PORT` in `.env` if 3000 is in use).+ </Accordion>+ <Accordion title="Database connection errors">+ Verify the database is healthy: `docker compose ps database`. Test: `docker compose exec+ database psql -U documenso -d documenso -c "SELECT 1"`.+ </Accordion>+ <Accordion title="Certificate errors">+ Check certificate status: `curl http://localhost:3000/api/certificate-status`. Common issues:+ file not found (verify volume mount in `compose.yml`), permission denied (run `chown 1001:1001`+ on the certificate file), no password (the certificate must have a password).+ </Accordion>+ <Accordion title="Emails not sending">+ Check `NEXT_PRIVATE_SMTP_TRANSPORT` matches your setup, verify host, port, username, and+ password, check logs: `docker compose logs documenso | grep -i smtp`.+ </Accordion>+ <Accordion title="Application unreachable">+ Verify containers are running: `docker compose ps`; check the port mapping matches your `.env`;+ test locally: `curl http://localhost:3000/api/health`; check firewall rules allow traffic on the+ configured port.+ </Accordion>+ <Accordion title="Out of disk space">+ Check disk usage: `docker system df`. Clean up: `docker system prune -a`.+ </Accordion>+</Accordions>++---++## See Also++- [Environment Variables](/docs/self-hosting/configuration/environment) - Full configuration reference+- [Signing Certificate](/docs/self-hosting/configuration/signing-certificate) - Certificate setup details+- [Email Configuration](/docs/self-hosting/configuration/email) - SMTP and email provider setup+- [Storage Configuration](/docs/self-hosting/configuration/storage) - S3 storage setup+- [Backups](/docs/self-hosting/maintenance/backups) - Backup strategies+- [Upgrades](/docs/self-hosting/maintenance/upgrades) - Upgrade proceduresdiff --git a/apps/docs/content/docs/self-hosting/deployment/docker.mdx b/apps/docs/content/docs/self-hosting/deployment/docker.mdxnew file mode 100644index 000000000..68bcc2abc--- /dev/null+++ b/apps/docs/content/docs/self-hosting/deployment/docker.mdx@@ -0,0 +1,307 @@+---+title: Docker+description: Run Documenso as a standalone Docker container with an external database. Ideal for container platforms like AWS ECS, Google Cloud Run, or Azure Container Instances.+---++import { Accordion, Accordions } from 'fumadocs-ui/components/accordion';+import { Callout } from 'fumadocs-ui/components/callout';+import { Step, Steps } from 'fumadocs-ui/components/steps';++## Prerequisites++For a self-contained setup that includes PostgreSQL, see [Docker Compose Deployment](/docs/self-hosting/deployment/docker-compose).++Before starting, ensure you have:++- [Docker](https://docs.docker.com/get-docker/) 20.10 or later installed+- A PostgreSQL 14+ database accessible from your Docker host+- SMTP credentials for sending emails+- At least 1GB of available RAM++Verify Docker is installed:++```bash+docker --version+```++## Pulling the Docker Image++```bash+docker pull documenso/documenso:latest+```++### Available Tags++| Tag | Description |+| --------- | -------------------------------- |+| `latest` | Latest stable release |+| `x.y.z` | Specific version (e.g., `1.5.0`) |+| `release` | Latest release branch build |++<Callout type="info">+ Pin to a specific version tag in production to avoid unexpected updates.+</Callout>++## Environment Variables++### Required Variables++These variables must be set for Documenso to start:++| Variable | Description | Default |+| --------------------------------------- | --------------------------------------------------------------------------- | ----------------------------- |+| `NEXTAUTH_SECRET` | Secret key for session encryption. Generate with `openssl rand -base64 32` | - |+| `NEXT_PRIVATE_ENCRYPTION_KEY` | Primary encryption key (minimum 32 characters) | - |+| `NEXT_PRIVATE_ENCRYPTION_SECONDARY_KEY` | Secondary encryption key (minimum 32 characters) | - |+| `NEXT_PUBLIC_WEBAPP_URL` | Public URL where Documenso is accessible (e.g., `https://sign.example.com`) | - |+| `NEXT_PRIVATE_INTERNAL_WEBAPP_URL` | Internal URL the app uses to call itself (for background jobs) | Same as `NEXT_PUBLIC_WEBAPP_URL` |+| `NEXT_PRIVATE_DATABASE_URL` | PostgreSQL connection string | - |+| `NEXT_PRIVATE_SMTP_TRANSPORT` | Email transport: `smtp-auth`, `smtp-api`, `resend`, or `mailchannels` | `smtp-auth` |+| `NEXT_PRIVATE_SMTP_FROM_NAME` | Sender name for outgoing emails | - |+| `NEXT_PRIVATE_SMTP_FROM_ADDRESS` | Sender email address | - |++### Database Connection++Documenso requires two database connection strings:++| Variable | Required | Default | Description |+| ---------------------------------- | ------------ | --------------------------- | --------------------------------- |+| `NEXT_PRIVATE_DATABASE_URL` | Yes | - | Pooled connection for app queries |+| `NEXT_PRIVATE_DIRECT_DATABASE_URL` | When pooling | `NEXT_PRIVATE_DATABASE_URL` | Direct connection for migrations |++Connection string format:++```+postgresql://user:password@host:5432/database+```++If you're not using a connection pooler like PgBouncer, both variables can use the same connection string.++### SMTP Configuration++For `smtp-auth` transport:++| Variable | Required | Default | Description |+| ---------------------------- | -------- | ----------- | ------------------------------------- |+| `NEXT_PRIVATE_SMTP_HOST` | Yes | `127.0.0.1` | SMTP server hostname |+| `NEXT_PRIVATE_SMTP_PORT` | Yes | `587` | SMTP server port (usually 587 or 465) |+| `NEXT_PRIVATE_SMTP_USERNAME` | Yes | - | SMTP username |+| `NEXT_PRIVATE_SMTP_PASSWORD` | Yes | - | SMTP password |+| `NEXT_PRIVATE_SMTP_SECURE` | No | `false` | Set to `true` to force TLS |++See [Email Configuration](/docs/self-hosting/configuration/email) for other transport options.++### Optional Variables++| Variable | Description | Default |+| ------------------------------------------- | -------------------------------------------------------------- | ------------------------- |+| `PORT` | Port the application listens on | `3000` |+| `NEXT_PRIVATE_SIGNING_LOCAL_FILE_PATH` | Path to signing certificate inside container | `/opt/documenso/cert.p12` |+| `NEXT_PRIVATE_SIGNING_PASSPHRASE` | Passphrase for the signing certificate | - |+| `NEXT_PRIVATE_SIGNING_LOCAL_FILE_CONTENTS` | Base64-encoded `.p12` certificate (alternative to file path) | - |+| `NEXT_PUBLIC_UPLOAD_TRANSPORT` | Document storage: `database` or `s3` | `database` |+| `NEXT_PUBLIC_DISABLE_SIGNUP` | Disable public signups | `false` |++For the complete list, see [Environment Variables](/docs/self-hosting/configuration/environment).++## Running with Docker++### Minimum Example++```bash+docker run -d \+ --name documenso \+ -p 3000:3000 \+ -v /path/to/cert.p12:/opt/documenso/cert.p12:ro \+ -e NEXTAUTH_SECRET="$(openssl rand -base64 32)" \+ -e NEXT_PRIVATE_ENCRYPTION_KEY="your-encryption-key-min-32-chars" \+ -e NEXT_PRIVATE_ENCRYPTION_SECONDARY_KEY="your-secondary-key-min-32-chars" \+ -e NEXT_PUBLIC_WEBAPP_URL="https://sign.example.com" \+ -e NEXT_PRIVATE_INTERNAL_WEBAPP_URL="http://localhost:3000" \+ -e NEXT_PRIVATE_DATABASE_URL="postgresql://user:password@db-host:5432/documenso" \+ -e NEXT_PRIVATE_SIGNING_PASSPHRASE="your-certificate-password" \+ -e NEXT_PRIVATE_SMTP_TRANSPORT="smtp-auth" \+ -e NEXT_PRIVATE_SMTP_HOST="smtp.example.com" \+ -e NEXT_PRIVATE_SMTP_PORT="587" \+ -e NEXT_PRIVATE_SMTP_USERNAME="your-smtp-user" \+ -e NEXT_PRIVATE_SMTP_PASSWORD="your-smtp-password" \+ -e NEXT_PRIVATE_SMTP_FROM_NAME="Documenso" \+ -e NEXT_PRIVATE_SMTP_FROM_ADDRESS="[email protected]" \+ documenso/documenso:latest+```++### Signing Certificate++A signing certificate is required for document signing. You have two options for providing one:++- **Volume mount** — mount a `.p12` file from the host into the container at `/opt/documenso/cert.p12` (shown above). This is the simplest approach for small to moderate deployments.+- **Base64-encoded contents** — set `NEXT_PRIVATE_SIGNING_LOCAL_FILE_CONTENTS` with the base64-encoded certificate string. Use this when file mounting is not available (e.g., Railway, Vercel).++For production deployments that require Adobe Approved Trust List recognition, consider using a [Google Cloud HSM](/docs/self-hosting/configuration/signing-certificate/google-cloud-hsm) or another external HSM.++<Callout type="warn">+ Do not generate or store the signing certificate inside the container. If the container is+ destroyed and rebuilt, or if you run multiple instances, the certificate will be lost or+ inconsistent. Always provide the certificate externally.+</Callout>++See [Signing Certificate Configuration](/docs/self-hosting/configuration/signing-certificate) for generating certificates and detailed setup.++### Using an Environment File++For easier management, use an environment file:++Create `.env`:++```bash+NEXTAUTH_SECRET=your-secret-here+NEXT_PRIVATE_ENCRYPTION_KEY=your-encryption-key-min-32-chars+NEXT_PRIVATE_ENCRYPTION_SECONDARY_KEY=your-secondary-key-min-32-chars+NEXT_PUBLIC_WEBAPP_URL=https://sign.example.com+NEXT_PRIVATE_INTERNAL_WEBAPP_URL=http://localhost:3000+NEXT_PRIVATE_DATABASE_URL=postgresql://user:password@db-host:5432/documenso+NEXT_PRIVATE_DIRECT_DATABASE_URL=postgresql://user:password@db-host:5432/documenso+NEXT_PRIVATE_SIGNING_PASSPHRASE=your-certificate-password+NEXT_PRIVATE_SMTP_TRANSPORT=smtp-auth+NEXT_PRIVATE_SMTP_HOST=smtp.example.com+NEXT_PRIVATE_SMTP_PORT=587+NEXT_PRIVATE_SMTP_USERNAME=your-smtp-user+NEXT_PRIVATE_SMTP_PASSWORD=your-smtp-password+NEXT_PRIVATE_SMTP_FROM_NAME=Documenso+```++Run with the environment file:++```bash+docker run -d \+ --name documenso \+ -p 3000:3000 \+ --env-file .env \+ -v /path/to/cert.p12:/opt/documenso/cert.p12:ro \+ documenso/documenso:latest+```++## Health Checks++Documenso provides health check endpoints for monitoring:++| Endpoint | Purpose |+| ------------------------- | -------------------------------------------------------------- |+| `/api/health` | Checks database connectivity and certificate status |+| `/api/certificate-status` | Returns whether a signing certificate is configured and usable |++### Docker Health Check++Add a health check to your container:++```bash+docker run -d \+ --name documenso \+ -p 3000:3000 \+ --health-cmd="curl -f http://localhost:3000/api/health || exit 1" \+ --health-interval=30s \+ --health-timeout=10s \+ --health-retries=3 \+ --env-file .env \+ documenso/documenso:latest+```++Check container health status:++```bash+docker inspect --format='{{.State.Health.Status}}' documenso+```++## Updating the Container++To update Documenso to a new version:++{/* prettier-ignore */}+<Steps>+<Step>++### Pull the new image++```bash+docker pull documenso/documenso:latest+```++</Step>+<Step>++### Stop and remove the existing container++```bash+docker stop documenso+docker rm documenso+```++</Step>+<Step>++### Start a new container with the same configuration++```bash+docker run -d \+ --name documenso \+ -p 3000:3000 \+ --env-file .env \+ -v /path/to/cert.p12:/opt/documenso/cert.p12:ro \+ documenso/documenso:latest+```++</Step>+</Steps>++<Callout type="info">+ Database migrations run automatically when the container starts. Back up your database before+ upgrading.+</Callout>++## Persistence++The Documenso container is stateless. All persistent data is stored in the PostgreSQL database.++By default, documents are also stored in the database. For high-volume deployments, configure S3-compatible storage instead. See [Storage Configuration](/docs/self-hosting/configuration/storage) for S3 setup.++## Troubleshooting++<Accordions type="multiple">+ <Accordion title="Container fails to start">+ Check the container logs: `docker logs documenso`. Common causes: missing required environment+ variables (ensure all required variables are set), database connection failed (verify the+ database URL and network connectivity), port already in use (change the host port or stop the+ conflicting service).+ </Accordion>+ <Accordion title="Database connection errors">+ Test connectivity: `docker run --rm postgres:15 psql+ "postgresql://user:password@host:5432/database" -c "SELECT 1"`. If using Docker networks, ensure+ the container can reach the database.+ </Accordion>+ <Accordion title="Certificate errors">+ Check certificate status: `curl http://localhost:3000/api/certificate-status`. Common issues:+ file not found (verify the volume mount path), permission denied (ensure the file is readable,+ UID 1001 inside the container), no password (the certificate must have a password set). Fix+ permissions: `chmod 644 /path/to/cert.p12` and `chown 1001:1001 /path/to/cert.p12`.+ </Accordion>+ <Accordion title="Emails not sending">+ Verify SMTP configuration: check `NEXT_PRIVATE_SMTP_TRANSPORT` matches your configuration, for+ `smtp-auth` ensure host, port, username, and password are correct, check if your SMTP provider+ requires TLS (`NEXT_PRIVATE_SMTP_SECURE=true`).+ </Accordion>+ <Accordion title="Container runs but application is inaccessible">+ Verify port mapping `-p 3000:3000`, check if `NEXT_PUBLIC_WEBAPP_URL` matches how you're+ accessing the application, ensure no firewall is blocking the port.+ </Accordion>+</Accordions>++---++## See Also++- [Docker Compose Deployment](/docs/self-hosting/deployment/docker-compose) - Multi-container setup with PostgreSQL included+- [Environment Variables](/docs/self-hosting/configuration/environment) - Full configuration reference+- [Signing Certificate](/docs/self-hosting/configuration/signing-certificate) - Set up document signing+- [Email Configuration](/docs/self-hosting/configuration/email) - Configure SMTP providers+- [Storage Configuration](/docs/self-hosting/configuration/storage) - Set up S3-compatible storagediff --git a/apps/docs/content/docs/self-hosting/deployment/index.mdx b/apps/docs/content/docs/self-hosting/deployment/index.mdxnew file mode 100644index 000000000..a71791fbd--- /dev/null+++ b/apps/docs/content/docs/self-hosting/deployment/index.mdx@@ -0,0 +1,39 @@+---+title: Deployment+description: Deploy Documenso using Docker, Docker Compose, Railway, or Kubernetes.+---++| Method | Best For | Difficulty |+| -------------------------------------------------------------- | ----------------------------------- | ---------- |+| [Docker](/docs/self-hosting/deployment/docker) | Single container, external database | Easy |+| [Docker Compose](/docs/self-hosting/deployment/docker-compose) | Self-contained setup, small teams | Easy |+| [Railway](/docs/self-hosting/deployment/railway) | Quick deployment, managed | Very Easy |+| [Kubernetes](/docs/self-hosting/deployment/kubernetes) | Enterprise, high availability | Advanced |++<Cards>+ <Card+ title="Docker"+ description="Single container with external database."+ href="/docs/self-hosting/deployment/docker"+ />+ <Card+ title="Docker Compose"+ description="Production-ready multi-container setup."+ href="/docs/self-hosting/deployment/docker-compose"+ />+ <Card+ title="Railway"+ description="One-click deployment on Railway."+ href="/docs/self-hosting/deployment/railway"+ />+ <Card+ title="Kubernetes"+ description="Scalable Kubernetes deployment."+ href="/docs/self-hosting/deployment/kubernetes"+ />+</Cards>++## See Also++- [Requirements](/docs/self-hosting/getting-started/requirements) - Check prerequisites first+- [Configuration](/docs/self-hosting/configuration) - Configure your deploymentdiff --git a/apps/docs/content/docs/self-hosting/deployment/kubernetes.mdx b/apps/docs/content/docs/self-hosting/deployment/kubernetes.mdxnew file mode 100644index 000000000..d8adb8ac9--- /dev/null+++ b/apps/docs/content/docs/self-hosting/deployment/kubernetes.mdx@@ -0,0 +1,868 @@+---+title: Kubernetes+description: Deploy Documenso on Kubernetes for production environments requiring high availability, auto-scaling, and enterprise-grade infrastructure.+---++import { Accordion, Accordions } from 'fumadocs-ui/components/accordion';+import { Callout } from 'fumadocs-ui/components/callout';++## Prerequisites++Before starting, ensure you have:++- A Kubernetes cluster (1.24+) running and accessible+- `kubectl` configured to communicate with your cluster+- A PostgreSQL 14+ database (in-cluster or external)+- SMTP credentials for sending emails+- A domain name with DNS configured+- An Ingress controller installed (nginx-ingress, traefik, etc.)++Verify your cluster connection:++```bash+kubectl cluster-info+kubectl get nodes+```++## Architecture Overview++A typical Documenso Kubernetes deployment consists of:++```mermaid+flowchart TD+ A["Ingress (TLS termination)"] --> B["Service (ClusterIP)"]+ B --> C1["Pod (app)"]+ B --> C2["Pod (app)"]+ B --> C3["Pod (app)"]+ C1 --> D["PostgreSQL (external or in-cluster)"]+ C2 --> D+ C3 --> D+```++## Namespace Setup++Create a dedicated namespace for Documenso:++```yaml+# namespace.yaml+apiVersion: v1+kind: Namespace+metadata:+ name: documenso+ labels:+ app.kubernetes.io/name: documenso+```++Apply the namespace:++```bash+kubectl apply -f namespace.yaml+```++## Secrets Configuration++Store sensitive configuration in Kubernetes Secrets.++### Generate Secrets++First, generate the required secret values:++```bash+# Generate NEXTAUTH_SECRET+openssl rand -base64 32++# Generate encryption keys (minimum 32 characters each)+openssl rand -base64 32+openssl rand -base64 32+```++### Create the Secret++```yaml+# secret.yaml+apiVersion: v1+kind: Secret+metadata:+ name: documenso-secrets+ namespace: documenso+ labels:+ app.kubernetes.io/name: documenso+type: Opaque+stringData:+ NEXTAUTH_SECRET: 'your-generated-secret-here'+ NEXT_PRIVATE_ENCRYPTION_KEY: 'your-encryption-key-min-32-chars'+ NEXT_PRIVATE_ENCRYPTION_SECONDARY_KEY: 'your-secondary-key-min-32-chars'+ NEXT_PRIVATE_DATABASE_URL: 'postgresql://user:password@postgres-host:5432/documenso'+ NEXT_PRIVATE_DIRECT_DATABASE_URL: 'postgresql://user:password@postgres-host:5432/documenso'+ NEXT_PRIVATE_SMTP_USERNAME: 'your-smtp-username'+ NEXT_PRIVATE_SMTP_PASSWORD: 'your-smtp-password'+ NEXT_PRIVATE_SIGNING_PASSPHRASE: 'your-certificate-passphrase'+```++<Callout type="warn">+ Never commit Secret manifests with real values to version control. Use a secrets management tool+ like Sealed Secrets, External Secrets Operator, or your cloud provider's secret manager.+</Callout>++Apply the secret:++```bash+kubectl apply -f secret.yaml+```++## ConfigMap++Store non-sensitive configuration in a ConfigMap:++```yaml+# configmap.yaml+apiVersion: v1+kind: ConfigMap+metadata:+ name: documenso-config+ namespace: documenso+ labels:+ app.kubernetes.io/name: documenso+data:+ NEXT_PUBLIC_WEBAPP_URL: 'https://sign.example.com'+ NEXT_PRIVATE_SMTP_TRANSPORT: 'smtp-auth'+ NEXT_PRIVATE_SMTP_HOST: 'smtp.example.com'+ NEXT_PRIVATE_SMTP_PORT: '587'+ NEXT_PRIVATE_SMTP_FROM_NAME: 'Documenso'+ NEXT_PRIVATE_SMTP_FROM_ADDRESS: '[email protected]'+ NEXT_PRIVATE_INTERNAL_WEBAPP_URL: 'http://localhost:3000'+ NEXT_PRIVATE_SIGNING_LOCAL_FILE_PATH: '/opt/documenso/cert.p12'+ NEXT_PUBLIC_UPLOAD_TRANSPORT: 'database'+```++Apply the ConfigMap:++```bash+kubectl apply -f configmap.yaml+```++## Deployment++Create the Documenso Deployment:++```yaml+# deployment.yaml+apiVersion: apps/v1+kind: Deployment+metadata:+ name: documenso+ namespace: documenso+ labels:+ app.kubernetes.io/name: documenso+ app.kubernetes.io/component: web+spec:+ replicas: 2+ selector:+ matchLabels:+ app.kubernetes.io/name: documenso+ app.kubernetes.io/component: web+ strategy:+ type: RollingUpdate+ rollingUpdate:+ maxSurge: 1+ maxUnavailable: 0+ template:+ metadata:+ labels:+ app.kubernetes.io/name: documenso+ app.kubernetes.io/component: web+ spec:+ securityContext:+ runAsUser: 1001+ runAsGroup: 1001+ fsGroup: 1001+ containers:+ - name: documenso+ image: documenso/documenso:latest+ imagePullPolicy: Always+ ports:+ - name: http+ containerPort: 3000+ protocol: TCP+ envFrom:+ - configMapRef:+ name: documenso-config+ - secretRef:+ name: documenso-secrets+ resources:+ requests:+ cpu: 250m+ memory: 512Mi+ limits:+ cpu: 1000m+ memory: 1Gi+ livenessProbe:+ httpGet:+ path: /api/health+ port: http+ initialDelaySeconds: 30+ periodSeconds: 10+ timeoutSeconds: 5+ failureThreshold: 3+ readinessProbe:+ httpGet:+ path: /api/health+ port: http+ initialDelaySeconds: 10+ periodSeconds: 5+ timeoutSeconds: 3+ failureThreshold: 3+ startupProbe:+ httpGet:+ path: /api/health+ port: http+ initialDelaySeconds: 10+ periodSeconds: 5+ timeoutSeconds: 3+ failureThreshold: 30+ volumeMounts:+ - name: signing-cert+ mountPath: /opt/documenso/cert.p12+ subPath: cert.p12+ readOnly: true+ volumes:+ - name: signing-cert+ secret:+ secretName: documenso-signing-cert+ items:+ - key: cert.p12+ path: cert.p12+```++<Callout type="info">+ Pin to a specific image tag (e.g., `documenso/documenso:1.5.0`) in production instead of `latest`+ to ensure predictable deployments.+</Callout>++### Signing Certificate Secret++Create a secret for the signing certificate:++```bash+kubectl create secret generic documenso-signing-cert \+ --namespace documenso \+ --from-file=cert.p12=/path/to/your/cert.p12+```++Apply the deployment:++```bash+kubectl apply -f deployment.yaml+```++## Service++Expose the Deployment with a Service:++```yaml+# service.yaml+apiVersion: v1+kind: Service+metadata:+ name: documenso+ namespace: documenso+ labels:+ app.kubernetes.io/name: documenso+ app.kubernetes.io/component: web+spec:+ type: ClusterIP+ ports:+ - name: http+ port: 80+ targetPort: http+ protocol: TCP+ selector:+ app.kubernetes.io/name: documenso+ app.kubernetes.io/component: web+```++Apply the service:++```bash+kubectl apply -f service.yaml+```++## Ingress Configuration++### nginx-ingress++```yaml+# ingress-nginx.yaml+apiVersion: networking.k8s.io/v1+kind: Ingress+metadata:+ name: documenso+ namespace: documenso+ labels:+ app.kubernetes.io/name: documenso+ annotations:+ nginx.ingress.kubernetes.io/proxy-body-size: '50m'+ nginx.ingress.kubernetes.io/proxy-read-timeout: '300'+ nginx.ingress.kubernetes.io/proxy-send-timeout: '300'+ cert-manager.io/cluster-issuer: 'letsencrypt-prod'+spec:+ ingressClassName: nginx+ tls:+ - hosts:+ - sign.example.com+ secretName: documenso-tls+ rules:+ - host: sign.example.com+ http:+ paths:+ - path: /+ pathType: Prefix+ backend:+ service:+ name: documenso+ port:+ name: http+```++### Traefik++```yaml+# ingress-traefik.yaml+apiVersion: networking.k8s.io/v1+kind: Ingress+metadata:+ name: documenso+ namespace: documenso+ labels:+ app.kubernetes.io/name: documenso+ annotations:+ traefik.ingress.kubernetes.io/router.entrypoints: websecure+ traefik.ingress.kubernetes.io/router.tls: 'true'+ cert-manager.io/cluster-issuer: 'letsencrypt-prod'+spec:+ ingressClassName: traefik+ tls:+ - hosts:+ - sign.example.com+ secretName: documenso-tls+ rules:+ - host: sign.example.com+ http:+ paths:+ - path: /+ pathType: Prefix+ backend:+ service:+ name: documenso+ port:+ name: http+```++Apply your chosen ingress:++```bash+kubectl apply -f ingress-nginx.yaml+# or+kubectl apply -f ingress-traefik.yaml+```++## Database Options++### External Database (Recommended)++For production, use a managed PostgreSQL service:++- AWS RDS for PostgreSQL+- Google Cloud SQL+- Azure Database for PostgreSQL+- DigitalOcean Managed Databases++Update `NEXT_PRIVATE_DATABASE_URL` in your Secret with the connection string from your provider.++### In-Cluster PostgreSQL++For testing or development, deploy PostgreSQL in the cluster:++```yaml+# postgres.yaml+apiVersion: v1+kind: PersistentVolumeClaim+metadata:+ name: postgres-pvc+ namespace: documenso+spec:+ accessModes:+ - ReadWriteOnce+ resources:+ requests:+ storage: 10Gi+---+apiVersion: v1+kind: Secret+metadata:+ name: postgres-secrets+ namespace: documenso+type: Opaque+stringData:+ POSTGRES_USER: documenso+ POSTGRES_PASSWORD: your-secure-password+ POSTGRES_DB: documenso+---+apiVersion: apps/v1+kind: Deployment+metadata:+ name: postgres+ namespace: documenso+spec:+ replicas: 1+ selector:+ matchLabels:+ app.kubernetes.io/name: postgres+ template:+ metadata:+ labels:+ app.kubernetes.io/name: postgres+ spec:+ containers:+ - name: postgres+ image: postgres:15-alpine+ ports:+ - containerPort: 5432+ envFrom:+ - secretRef:+ name: postgres-secrets+ volumeMounts:+ - name: postgres-data+ mountPath: /var/lib/postgresql/data+ resources:+ requests:+ cpu: 250m+ memory: 256Mi+ limits:+ cpu: 1000m+ memory: 1Gi+ volumes:+ - name: postgres-data+ persistentVolumeClaim:+ claimName: postgres-pvc+---+apiVersion: v1+kind: Service+metadata:+ name: postgres+ namespace: documenso+spec:+ type: ClusterIP+ ports:+ - port: 5432+ targetPort: 5432+ selector:+ app.kubernetes.io/name: postgres+```++<Callout type="warn">+ In-cluster PostgreSQL is not recommended for production. It lacks high availability, automated+ backups, and point-in-time recovery that managed services provide.+</Callout>++Update your Documenso secret to use the in-cluster database:++```yaml+NEXT_PRIVATE_DATABASE_URL: 'postgresql://documenso:[email protected]:5432/documenso'+NEXT_PRIVATE_DIRECT_DATABASE_URL: 'postgresql://documenso:[email protected]:5432/documenso'+```++## Persistent Storage++Documenso stores documents in the database by default. For high-volume deployments, configure S3-compatible storage.++### S3 Configuration++Add these to your ConfigMap and Secret:++```yaml+# In configmap.yaml, add:+data:+ NEXT_PUBLIC_UPLOAD_TRANSPORT: 's3'++# In secret.yaml, add:+stringData:+ NEXT_PRIVATE_UPLOAD_ENDPOINT: 'https://s3.amazonaws.com'+ NEXT_PRIVATE_UPLOAD_REGION: 'us-east-1'+ NEXT_PRIVATE_UPLOAD_BUCKET: 'your-documenso-bucket'+ NEXT_PRIVATE_UPLOAD_ACCESS_KEY_ID: 'your-access-key'+ NEXT_PRIVATE_UPLOAD_SECRET_ACCESS_KEY: 'your-secret-key'+```++See [Storage Configuration](/docs/self-hosting/configuration/storage) for detailed S3 setup instructions.++## Scaling++### Horizontal Pod Autoscaler (HPA)++Scale Documenso based on CPU and memory utilization:++```yaml+# hpa.yaml+apiVersion: autoscaling/v2+kind: HorizontalPodAutoscaler+metadata:+ name: documenso+ namespace: documenso+ labels:+ app.kubernetes.io/name: documenso+spec:+ scaleTargetRef:+ apiVersion: apps/v1+ kind: Deployment+ name: documenso+ minReplicas: 2+ maxReplicas: 10+ metrics:+ - type: Resource+ resource:+ name: cpu+ target:+ type: Utilization+ averageUtilization: 70+ - type: Resource+ resource:+ name: memory+ target:+ type: Utilization+ averageUtilization: 80+ behavior:+ scaleDown:+ stabilizationWindowSeconds: 300+ policies:+ - type: Percent+ value: 10+ periodSeconds: 60+ scaleUp:+ stabilizationWindowSeconds: 0+ policies:+ - type: Percent+ value: 100+ periodSeconds: 15+ - type: Pods+ value: 4+ periodSeconds: 15+ selectPolicy: Max+```++Apply the HPA:++```bash+kubectl apply -f hpa.yaml+```++### Pod Disruption Budget++Ensure availability during cluster maintenance:++```yaml+# pdb.yaml+apiVersion: policy/v1+kind: PodDisruptionBudget+metadata:+ name: documenso+ namespace: documenso+ labels:+ app.kubernetes.io/name: documenso+spec:+ minAvailable: 1+ selector:+ matchLabels:+ app.kubernetes.io/name: documenso+ app.kubernetes.io/component: web+```++Apply the PDB:++```bash+kubectl apply -f pdb.yaml+```++## Troubleshooting++<Accordions type="multiple">+ <Accordion title="Pods not starting">+ Check pod status:++ ```bash+ # Get pod status+ kubectl get pods -n documenso++ # Describe pod+ kubectl describe pod <pod-name> -n documenso+ ```++ Common causes:+ - ImagePullBackOff (check image name and registry access)+ - CrashLoopBackOff (check logs for application errors)+ - Pending (check resource requests and node capacity)+ </Accordion>+ <Accordion title="Database connection errors">+ Verify the database is accessible from the cluster:++ ```bash+ kubectl run postgres-test --rm -it --image=postgres:15-alpine -n documenso -- psql "postgresql://user:password@host:5432/database" -c "SELECT 1"+ ```+ </Accordion>+ <Accordion title="Ingress not working">+ Check Ingress status:++ ```bash+ # Get Ingress status+ kubectl get ingress -n documenso++ # Describe Ingress+ kubectl describe ingress documenso -n documenso+ ```++ Verify the Ingress controller is running:++ ```bash+ # Get Ingress controller status+ kubectl get pods -n ingress-nginx++ # Get Traefik controller status+ kubectl get pods -n traefik+ ```+ </Accordion>+ <Accordion title="Certificate errors">+ Check the signing certificate secret:++ ```bash+ # Get signing certificate secret+ kubectl get secret documenso-signing-cert -n documenso -o yaml+ ```++ Verify the certificate is mounted correctly:++ ```bash+ # Execute command in pod+ kubectl exec -it <pod-name> -n documenso -- ls -la /opt/documenso/+ ```+ </Accordion>+ <Accordion title="Health check failures">+ Test the health endpoint:++ ```bash+ # Port forward+ kubectl port-forward svc/documenso 3000:80 -n documenso++ # Test health endpoint+ curl http://localhost:3000/api/health+ ```+ </Accordion>+ <Accordion title="Rolling back a deployment">+ If a deployment fails, rollback:+ ```bash+ # View history+ kubectl rollout history deployment/documenso -n documenso++ # Rollback to previous version+ kubectl rollout undo deployment/documenso -n documenso++ # Rollback to a specific revision+ kubectl rollout undo deployment/documenso -n documenso --to-revision=2+ ```++ </Accordion>+</Accordions>++## Complete Example++Here's a combined manifest for reference:++```yaml+# documenso-complete.yaml+---+apiVersion: v1+kind: Namespace+metadata:+ name: documenso+ labels:+ app.kubernetes.io/name: documenso+---+apiVersion: v1+kind: ConfigMap+metadata:+ name: documenso-config+ namespace: documenso+data:+ NEXT_PUBLIC_WEBAPP_URL: 'https://sign.example.com'+ NEXT_PRIVATE_SMTP_TRANSPORT: 'smtp-auth'+ NEXT_PRIVATE_SMTP_HOST: 'smtp.example.com'+ NEXT_PRIVATE_SMTP_PORT: '587'+ NEXT_PRIVATE_SMTP_FROM_NAME: 'Documenso'+ NEXT_PRIVATE_SMTP_FROM_ADDRESS: '[email protected]'+ NEXT_PRIVATE_INTERNAL_WEBAPP_URL: 'http://localhost:3000'+ NEXT_PRIVATE_SIGNING_LOCAL_FILE_PATH: '/opt/documenso/cert.p12'+ NEXT_PUBLIC_UPLOAD_TRANSPORT: 'database'+---+apiVersion: v1+kind: Secret+metadata:+ name: documenso-secrets+ namespace: documenso+type: Opaque+stringData:+ NEXTAUTH_SECRET: 'REPLACE_WITH_GENERATED_SECRET'+ NEXT_PRIVATE_ENCRYPTION_KEY: 'REPLACE_WITH_32_CHAR_KEY'+ NEXT_PRIVATE_ENCRYPTION_SECONDARY_KEY: 'REPLACE_WITH_32_CHAR_KEY'+ NEXT_PRIVATE_DATABASE_URL: 'postgresql://user:password@host:5432/documenso'+ NEXT_PRIVATE_DIRECT_DATABASE_URL: 'postgresql://user:password@host:5432/documenso'+ NEXT_PRIVATE_SMTP_USERNAME: 'smtp-user'+ NEXT_PRIVATE_SMTP_PASSWORD: 'smtp-password'+ NEXT_PRIVATE_SIGNING_PASSPHRASE: 'cert-passphrase'+---+apiVersion: apps/v1+kind: Deployment+metadata:+ name: documenso+ namespace: documenso+spec:+ replicas: 2+ selector:+ matchLabels:+ app.kubernetes.io/name: documenso+ template:+ metadata:+ labels:+ app.kubernetes.io/name: documenso+ spec:+ securityContext:+ runAsUser: 1001+ runAsGroup: 1001+ fsGroup: 1001+ containers:+ - name: documenso+ image: documenso/documenso:latest+ ports:+ - name: http+ containerPort: 3000+ envFrom:+ - configMapRef:+ name: documenso-config+ - secretRef:+ name: documenso-secrets+ resources:+ requests:+ cpu: 250m+ memory: 512Mi+ limits:+ cpu: 1000m+ memory: 1Gi+ livenessProbe:+ httpGet:+ path: /api/health+ port: http+ initialDelaySeconds: 30+ periodSeconds: 10+ readinessProbe:+ httpGet:+ path: /api/health+ port: http+ initialDelaySeconds: 10+ periodSeconds: 5+ startupProbe:+ httpGet:+ path: /api/health+ port: http+ initialDelaySeconds: 10+ periodSeconds: 5+ failureThreshold: 30+ volumeMounts:+ - name: signing-cert+ mountPath: /opt/documenso/cert.p12+ subPath: cert.p12+ readOnly: true+ volumes:+ - name: signing-cert+ secret:+ secretName: documenso-signing-cert+---+apiVersion: v1+kind: Service+metadata:+ name: documenso+ namespace: documenso+spec:+ type: ClusterIP+ ports:+ - name: http+ port: 80+ targetPort: http+ selector:+ app.kubernetes.io/name: documenso+---+apiVersion: networking.k8s.io/v1+kind: Ingress+metadata:+ name: documenso+ namespace: documenso+ annotations:+ nginx.ingress.kubernetes.io/proxy-body-size: '50m'+ cert-manager.io/cluster-issuer: 'letsencrypt-prod'+spec:+ ingressClassName: nginx+ tls:+ - hosts:+ - sign.example.com+ secretName: documenso-tls+ rules:+ - host: sign.example.com+ http:+ paths:+ - path: /+ pathType: Prefix+ backend:+ service:+ name: documenso+ port:+ name: http+---+apiVersion: autoscaling/v2+kind: HorizontalPodAutoscaler+metadata:+ name: documenso+ namespace: documenso+spec:+ scaleTargetRef:+ apiVersion: apps/v1+ kind: Deployment+ name: documenso+ minReplicas: 2+ maxReplicas: 10+ metrics:+ - type: Resource+ resource:+ name: cpu+ target:+ type: Utilization+ averageUtilization: 70+---+apiVersion: policy/v1+kind: PodDisruptionBudget+metadata:+ name: documenso+ namespace: documenso+spec:+ minAvailable: 1+ selector:+ matchLabels:+ app.kubernetes.io/name: documenso+```++---++## See Also++- [Environment Variables](/docs/self-hosting/configuration/environment) - Full configuration reference+- [Signing Certificate](/docs/self-hosting/configuration/signing-certificate) - Set up document signing+- [Storage Configuration](/docs/self-hosting/configuration/storage) - Configure S3-compatible storage+- [Email Configuration](/docs/self-hosting/configuration/email) - Configure SMTP providers+- [Backups](/docs/self-hosting/maintenance/backups) - Database backup strategies+- [Upgrades](/docs/self-hosting/maintenance/upgrades) - Upgrade proceduresdiff --git a/apps/docs/content/docs/self-hosting/deployment/manual.mdx b/apps/docs/content/docs/self-hosting/deployment/manual.mdxnew file mode 100644index 000000000..bdd51fd68--- /dev/null+++ b/apps/docs/content/docs/self-hosting/deployment/manual.mdx@@ -0,0 +1,162 @@+---+title: Manual Deployment+description: Deploy Documenso on a Linux server without Docker using Node.js and systemd.+---++import { Callout } from 'fumadocs-ui/components/callout';+import { Step, Steps } from 'fumadocs-ui/components/steps';++<Callout type="warn">+ This guide is a community contribution and may not always reflect the latest changes. If you+ encounter issues, please refer to the [Docker](/docs/self-hosting/deployment/docker) or [Docker+ Compose](/docs/self-hosting/deployment/docker-compose) guides which are actively maintained.+</Callout>++## Prerequisites++- Node.js 20 or later+- npm+- PostgreSQL 14 or later+- A Linux server (for systemd service setup)++## Install and Build++{/* prettier-ignore */}+<Steps>++<Step>+### Clone the repository++```bash+git clone https://github.com/documenso/documenso.git+```++</Step>++<Step>+### Configure environment variables++Navigate to the `documenso` folder and create a `.env` file:++```bash+cp .env.example .env+```++Open the `.env` file and configure the required variables:++```bash+NEXTAUTH_SECRET="your-secret-here"+NEXT_PRIVATE_ENCRYPTION_KEY="your-encryption-key-min-32-chars"+NEXT_PRIVATE_ENCRYPTION_SECONDARY_KEY="your-secondary-key-min-32-chars"+NEXT_PUBLIC_WEBAPP_URL="https://your-domain.com"+NEXT_PRIVATE_INTERNAL_WEBAPP_URL="http://localhost:3000"+NEXT_PRIVATE_DATABASE_URL="postgresql://user:password@localhost:5432/documenso"+NEXT_PRIVATE_DIRECT_DATABASE_URL="postgresql://user:password@localhost:5432/documenso"+NEXT_PRIVATE_SMTP_FROM_NAME="Documenso"+NEXT_PRIVATE_SMTP_FROM_ADDRESS="[email protected]"+```++<Callout type="info">+ If you use a reverse proxy in front of Documenso, set `NEXT_PUBLIC_WEBAPP_URL` to the public URL+ that users will access.+</Callout>++</Step>++<Step>+### Install dependencies and build++```bash+npm ci+npm run build+npm run prisma:migrate-deploy+```++</Step>++<Step>+### Start the application++```bash+npm run start+```++The server starts on `localhost:3000` by default. To use a different port, set the `PORT` environment variable in your `.env` file:++```bash+PORT=3500+```++</Step>++</Steps>++## Run as a systemd Service++Create a service file to run Documenso as a background service on Linux:++```ini+# /etc/systemd/system/documenso.service++[Unit]+Description=Documenso+After=network.target++[Service]+Type=simple+User=www-data+WorkingDirectory=/var/www/documenso+EnvironmentFile=/var/www/documenso/.env+ExecStart=/usr/bin/node apps/remix/build/server/main.js+TimeoutSec=15+Restart=always++[Install]+WantedBy=multi-user.target+```++The `EnvironmentFile` directive loads your `.env` file, so configuration (including `PORT`) is managed in one place. Alternatively, you can set environment variables directly in the service file with `Environment=` directives.++Enable and start the service:++```bash+sudo systemctl enable documenso+sudo systemctl start documenso+```++## Reverse Proxy with Nginx++A minimal Nginx configuration for proxying to Documenso:++```nginx+server {+ listen 80;+ server_name your-domain.com;++ location / {+ proxy_pass http://localhost:3000;+ proxy_http_version 1.1;+ proxy_set_header Upgrade $http_upgrade;+ proxy_set_header Connection 'upgrade';+ proxy_set_header Host $host;+ proxy_set_header X-Real-IP $remote_addr;+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;+ proxy_set_header X-Forwarded-Proto $scheme;+ proxy_cache_bypass $http_upgrade;+ }+}+```++<Callout type="info">+ For production, configure SSL termination with Let's Encrypt or your preferred certificate+ provider.+</Callout>++---++## See Also++- [Docker Deployment](/docs/self-hosting/deployment/docker) - Deploy using a standalone Docker container+- [Docker Compose](/docs/self-hosting/deployment/docker-compose) - Deploy with Docker Compose+- [Environment Variables](/docs/self-hosting/configuration/environment) - All configuration options+- [Signing Certificate](/docs/self-hosting/configuration/signing-certificate) - Configure document signing certificatesdiff --git a/apps/docs/content/docs/self-hosting/deployment/meta.json b/apps/docs/content/docs/self-hosting/deployment/meta.jsonnew file mode 100644index 000000000..3dd778ebd--- /dev/null+++ b/apps/docs/content/docs/self-hosting/deployment/meta.json@@ -0,0 +1,4 @@+{+ "title": "Deployment",+ "pages": ["docker", "docker-compose", "railway", "kubernetes", "manual"]+}diff --git a/apps/docs/content/docs/self-hosting/deployment/railway.mdx b/apps/docs/content/docs/self-hosting/deployment/railway.mdxnew file mode 100644index 000000000..db775b85a--- /dev/null+++ b/apps/docs/content/docs/self-hosting/deployment/railway.mdx@@ -0,0 +1,469 @@+---+title: Railway+description: Deploy Documenso on Railway with automatic builds from Git, managed PostgreSQL, and built-in networking. Use the one-click template or manual setup.+---++import { Accordion, Accordions } from 'fumadocs-ui/components/accordion';+import { Callout } from 'fumadocs-ui/components/callout';+import { Step, Steps } from 'fumadocs-ui/components/steps';++<Callout type="warn">+ This guide is a community contribution and may be outdated. If you run into issues, check the+ [GitHub Discussions](https://github.com/documenso/documenso/discussions) for help.+</Callout>++## Prerequisites++Before deploying, you need:++- A [Railway account](https://railway.app/) (free tier available)+- SMTP credentials for sending emails (required for document signing requests)+- A custom domain (optional but recommended for production)++## One-Click Deploy++The fastest way to deploy Documenso on Railway is using the official template:++[](https://railway.app/template/bG6D4p)++This template automatically provisions:++- Documenso application service+- PostgreSQL database+- Required environment variables with secure defaults++{/* prettier-ignore */}+<Steps>+<Step>+### Click the deploy button++Click the "Deploy on Railway" button above. You'll be redirected to Railway and prompted to log in if needed.++</Step>++<Step>+### Configure environment variables++Railway will prompt you to configure required variables. At minimum, set:++| Variable | Description |+| -------------------------------- | ------------------------------------------------------------------------------------------------------------------ |+| `NEXT_PUBLIC_WEBAPP_URL` | The public URL for your deployment (use the Railway-provided URL initially, update later if using a custom domain) |+| `NEXT_PRIVATE_SMTP_HOST` | Your SMTP server hostname |+| `NEXT_PRIVATE_SMTP_PORT` | SMTP port (typically 587 or 465) |+| `NEXT_PRIVATE_SMTP_USERNAME` | SMTP username |+| `NEXT_PRIVATE_SMTP_PASSWORD` | SMTP password |+| `NEXT_PRIVATE_SMTP_FROM_ADDRESS` | Sender email address |+| `NEXT_PRIVATE_SMTP_FROM_NAME` | Sender display name |++The template automatically generates secure values for `NEXTAUTH_SECRET`, `NEXT_PRIVATE_ENCRYPTION_KEY`, and `NEXT_PRIVATE_ENCRYPTION_SECONDARY_KEY`.++</Step>++<Step>+### Deploy++Click "Deploy" to start the deployment. Railway builds the application from the Dockerfile and provisions the database.++This takes approximately 5-10 minutes for the initial build.++</Step>++<Step>+### Access your deployment++Once deployed, Railway provides a URL like `documenso-production.up.railway.app`.++Click the URL in the Railway dashboard to access your Documenso instance.++</Step>+</Steps>++## Manual Deployment++If you prefer more control over the setup, deploy Documenso manually:++{/* prettier-ignore */}+<Steps>+<Step>+### Create a new project++- Log in to [Railway](https://railway.app/)+- Click "New Project"+- Select "Deploy from GitHub repo"+- Connect your GitHub account if not already connected+- Fork or select the [Documenso repository](https://github.com/documenso/documenso)++</Step>++<Step>+### Configure the build++Railway automatically detects the `railway.toml` configuration file in the repository, which specifies:++```toml+[build]+builder = "DOCKERFILE"+dockerfilePath = "/docker/Dockerfile"+```++No additional build configuration is needed.++</Step>++<Step>+### Add PostgreSQL database++- In your project, click "New"+- Select "Database"+- Choose "PostgreSQL"+- Railway provisions the database and automatically sets `DATABASE_URL`++</Step>++<Step>+### Configure environment variables++Click on the Documenso service and go to the "Variables" tab. Add the following variables:++**Required variables:**++```bash+NEXTAUTH_SECRET=<generate with: openssl rand -base64 32>+NEXT_PRIVATE_ENCRYPTION_KEY=<minimum 32 character random string>+NEXT_PRIVATE_ENCRYPTION_SECONDARY_KEY=<minimum 32 character random string>+NEXT_PUBLIC_WEBAPP_URL=https://<your-railway-url>.up.railway.app+NEXT_PRIVATE_DATABASE_URL=${{Postgres.DATABASE_URL}}+NEXT_PRIVATE_DIRECT_DATABASE_URL=${{Postgres.DATABASE_URL}}+NEXT_PRIVATE_SMTP_TRANSPORT=smtp-auth+NEXT_PRIVATE_SMTP_HOST=<your-smtp-host>+NEXT_PRIVATE_SMTP_PORT=587+NEXT_PRIVATE_SMTP_USERNAME=<your-smtp-username>+NEXT_PRIVATE_SMTP_PASSWORD=<your-smtp-password>+NEXT_PRIVATE_SMTP_FROM_NAME=Documenso+```++<Callout type="info">+ Use `${{Postgres.DATABASE_URL}}` to reference the Railway-managed PostgreSQL connection string. Railway automatically resolves this reference.+</Callout>++**Optional variables:**++| Variable | Description | Default |+| --------------------------------- | ---------------------------------- | ------- |+| `PORT` | Application port | `3000` |+| `NEXT_PUBLIC_DISABLE_SIGNUP` | Disable public signups | `false` |+| `NEXT_PRIVATE_SIGNING_PASSPHRASE` | Passphrase for signing certificate | - |+| `DOCUMENSO_DISABLE_TELEMETRY` | Disable anonymous telemetry | `false` |++</Step>++<Step>+### Deploy++Click "Deploy" or push a commit to trigger a new deployment. Railway builds and deploys the application automatically.++</Step>+</Steps>++## Environment Variables++Railway manages environment variables through its dashboard. The full list of configuration options is documented in [Environment Variables](/docs/self-hosting/configuration/environment).++### Referencing Railway Services++Railway allows referencing other services in your project using the `${{ServiceName.VARIABLE}}` syntax:++```bash+NEXT_PRIVATE_DATABASE_URL=${{Postgres.DATABASE_URL}}+```++This ensures connection strings stay in sync when Railway updates service configurations.++## Database Setup++Railway's managed PostgreSQL handles database provisioning automatically. The database:++- Runs PostgreSQL 15 by default+- Includes automatic backups on paid plans+- Provides connection pooling via the internal network++### Database Connection++For Railway deployments, use the same connection string for both pooled and direct connections:++```bash+NEXT_PRIVATE_DATABASE_URL=${{Postgres.DATABASE_URL}}+NEXT_PRIVATE_DIRECT_DATABASE_URL=${{Postgres.DATABASE_URL}}+```++Documenso runs database migrations automatically on startup.++### Accessing the Database++To connect directly to your database for debugging or maintenance:++{/* prettier-ignore */}+<Steps>+<Step>+### Open the PostgreSQL service++In your Railway project dashboard, select the PostgreSQL service.++</Step>+<Step>+### Open the Connect tab++The "Connect" tab shows the connection string and credentials.++</Step>+<Step>+### Connect with your client++Use the provided connection string with your preferred PostgreSQL client.++</Step>+</Steps>++## Custom Domain++Railway provides a generated URL by default. To use your own domain:++{/* prettier-ignore */}+<Steps>+<Step>+### Generate a domain++- Click on your Documenso service+- Go to "Settings" > "Networking"+- Click "Generate Domain" to get a Railway subdomain, or proceed to add a custom domain++</Step>++<Step>+### Add custom domain++- In "Settings" > "Networking", click "Custom Domain"+- Enter your domain (e.g., `sign.yourdomain.com`)+- Railway provides DNS records to configure++</Step>++<Step>+### Configure DNS++Add the following DNS records at your domain registrar:++| Type | Name | Value |+| ----- | ---- | ------------------------------- |+| CNAME | sign | `<your-project>.up.railway.app` |++DNS propagation can take up to 24 hours.++</Step>++<Step>+### Update environment variable++Update `NEXT_PUBLIC_WEBAPP_URL` to match your custom domain:++```bash+NEXT_PUBLIC_WEBAPP_URL=https://sign.yourdomain.com+```++Railway automatically provisions and renews SSL certificates for custom domains.++</Step>+</Steps>++## Scaling Options++Railway provides several options for scaling your Documenso deployment:++### Vertical Scaling++Increase resources for your service:++{/* prettier-ignore */}+<Steps>+<Step>+### Open your Documenso service++In the Railway dashboard, select the Documenso service.++</Step>+<Step>+### Open Settings++In "Settings" you can change the resource limits for the service.++</Step>+<Step>+### Adjust memory and CPU++Raise the memory and CPU limits; Railway will scale within these limits based on demand.++</Step>+</Steps>++### Horizontal Scaling++Railway supports horizontal scaling through replicas:++{/* prettier-ignore */}+<Steps>+<Step>+### Open service Settings++In the Railway dashboard, select your Documenso service and open "Settings".++</Step>+<Step>+### Enable Horizontal Scaling++Turn on "Horizontal Scaling" so Railway can run multiple instances.++</Step>+<Step>+### Set replicas++Choose how many replicas to run; Railway will load-balance traffic across them.++</Step>+</Steps>++<Callout type="warn">+ Documenso stores sessions in the database, so horizontal scaling works without additional+ configuration. However, ensure your database can handle the increased connection load.+</Callout>++### Database Scaling++For high-traffic deployments:++- Upgrade to a larger PostgreSQL instance in Railway+- Consider using connection pooling with PgBouncer+- Configure read replicas for read-heavy workloads++## Cost Estimate++Railway uses usage-based pricing. Estimated monthly costs for Documenso:++| Tier | Resources | Estimated Cost |+| ----- | ---------------------------------- | -------------- |+| Trial | $5 credit, limited hours | Free |+| Hobby | 512MB RAM, shared CPU | $5-10/month |+| Pro | 2GB RAM, dedicated CPU | $20-40/month |+| Team | Custom resources, priority support | $50+/month |++Actual costs depend on:++- Application memory usage (typically 500MB-1GB)+- Database size and query volume+- Egress bandwidth+- Number of deployments++<Callout type="info">+ Railway charges based on actual resource consumption. Monitor usage in the Railway dashboard to+ optimize costs.+</Callout>++### Free Tier Limitations++Railway's trial tier includes:++- $5 of free credit+- 500 hours of execution time per month+- Limited to 512MB RAM per service++This is sufficient for testing but not recommended for production.++## Signing Certificate++Documenso requires a signing certificate to sign documents. On Railway, you can:++### Option 1: Use Generated Certificate (Default)++Documenso generates a self-signed certificate automatically if none is provided. This works for testing but shows generic certificate information in signed documents.++### Option 2: Mount Custom Certificate++For production use, provide your own certificate:++{/* prettier-ignore */}+<Steps>+<Step>+### Base64-encode your certificate++Run this and copy the output (single line, no newlines):++```bash+base64 -i your-cert.p12 | tr -d '\n'+```++</Step>+<Step>+### Add environment variables in Railway++In your Documenso service variables, set:++```bash+NEXT_PRIVATE_SIGNING_LOCAL_FILE_CONTENTS=<base64-encoded-certificate>+NEXT_PRIVATE_SIGNING_PASSPHRASE=<certificate-password>+```++</Step>+</Steps>++<Callout type="warn">+ Your certificate must have a password. Certificates without passwords cause signing errors.+</Callout>++See [Signing Certificate Configuration](/docs/self-hosting/configuration/signing-certificate) for detailed instructions.++## Troubleshooting++<Accordions type="multiple">+ <Accordion title="Build fails">+ Check the build logs in Railway for specific errors. Common causes: out of memory (increase the build memory limit in service settings), Docker build timeout (Railway has a 20-minute build timeout; ensure your build completes within this limit).+ </Accordion>+ <Accordion title="Application crashes on startup">+ View the deployment logs: click your service, go to Deployments, click the failed deployment. Common issues: missing environment variables (verify all required variables are set), database connection failed (check `NEXT_PRIVATE_DATABASE_URL` references the correct PostgreSQL service), invalid encryption keys (ensure keys are at least 32 characters).+ </Accordion>+ <Accordion title="Emails not sending">+ Verify SMTP configuration: check `NEXT_PRIVATE_SMTP_TRANSPORT` is set to `smtp-auth`, verify SMTP credentials are correct, ensure your SMTP provider allows connections from Railway's IP addresses.+ </Accordion>+ <Accordion title="Database connection errors">+ Verify PostgreSQL service is running, check the variable reference syntax `${{Postgres.DATABASE_URL}}`, try redeploying the application.+ </Accordion>+ <Accordion title="Slow performance">+ Increase memory allocation for the service, check database query performance in Railway's metrics, consider upgrading to a larger PostgreSQL instance.+ </Accordion>+</Accordions>++## Other One-Click Deployment Options++### Render++[](https://render.com/deploy?repo=https://github.com/documenso/documenso)++### Koyeb++<a href="https://app.koyeb.com/deploy?type=git&repository=github.com/documenso/documenso&branch=main&name=documenso-app&builder=dockerfile&dockerfile=/docker/Dockerfile">+ <img+ src="https://www.koyeb.com/static/images/deploy/button.svg"+ alt="Deploy to Koyeb"+ width="193"+ height="34"+ />+</a>++---++## See Also++- [Email Configuration](/docs/self-hosting/configuration/email) - Configure email providers+- [Signing Certificate](/docs/self-hosting/configuration/signing-certificate) - Set up document signing+- [Storage Configuration](/docs/self-hosting/configuration/storage) - Configure S3 storage for documents+- [Environment Variables](/docs/self-hosting/configuration/environment) - Full configuration referencediff --git a/apps/docs/content/docs/self-hosting/getting-started/index.mdx b/apps/docs/content/docs/self-hosting/getting-started/index.mdxnew file mode 100644index 000000000..edd614ff8--- /dev/null+++ b/apps/docs/content/docs/self-hosting/getting-started/index.mdx@@ -0,0 +1,17 @@+---+title: Getting Started+description: Requirements and quick start guide for self-hosting Documenso.+---++<Cards>+ <Card+ title="Requirements"+ description="System requirements and prerequisites."+ href="/docs/self-hosting/getting-started/requirements"+ />+ <Card+ title="Quick Start"+ description="Deploy with Docker in 5 minutes."+ href="/docs/self-hosting/getting-started/quick-start"+ />+</Cards>diff --git a/apps/docs/content/docs/self-hosting/getting-started/meta.json b/apps/docs/content/docs/self-hosting/getting-started/meta.jsonnew file mode 100644index 000000000..2b5774ee9--- /dev/null+++ b/apps/docs/content/docs/self-hosting/getting-started/meta.json@@ -0,0 +1,4 @@+{+ "title": "Getting Started",+ "pages": ["requirements", "quick-start", "tips"]+}diff --git a/apps/docs/content/docs/self-hosting/getting-started/quick-start.mdx b/apps/docs/content/docs/self-hosting/getting-started/quick-start.mdxnew file mode 100644index 000000000..b0cc80ff8--- /dev/null+++ b/apps/docs/content/docs/self-hosting/getting-started/quick-start.mdx@@ -0,0 +1,186 @@+---+title: Quick Start+description: Get Documenso running locally in minutes with Docker Compose.+---++import { Accordion, Accordions } from 'fumadocs-ui/components/accordion';+import { Callout } from 'fumadocs-ui/components/callout';+import { Step, Steps } from 'fumadocs-ui/components/steps';++## Limitations++This quick start setup is for local development and testing only:++- No HTTPS (not suitable for production)+- No email delivery (emails are logged to console)+- Uses a local PostgreSQL database+- No signing certificate configured (documents will be signed with a generated certificate)+- Single-node setup (no high availability)++For production deployments, see [Docker Compose Deployment](/docs/self-hosting/deployment/docker-compose).++## Prerequisites++- [Docker](https://docs.docker.com/get-docker/) installed and running+- [Docker Compose](https://docs.docker.com/compose/install/) v2.0 or later+- At least 2GB of available RAM++Verify your installation:++```bash+docker --version+docker compose version+```++## Quick Start++{/* prettier-ignore */}+<Steps>+<Step>+### Clone the repository++```bash+git clone https://github.com/documenso/documenso.git+cd documenso+```++</Step>++<Step>+### Create the environment file++Copy the example environment file:++```bash+cp .env.example .env+```++The default values work for local development. No changes are required.++</Step>++<Step>+### Start Documenso++```bash+docker compose -f docker/development/compose.yml up -d+```++This pulls the required images and starts the containers. The first run takes a few minutes.++</Step>++<Step>+### Access the application++Open [http://localhost:3000](http://localhost:3000) in your browser.++</Step>+</Steps>++## Create Your First Account++{/* prettier-ignore */}+<Steps>+<Step>++### Sign up++Click **Sign Up** on the login page and enter your email address and password.++</Step>+<Step>++### Verify your email++In development mode, emails are logged to the console instead of being sent. Check the Docker logs for the verification link:++```bash+docker compose -f docker/development/compose.yml logs -f+```++Copy the verification link from the logs and open it in your browser.++</Step>+<Step>++### Log in++Log in with your credentials.++</Step>+</Steps>++### Granting Admin Access++All accounts created through signup are regular user accounts. To grant admin access, update the user's role directly in the database:++```bash+docker compose -f docker/development/compose.yml exec database \+ psql -U documenso -d documenso -c "UPDATE \"User\" SET roles = '{ADMIN}' WHERE email = '[email protected]';"+```++## What's Included++The quick start setup runs the following containers:++| Container | Purpose | Port |+| ----------- | -------------------------------- | ----- |+| `documenso` | Main application | 3000 |+| `database` | PostgreSQL database | 54320 |+| `maildev` | Local email testing server | 2500 |+| `minio` | S3-compatible storage (optional) | 9000 |++## Useful Commands++**View logs:**++```bash+docker compose -f docker/development/compose.yml logs -f+```++**Stop containers:**++```bash+docker compose -f docker/development/compose.yml down+```++**Stop and remove all data:**++```bash+docker compose -f docker/development/compose.yml down -v+```++**Rebuild after changes:**++```bash+docker compose -f docker/development/compose.yml up -d --build+```++## Troubleshooting++<Accordions type="multiple">+ <Accordion title="Port 3000 already in use">+ Another application is using port 3000. Either stop that application or change the port in your+ `.env` file: `PORT=3001`. Then restart the containers.+ </Accordion>+ <Accordion title="Container fails to start">+ Check the logs: `docker compose -f docker/development/compose.yml logs documenso`. Common+ issues: insufficient memory (ensure Docker has at least 2GB RAM allocated), database connection+ (wait for the database container to be healthy before the app starts).+ </Accordion>+ <Accordion title="Cannot access localhost:3000">+ Verify containers are running: `docker compose -f docker/development/compose.yml ps`. Check if+ the app container is healthy. On Linux, ensure Docker is not running in rootless mode with+ network restrictions.+ </Accordion>+</Accordions>++---++## See Also++- [Docker Compose Deployment](/docs/self-hosting/deployment/docker-compose) - Production setup with PostgreSQL and email+- [Environment Variables](/docs/self-hosting/configuration/environment) - Configure all available options+- [Signing Certificate](/docs/self-hosting/configuration/signing-certificate) - Set up document signing+- [Email Configuration](/docs/self-hosting/configuration/email) - Configure SMTP for productiondiff --git a/apps/docs/content/docs/self-hosting/getting-started/requirements.mdx b/apps/docs/content/docs/self-hosting/getting-started/requirements.mdxnew file mode 100644index 000000000..202f739b3--- /dev/null+++ b/apps/docs/content/docs/self-hosting/getting-started/requirements.mdx@@ -0,0 +1,174 @@+---+title: Requirements+description: System requirements and prerequisites for self-hosting Documenso.+---++import { Callout } from 'fumadocs-ui/components/callout';++## What You Need++Documenso requires the following external services:++| Service | Purpose | Minimum Version |+| ------------- | ---------------------------- | --------------- |+| PostgreSQL | Primary database | 14+ |+| SMTP server | Sending emails to recipients | Any |+| Reverse proxy | SSL termination, routing | Any |++### PostgreSQL Database++Documenso uses PostgreSQL for all data storage including documents, users, and audit logs. You cannot use MySQL, SQLite, or other databases.++Documenso requires two connection strings:++- **Pooled connection** (`NEXT_PRIVATE_DATABASE_URL`) - For general application queries+- **Direct connection** (`NEXT_PRIVATE_DIRECT_DATABASE_URL`) - For migrations and operations that require a direct connection++If you're not using a connection pooler (like PgBouncer), both can point to the same database URL.++### Email Server++Documenso sends transactional emails for:++- Document signing requests+- Signing reminders+- Completion notifications+- Password resets and verification++Supported transports:++| Transport | Use Case |+| -------------- | ------------------------------------ |+| `smtp-auth` | Standard SMTP with username/password |+| `smtp-api` | SMTP with API key authentication |+| `resend` | Resend.com API |+| `mailchannels` | MailChannels API |++<Callout type="warn">+ Without a working email configuration, recipients cannot receive signing requests. Configure email+ before going to production.+</Callout>++### Reverse Proxy++For production deployments, place Documenso behind a reverse proxy such as:++- nginx+- Caddy+- Traefik+- HAProxy+- Cloud load balancers (AWS ALB, GCP Load Balancer, etc.)++The reverse proxy handles SSL/TLS termination and forwards requests to Documenso on port 3000.++---++## Optional Services++These services are not required but improve functionality or scalability:++| Service | Purpose |+| --------------------- | ---------------------------------------- |+| S3-compatible storage | Store documents externally (recommended) |++### Document Storage++By default, Documenso stores documents in the PostgreSQL database. For production deployments with significant document volume, use S3-compatible storage:++- Amazon S3+- MinIO+- Cloudflare R2+- DigitalOcean Spaces+- Any S3-compatible provider++See [Storage Configuration](/docs/self-hosting/configuration/storage) for setup details.++### Background Jobs++Documenso processes background jobs (email delivery, document processing) using a PostgreSQL-based queue. No additional services like Redis are required: the job queue is built into the application and uses your existing database.++For high-throughput deployments, Documenso optionally supports [Inngest](https://www.inngest.com/) as an alternative job provider. Set `NEXT_PRIVATE_JOBS_PROVIDER=inngest` and configure `INNGEST_EVENT_KEY` and `INNGEST_SIGNING_KEY`. Most self-hosted instances do not need this.++---++## Hardware Requirements++### Minimum (Testing/Development)++| Resource | Requirement |+| -------- | ----------- |+| CPU | 1 core |+| RAM | 1 GB |+| Storage | 10 GB |++### Recommended (Production)++| Resource | Requirement |+| -------- | ----------- |+| CPU | 2+ cores |+| RAM | 2+ GB |+| Storage | 20+ GB |++<Callout type="info">+ Storage requirements depend on document volume. If using external S3 storage, local storage needs+ are minimal. If storing documents in the database, plan for growth accordingly.+</Callout>++---++## Build Requirements++If building from source (not using Docker images):++| Requirement | Version |+| ----------- | ------- |+| Node.js | 18+ |+| npm | 8+ |++---++## Supported Platforms++Documenso runs on:++- **Linux** - Any modern distribution (Ubuntu, Debian, CentOS, Alpine)+- **Docker** - Official images available on DockerHub and GitHub Container Registry+- **Kubernetes** - Helm charts and manifests available+- **PaaS providers** - Railway, Render, Koyeb (one-click deploys available)++---++## What's NOT Supported++<Callout type="error">+ The following configurations are not supported and may not work correctly.+</Callout>++| Configuration | Reason |+| -------------- | ------------------------------------- |+| Windows native | Use Docker or WSL2 instead |+| MySQL/MariaDB | PostgreSQL-specific features required |+| SQLite | Not suitable for production workloads |+| MongoDB | Relational database required |+| Node.js < 18 | Modern JavaScript features required |++---++## Checklist++Before proceeding to deployment, confirm you have:++- [ ] PostgreSQL 14+ database accessible+- [ ] SMTP credentials or email provider API key+- [ ] Signing certificate (`.p12`) for document signing — see [Tips](/docs/self-hosting/getting-started/tips)+- [ ] Domain name for your Documenso instance+- [ ] SSL certificate (or reverse proxy that handles SSL)+- [ ] Server meeting minimum hardware requirements++---++## See Also++- [Quick Start](/docs/self-hosting/getting-started/quick-start) - Deploy Documenso with Docker in 5 minutes+- [Docker Compose](/docs/self-hosting/deployment/docker-compose) - Production setup with Docker Compose+- [Environment Variables](/docs/self-hosting/configuration/environment) - Full configuration referencediff --git a/apps/docs/content/docs/self-hosting/getting-started/tips.mdx b/apps/docs/content/docs/self-hosting/getting-started/tips.mdxnew file mode 100644index 000000000..dc4f7e074--- /dev/null+++ b/apps/docs/content/docs/self-hosting/getting-started/tips.mdx@@ -0,0 +1,182 @@+---+title: Tips & Common Pitfalls+description: Practical advice for running Documenso in production.+---++import { Callout } from 'fumadocs-ui/components/callout';++## Always Configure a Signing Certificate++<Callout type="error">+ This is the single most common issue when self-hosting Documenso. Without a signing certificate,+ the application starts normally but document signing fails.+</Callout>++Documenso does **not** bundle a [signing certificate](/docs/self-hosting/configuration/signing-certificate) in the Docker image. You must provide one yourself using one of two methods:++### Volume Mount (Recommended)++Mount your `.p12` certificate file into the container at the default path:++```bash+docker run -d \+ -v /path/to/your/cert.p12:/opt/documenso/cert.p12:ro \+ -e NEXT_PRIVATE_SIGNING_PASSPHRASE="your-certificate-password" \+ documenso/documenso:latest+```++The default certificate path inside the container is `/opt/documenso/cert.p12`. You can change this with `NEXT_PRIVATE_SIGNING_LOCAL_FILE_PATH`.++### Base64 Environment Variable++For platforms that don't support volume mounts (Railway, Render, etc.), encode the certificate and pass it as an environment variable:++```bash+# Encode the certificate (no line breaks)+base64 -w 0 certificate.p12 # Linux+base64 -i certificate.p12 # macOS+```++Then set:++```bash+NEXT_PRIVATE_SIGNING_LOCAL_FILE_CONTENTS=<base64-encoded-string>+NEXT_PRIVATE_SIGNING_PASSPHRASE=your-certificate-password+```++<Callout type="info">+ `NEXT_PRIVATE_SIGNING_LOCAL_FILE_CONTENTS` takes precedence over+ `NEXT_PRIVATE_SIGNING_LOCAL_FILE_PATH` if both are set.+</Callout>++### Verify Your Certificate++After starting Documenso, check the certificate status endpoint:++```bash+curl http://localhost:3000/api/certificate-status+```++The startup script also checks for the certificate and prints a warning if it's missing.++---++## Certificate Password is Required++Certificates without a password cause signing to fail with:++```+Error: Failed to get private key bags+```++Always set a password when creating your `.p12` certificate. When using OpenSSL, set the password during the export step and provide it to Documenso via `NEXT_PRIVATE_SIGNING_PASSPHRASE`.++---++## Use the Health Check Endpoints++Documenso exposes two endpoints for monitoring:++| Endpoint | Purpose |+| ------------------------- | ------------------------------------ |+| `/api/health` | Returns 200 if the application is up |+| `/api/certificate-status` | Detailed signing certificate status |++Use `/api/health` for container orchestration health checks (Docker, Kubernetes). Use `/api/certificate-status` to debug signing issues. It reports whether a certificate is configured, its type, and any errors.++---++## Pin Your Docker Image Version++Use a specific version tag in production:++```bash+# Good — predictable, reproducible+docker pull documenso/documenso:1.8.0++# Risky — may pull breaking changes+docker pull documenso/documenso:latest+```++Check the [GitHub releases](https://github.com/documenso/documenso/releases) page for available versions.++---++## Migrations Run Automatically on Startup++The Docker container runs `prisma migrate deploy` every time it starts. This means:++- **Upgrades are simple**: pull the new image, restart the container, and migrations apply automatically.+- **Always back up your database before upgrading**: if a migration fails, you need a way to restore.+- **First startup takes longer**: the initial migration creates all tables.++---++## Set Internal Webapp URL for Background Jobs++Background jobs work by Documenso sending HTTP requests to itself. If your reverse proxy or network setup causes issues with the app reaching its own public URL, set the internal URL:++```bash+NEXT_PRIVATE_INTERNAL_WEBAPP_URL=http://localhost:3000+```++This tells the job system to use the internal address instead of `NEXT_PUBLIC_WEBAPP_URL` for self-requests.++---++## Database Storage vs S3++Documents are stored in PostgreSQL by default (`NEXT_PUBLIC_UPLOAD_TRANSPORT=database`). This works well for small-to-medium deployments and keeps your infrastructure simple.++For high-volume deployments, switch to S3-compatible storage to keep your database lean:++```bash+NEXT_PUBLIC_UPLOAD_TRANSPORT=s3+NEXT_PRIVATE_UPLOAD_BUCKET=documenso-documents+NEXT_PRIVATE_UPLOAD_REGION=us-east-1+NEXT_PRIVATE_UPLOAD_ACCESS_KEY_ID=your-key+NEXT_PRIVATE_UPLOAD_SECRET_ACCESS_KEY=your-secret+```++Any S3-compatible provider works: AWS S3, MinIO, Cloudflare R2, DigitalOcean Spaces.++See [Storage Configuration](/docs/self-hosting/configuration/storage) for full setup details.++---++## Background Jobs Don't Need Redis++Documenso uses a PostgreSQL-based job queue by default. No Redis, no external message broker. The job system uses your existing database to store and process background tasks like email delivery and document processing.++For high-throughput deployments, Documenso optionally supports [Inngest](https://www.inngest.com/) as an alternative job provider:++```bash+NEXT_PRIVATE_JOBS_PROVIDER=inngest+INNGEST_EVENT_KEY=your-event-key+INNGEST_SIGNING_KEY=your-signing-key+```++Most self-hosted instances do not need Inngest.++---++## Docker File Permissions++The Documenso container runs as a non-root user (UID 1001). If you mount files into the container (certificates, configuration), ensure they're readable:++```bash+# On the host, before mounting+chmod 644 cert.p12+chown 1001:1001 cert.p12+```++If you see `EACCES: permission denied` errors, this is almost always the cause.++---++## See Also++- [Requirements](/docs/self-hosting/getting-started/requirements) - What you need before deploying+- [Quick Start](/docs/self-hosting/getting-started/quick-start) - Get running in 5 minutes+- [Signing Certificate](/docs/self-hosting/configuration/signing-certificate) - Full certificate setup guide+- [Troubleshooting](/docs/self-hosting/maintenance/troubleshooting) - Detailed error resolutiondiff --git a/apps/docs/content/docs/self-hosting/index.mdx b/apps/docs/content/docs/self-hosting/index.mdxnew file mode 100644index 000000000..9876c800d--- /dev/null+++ b/apps/docs/content/docs/self-hosting/index.mdx@@ -0,0 +1,144 @@+---+title: Self-Hosting+description: Deploy and manage your own Documenso instance for complete control over your data, compliance, and customization.+---++## Getting Started++<Cards>+ <Card+ title="Requirements"+ description="System requirements and prerequisites."+ href="/docs/self-hosting/getting-started/requirements"+ />+ <Card+ title="Quick Start"+ description="Get running with Docker in 5 minutes."+ href="/docs/self-hosting/getting-started/quick-start"+ />+</Cards>++---++## Deployment Options++Choose a deployment method based on your needs:++<Cards>+ <Card+ title="Docker"+ description="Single container with external database."+ href="/docs/self-hosting/deployment/docker"+ />+ <Card+ title="Docker Compose"+ description="Production-ready setup with all dependencies."+ href="/docs/self-hosting/deployment/docker-compose"+ />+ <Card+ title="Railway"+ description="One-click deployment on managed infrastructure."+ href="/docs/self-hosting/deployment/railway"+ />+ <Card+ title="Kubernetes"+ description="High availability for enterprise deployments."+ href="/docs/self-hosting/deployment/kubernetes"+ />+</Cards>++---++## Configuration++<Cards>+ <Card+ title="Environment Variables"+ description="Complete reference of all configuration options."+ href="/docs/self-hosting/configuration/environment"+ />+ <Card+ title="Database"+ description="PostgreSQL setup and connection."+ href="/docs/self-hosting/configuration/database"+ />+ <Card+ title="Email"+ description="SMTP configuration for notifications."+ href="/docs/self-hosting/configuration/email"+ />+ <Card+ title="Storage"+ description="S3-compatible file storage setup."+ href="/docs/self-hosting/configuration/storage"+ />+ <Card+ title="Signing Certificate"+ description="Digital signature certificate for documents."+ href="/docs/self-hosting/configuration/signing-certificate"+ />+</Cards>++---++## Maintenance++<Cards>+ <Card+ title="Upgrades"+ description="Upgrade to new versions safely."+ href="/docs/self-hosting/maintenance/upgrades"+ />+ <Card+ title="Backups"+ description="Backup strategies for your data."+ href="/docs/self-hosting/maintenance/backups"+ />+ <Card+ title="Troubleshooting"+ description="Common issues and solutions."+ href="/docs/self-hosting/maintenance/troubleshooting"+ />+</Cards>++---++## Quick Start++Get Documenso running locally in under 5 minutes:++```bash+git clone https://github.com/documenso/documenso.git+cd documenso+cp .env.example .env+docker compose -f docker/development/compose.yml up -d+```++Open [http://localhost:3000](http://localhost:3000) to access your instance.++See the [Quick Start guide](/docs/self-hosting/getting-started/quick-start) for detailed instructions and next steps.++---++## Enterprise Edition++Self-hosted Documenso includes full core functionality under the AGPL-3.0 license. If you need enterprise features such as SSO, embed authoring white label, or 21 CFR Part 11 compliance, you can activate them with a license key.++See [Enterprise Edition](/docs/policies/enterprise-edition) for details and [Licenses](/docs/policies/licenses) for a comparison.++---++## Looking for Something Else?++<Cards>+ <Card+ title="User Guide"+ description="Learn how to use Documenso for document signing."+ href="/docs/users"+ />+ <Card+ title="Developer Guide"+ description="Integrate Documenso into your applications using the API."+ href="/docs/developers"+ />+</Cards>diff --git a/apps/docs/content/docs/self-hosting/maintenance/backups.mdx b/apps/docs/content/docs/self-hosting/maintenance/backups.mdxnew file mode 100644index 000000000..619901469--- /dev/null+++ b/apps/docs/content/docs/self-hosting/maintenance/backups.mdx@@ -0,0 +1,674 @@+---+title: Backups+description: Backup strategies for Documenso data.+---++import { Callout } from 'fumadocs-ui/components/callout';+import { Step, Steps } from 'fumadocs-ui/components/steps';+import { Tab, Tabs } from 'fumadocs-ui/components/tabs';++## What to Back Up++Documenso stores data in three locations:++| Component | Location | Contains |+| --------------------- | ----------------------------- | -------------------------------------------------- |+| PostgreSQL database | Database server | Users, documents, signatures, audit logs, settings |+| Signing certificate | File system or secret manager | Private key for signing documents |+| Document storage (S3) | S3 bucket or database | Uploaded PDFs and signed documents |++<Callout type="warn">+ The signing certificate is critical. If lost, you cannot sign new documents until a new+ certificate is configured. Back it up securely.+</Callout>++### Data Stored in PostgreSQL++The database contains:++- User accounts and authentication data+- Teams and organisation settings+- Document metadata (recipients, fields, status)+- Signatures and signing history+- Audit logs and activity records+- Templates and template settings+- API tokens and webhook configurations++If using database storage (`NEXT_PUBLIC_UPLOAD_TRANSPORT=database`), the database also contains the actual PDF files.++---++## Database Backups++### Using pg_dump++Create a logical backup with `pg_dump`:++| Flag | Description |+| ------ | ----------------------------------------------------- |+| `-h` | Database host |+| `-U` | Database user |+| `-d` | Database name |+| `-F c` | Custom format (compressed, supports parallel restore) |+| `-f` | Output file |++<Tabs items={['Direct', 'Docker Compose']}>+<Tab value="Direct">++```bash+pg_dump -h localhost -U documenso -d documenso -F c -f documenso_backup.dump+```++</Tab>+<Tab value="Docker Compose">++```bash+docker compose exec database pg_dump -U documenso -F c documenso > documenso_backup.dump+```++</Tab>+</Tabs>++### Backup with Timestamp++Include timestamps in backup filenames for easier management:++```bash+pg_dump -h localhost -U documenso -d documenso -F c \+ -f "documenso_$(date +%Y%m%d_%H%M%S).dump"+```++### Plain SQL Backup++For human-readable backups or cross-version compatibility:++```bash+pg_dump -h localhost -U documenso -d documenso -F p -f documenso_backup.sql+```++### Compressed Backup++Compress backups to save storage space:++```bash+pg_dump -h localhost -U documenso -d documenso | gzip > documenso_backup.sql.gz+```++---++## Certificate Backups++The signing certificate (`.p12` file) is required to sign documents. Store backups securely.++### Locate Your Certificate++Check your environment configuration for the certificate location:++<Tabs items={['File path', 'Base64 contents']}>+<Tab value="File path">++```bash+echo $NEXT_PRIVATE_SIGNING_LOCAL_FILE_PATH+```++</Tab>+<Tab value="Base64 contents">++```bash+echo $NEXT_PRIVATE_SIGNING_LOCAL_FILE_CONTENTS+```++</Tab>+</Tabs>++### Back Up Certificate++<Tabs items={['From file', 'From environment']}>+<Tab value="From file">++Copy the certificate to a secure backup location:++```bash+cp /opt/documenso/cert.p12 /backup/documenso/cert.p12+```++</Tab>+<Tab value="From environment">++If using base64-encoded certificate contents:++```bash+echo "$NEXT_PRIVATE_SIGNING_LOCAL_FILE_CONTENTS" | base64 -d > /backup/documenso/cert.p12+```++</Tab>+</Tabs>++### Store Certificate Passphrase++Document the certificate passphrase (`NEXT_PRIVATE_SIGNING_PASSPHRASE`) in a secure password manager or secrets vault. The certificate is unusable without it.++<Callout type="error">+ Store certificate backups separately from database backups. Use encryption for certificate backup+ storage.+</Callout>++---++## Storage Backups (S3)++If using S3 storage (`NEXT_PUBLIC_UPLOAD_TRANSPORT=s3`), back up your S3 bucket.++<Tabs items={['AWS S3', 'S3-Compatible (MinIO, etc.)']}>+<Tab value="AWS S3">++Enable versioning on your bucket:++```bash+aws s3api put-bucket-versioning \+ --bucket your-documenso-bucket \+ --versioning-configuration Status=Enabled+```++Sync to a backup location or download locally:++```bash+aws s3 sync s3://your-documenso-bucket s3://your-backup-bucket+# or+aws s3 sync s3://your-documenso-bucket /backup/documenso/documents/+```++</Tab>+<Tab value="S3-Compatible (MinIO, etc.)">++Use the same commands with the `--endpoint-url` flag:++```bash+aws s3 sync s3://your-bucket /backup/documenso/documents/ \+ --endpoint-url https://your-s3-endpoint.com+```++</Tab>+</Tabs>++### Cross-Region Replication++For disaster recovery, enable cross-region replication on your S3 bucket. This automatically copies objects to a bucket in another region.++---++## Automated Backup Script++Create a script to back up all Documenso components:++<Tabs items={['Standalone', 'Docker Compose']}>+<Tab value="Standalone">++```bash+#!/bin/bash+# documenso-backup.sh++set -e++# Configuration+BACKUP_DIR="/backup/documenso"+RETENTION_DAYS=30+TIMESTAMP=$(date +%Y%m%d_%H%M%S)++# Database connection+DB_HOST="localhost"+DB_USER="documenso"+DB_NAME="documenso"++# S3 configuration (if applicable)+S3_BUCKET="your-documenso-bucket"++# Create backup directory+mkdir -p "$BACKUP_DIR/$TIMESTAMP"++echo "Starting Documenso backup: $TIMESTAMP"++# Database backup+echo "Backing up database..."+PGPASSWORD="$DB_PASSWORD" pg_dump -h "$DB_HOST" -U "$DB_USER" -d "$DB_NAME" -F c \+ -f "$BACKUP_DIR/$TIMESTAMP/database.dump"++# Certificate backup (if file exists)+if [ -f "/opt/documenso/cert.p12" ]; then+ echo "Backing up certificate..."+ cp /opt/documenso/cert.p12 "$BACKUP_DIR/$TIMESTAMP/cert.p12"+fi++# S3 backup (if configured)+if [ -n "$S3_BUCKET" ]; then+ echo "Backing up S3 documents..."+ aws s3 sync "s3://$S3_BUCKET" "$BACKUP_DIR/$TIMESTAMP/documents/" --quiet+fi++# Compress backup+echo "Compressing backup..."+tar -czf "$BACKUP_DIR/documenso_$TIMESTAMP.tar.gz" -C "$BACKUP_DIR" "$TIMESTAMP"+rm -rf "$BACKUP_DIR/$TIMESTAMP"++# Calculate checksum+sha256sum "$BACKUP_DIR/documenso_$TIMESTAMP.tar.gz" > "$BACKUP_DIR/documenso_$TIMESTAMP.sha256"++# Remove old backups+echo "Removing backups older than $RETENTION_DAYS days..."+find "$BACKUP_DIR" -name "documenso_*.tar.gz" -mtime +$RETENTION_DAYS -delete+find "$BACKUP_DIR" -name "documenso_*.sha256" -mtime +$RETENTION_DAYS -delete++echo "Backup completed: documenso_$TIMESTAMP.tar.gz"+```++</Tab>+<Tab value="Docker Compose">++```bash+#!/bin/bash+# documenso-backup-docker.sh++set -e++BACKUP_DIR="/backup/documenso"+TIMESTAMP=$(date +%Y%m%d_%H%M%S)+COMPOSE_PROJECT="documenso-production"++mkdir -p "$BACKUP_DIR"++echo "Starting backup: $TIMESTAMP"++# Database backup via Docker+docker compose -p "$COMPOSE_PROJECT" exec -T database \+ pg_dump -U documenso -F c documenso > "$BACKUP_DIR/database_$TIMESTAMP.dump"++# Certificate backup (copy from container if needed)+docker compose -p "$COMPOSE_PROJECT" cp \+ documenso:/opt/documenso/cert.p12 "$BACKUP_DIR/cert_$TIMESTAMP.p12" 2>/dev/null || true++echo "Backup completed"+```++</Tab>+</Tabs>++Make the script executable:++```bash+chmod +x /usr/local/bin/documenso-backup.sh+```++---++## Backup Retention++Implement a retention policy to balance storage costs with recovery needs.++### Recommended Retention Schedule++| Backup Type | Retention | Use Case |+| ----------- | --------- | ----------------------- |+| Hourly | 24 hours | Recent changes recovery |+| Daily | 7 days | Short-term recovery |+| Weekly | 4 weeks | Medium-term recovery |+| Monthly | 12 months | Long-term archival |++### Retention Script++Add retention logic to your backup script:++```bash+# Remove hourly backups older than 24 hours+find "$BACKUP_DIR/hourly" -name "*.dump" -mtime +1 -delete++# Remove daily backups older than 7 days+find "$BACKUP_DIR/daily" -name "*.dump" -mtime +7 -delete++# Remove weekly backups older than 4 weeks+find "$BACKUP_DIR/weekly" -name "*.dump" -mtime +28 -delete++# Remove monthly backups older than 12 months+find "$BACKUP_DIR/monthly" -name "*.dump" -mtime +365 -delete+```++### Schedule Backups++<Tabs items={['Cron', 'Systemd timer']}>+<Tab value="Cron">++Add to crontab (`crontab -e`):++```+# Daily backup at 2:00 AM+0 2 * * * /usr/local/bin/documenso-backup.sh >> /var/log/documenso-backup.log 2>&1++# Hourly backup (for high-activity instances)+0 * * * * /usr/local/bin/documenso-backup-hourly.sh >> /var/log/documenso-backup.log 2>&1+```++</Tab>+<Tab value="Systemd timer">++Create `/etc/systemd/system/documenso-backup.service`:++```ini+[Unit]+Description=Documenso Backup++[Service]+Type=oneshot+ExecStart=/usr/local/bin/documenso-backup.sh+User=root+```++Create `/etc/systemd/system/documenso-backup.timer`:++```ini+[Unit]+Description=Daily Documenso Backup++[Timer]+OnCalendar=*-*-* 02:00:00+Persistent=true++[Install]+WantedBy=timers.target+```++Enable the timer:++```bash+systemctl daemon-reload+systemctl enable --now documenso-backup.timer+```++</Tab>+</Tabs>++---++## Restore Procedures++### Restore Database++<Tabs items={['Custom format', 'Plain SQL']}>+<Tab value="Custom format">++| Flag | Description |+| ---- | -------------------------------------- |+| `-c` | Drop existing objects before restoring |+| `-d` | Target database |++Direct:++```bash+pg_restore -h localhost -U documenso -d documenso -c documenso_backup.dump+```++Docker Compose:++```bash+docker compose exec -T database pg_restore -U documenso -d documenso -c < documenso_backup.dump+```++</Tab>+<Tab value="Plain SQL">++```bash+psql -h localhost -U documenso -d documenso < documenso_backup.sql+```++For compressed backups:++```bash+gunzip -c documenso_backup.sql.gz | psql -h localhost -U documenso -d documenso+```++</Tab>+</Tabs>++### Restore Certificate++Copy the certificate back to the expected location:++```bash+cp /backup/documenso/cert.p12 /opt/documenso/cert.p12+chmod 644 /opt/documenso/cert.p12+chown 1001:1001 /opt/documenso/cert.p12+```++### Restore S3 Documents++Sync documents back to S3:++```bash+aws s3 sync /backup/documenso/documents/ s3://your-documenso-bucket+```++### Full Restore Procedure++{/* prettier-ignore */}+<Steps>+<Step>+### Stop Documenso++```bash+docker compose stop documenso+```++</Step>+<Step>+### Restore the database++```bash+docker compose exec -T database pg_restore -U documenso -d documenso -c < backup.dump+```++</Step>+<Step>+### Restore the certificate++```bash+docker compose cp cert.p12 documenso:/opt/documenso/cert.p12+```++</Step>+<Step>+### Restore S3 documents (if applicable)++```bash+aws s3 sync /backup/documents/ s3://your-bucket+```++</Step>+<Step>+### Start Documenso++```bash+docker compose start documenso+```++</Step>+<Step>+### Verify the restore++```bash+curl http://localhost:3000/api/health+```++</Step>+</Steps>++---++## Testing Backups++<Callout type="warn">+ Untested backups are not backups. Regularly verify that you can restore from your backups.+</Callout>++### Monthly Restore Test++{/* prettier-ignore */}+<Steps>+<Step>+### Create a test environment++Use a separate database and different port.++</Step>+<Step>+### Restore backup++Restore your backup to the test environment.++</Step>+<Step>+### Verify++- Users can log in+- Documents display correctly+- Signing works with the restored certificate++</Step>+<Step>+### Document any issues++Record any problems found during the test.++</Step>+<Step>+### Tear down++Remove the test environment when done.++</Step>+</Steps>++### Automated Restore Verification++Add verification to your backup script:++```bash+#!/bin/bash+# verify-backup.sh++BACKUP_FILE="$1"+TEST_DB="documenso_restore_test"++# Create test database+psql -h localhost -U postgres -c "CREATE DATABASE $TEST_DB"++# Restore backup+pg_restore -h localhost -U postgres -d "$TEST_DB" "$BACKUP_FILE"++# Verify table counts+USERS=$(psql -h localhost -U postgres -d "$TEST_DB" -t -c "SELECT COUNT(*) FROM \"User\"")+DOCUMENTS=$(psql -h localhost -U postgres -d "$TEST_DB" -t -c "SELECT COUNT(*) FROM \"Document\"")++echo "Verified backup contains: $USERS users, $DOCUMENTS documents"++# Cleanup+psql -h localhost -U postgres -c "DROP DATABASE $TEST_DB"+```++### Backup Integrity Checks++Verify backup file integrity:++```bash+# Check checksum+sha256sum -c documenso_backup.sha256++# Verify pg_dump format+pg_restore --list documenso_backup.dump > /dev/null && echo "Backup is valid"+```++---++## Managed Database Backups++If using a managed PostgreSQL service, configure their backup features.++<Tabs items={['AWS RDS', 'Supabase', 'Neon', 'DigitalOcean']}>+<Tab value="AWS RDS">++- Enable automated backups (Settings > Backup)+- Set retention period (7-35 days)+- Enable Point-in-Time Recovery++</Tab>+<Tab value="Supabase">++- Daily backups included (Pro plan)+- Point-in-Time Recovery available+- Access via Dashboard > Settings > Database++</Tab>+<Tab value="Neon">++- Automatic branching for instant snapshots+- Create branches for backup purposes++</Tab>+<Tab value="DigitalOcean">++- Daily backups with 7-day retention+- Enable in control panel++</Tab>+</Tabs>++<Callout type="info">+ Managed services handle backup automation, but you should still perform occasional manual backups+ to your own storage for additional protection.+</Callout>++---++## Off-Site Backup Storage++Store backups in a separate location from your production system.++### Options++| Storage Type | Pros | Cons |+| --------------- | ----------------------------------- | ---------------------- |+| AWS S3 | Durable, versioned, lifecycle rules | Cost for large backups |+| Backblaze B2 | Low cost, S3-compatible | Egress fees |+| rsync to remote | Simple, no vendor lock-in | Requires server |+| Encrypted USB | Air-gapped, no network required | Manual process |++### Off-Site Upload++<Tabs items={['Upload to S3', 'Encrypt before upload']}>+<Tab value="Upload to S3">++```bash+aws s3 cp documenso_backup.tar.gz s3://your-backup-bucket/documenso/+```++</Tab>+<Tab value="Encrypt before upload">++Encrypt backups before storing off-site:++```bash+# Encrypt+gpg --symmetric --cipher-algo AES256 documenso_backup.tar.gz++# Decrypt+gpg --decrypt documenso_backup.tar.gz.gpg > documenso_backup.tar.gz+```++</Tab>+</Tabs>++---++## See Also++- [Upgrades](/docs/self-hosting/maintenance/upgrades) - Backup before upgrading+- [Troubleshooting](/docs/self-hosting/maintenance/troubleshooting) - Common backup issues+- [Database Configuration](/docs/self-hosting/configuration/database) - Database setup reference+- [Storage Configuration](/docs/self-hosting/configuration/storage) - S3 storage setupdiff --git a/apps/docs/content/docs/self-hosting/maintenance/index.mdx b/apps/docs/content/docs/self-hosting/maintenance/index.mdxnew file mode 100644index 000000000..6619bf3b2--- /dev/null+++ b/apps/docs/content/docs/self-hosting/maintenance/index.mdx@@ -0,0 +1,22 @@+---+title: Maintenance+description: Upgrade, backup, and troubleshoot your self-hosted Documenso instance.+---++<Cards>+ <Card+ title="Upgrades"+ description="Upgrade to new versions safely."+ href="/docs/self-hosting/maintenance/upgrades"+ />+ <Card+ title="Backups"+ description="Backup strategies for your data."+ href="/docs/self-hosting/maintenance/backups"+ />+ <Card+ title="Troubleshooting"+ description="Common issues and solutions."+ href="/docs/self-hosting/maintenance/troubleshooting"+ />+</Cards>diff --git a/apps/docs/content/docs/self-hosting/maintenance/meta.json b/apps/docs/content/docs/self-hosting/maintenance/meta.jsonnew file mode 100644index 000000000..28551427a--- /dev/null+++ b/apps/docs/content/docs/self-hosting/maintenance/meta.json@@ -0,0 +1,4 @@+{+ "title": "Maintenance",+ "pages": ["upgrades", "backups", "troubleshooting"]+}diff --git a/apps/docs/content/docs/self-hosting/maintenance/troubleshooting.mdx b/apps/docs/content/docs/self-hosting/maintenance/troubleshooting.mdxnew file mode 100644index 000000000..02ba026eb--- /dev/null+++ b/apps/docs/content/docs/self-hosting/maintenance/troubleshooting.mdx@@ -0,0 +1,1222 @@+---+title: Troubleshooting+description: Diagnose and resolve common issues with your self-hosted Documenso instance, organized by component.+---++import { Accordion, Accordions } from 'fumadocs-ui/components/accordion';+import { Callout } from 'fumadocs-ui/components/callout';+import { Step, Steps } from 'fumadocs-ui/components/steps';+import { Tab, Tabs } from 'fumadocs-ui/components/tabs';++## General Debugging++### Checking Application Logs++Application logs are your primary source of debugging information.++<Tabs items={['Docker', 'Docker Compose', 'Kubernetes']}>+<Tab value="Docker">++```bash+docker logs documenso+```++</Tab>+<Tab value="Docker Compose">++```bash+docker compose logs -f documenso+```++</Tab>+<Tab value="Kubernetes">++```bash+kubectl logs -l app.kubernetes.io/name=documenso -n documenso -f+```++</Tab>+</Tabs>++### Filtering Logs++Filter logs to find specific errors:++```bash+# Docker - find errors+docker logs documenso 2>&1 | grep -i error++# Docker - find warnings+docker logs documenso 2>&1 | grep -i warn++# Show last 100 lines+docker logs --tail 100 documenso+```++### Health Checks++Documenso exposes a health endpoint to verify the application is running:++```bash+curl http://localhost:3000/api/health+```++A healthy response returns HTTP 200. If the health check fails:++{/* prettier-ignore */}+<Steps>+ <Step>+ Check application logs for startup errors+ </Step>+ <Step>+ Verify database connectivity+ </Step>+ <Step>+ Confirm environment variables are set correctly+ </Step>+</Steps>++### Container Status++Check if containers are running and healthy:++<Tabs items={['Docker', 'Docker Compose', 'Kubernetes']}>+<Tab value="Docker">++```bash+docker ps -a | grep documenso+```++</Tab>+<Tab value="Docker Compose">++```bash+docker compose ps+```++</Tab>+<Tab value="Kubernetes">++```bash+kubectl get pods -n documenso -o wide+```++</Tab>+</Tabs>++### Environment Variable Verification++Verify environment variables are set correctly inside the container:++<Tabs items={['Docker', 'Docker Compose']}>+<Tab value="Docker">++```bash+docker exec documenso printenv | grep NEXT+```++</Tab>+<Tab value="Docker Compose">++```bash+docker compose exec documenso printenv | grep NEXT+```++</Tab>+</Tabs>++<Callout type="warn">+ Be cautious when printing environment variables as they may contain sensitive information like+ passwords and API keys.+</Callout>++---++## Application Issues++### Container Fails to Start++**Symptoms:** Container exits immediately or enters a crash loop.++**Check the exit code:**++```bash+docker inspect documenso --format='{{.State.ExitCode}}'+```++| Exit Code | Meaning |+| --------- | -------------------------- |+| 0 | Normal exit |+| 1 | Application error |+| 137 | Out of memory (OOM killed) |+| 139 | Segmentation fault |+| 143 | Terminated by SIGTERM |++**Common causes and solutions:**++| Cause | Solution |+| ----------------------------- | ----------------------------------------------------- |+| Missing required env variable | Check logs for "required environment variable" errors |+| Database connection failure | Verify database URL and connectivity |+| Port already in use | Change the port mapping or stop conflicting services |+| Insufficient memory | Increase container memory limits |+| Invalid certificate | Check certificate path and passphrase |++### Application Crashes After Startup++**Symptoms:** Application starts but crashes during operation.++**Check for memory issues:**++```bash+# Docker+docker stats documenso++# Kubernetes+kubectl top pod -n documenso+```++**Solutions:**++{/* prettier-ignore */}+<Steps>+ <Step>+ Increase memory limits in Docker or Kubernetes configuration+ </Step>+ <Step>+ Check for memory leaks in custom integrations+ </Step>+ <Step>+ Review application logs around the time of crash+ </Step>+</Steps>++### Startup Timeout in Kubernetes++**Symptoms:** Pod marked as unhealthy, enters CrashLoopBackOff.++**Cause:** Startup probe fails before the application is ready.++**Solution:** Increase startup probe timeout in your deployment:++```yaml+startupProbe:+ httpGet:+ path: /api/health+ port: 3000+ failureThreshold: 60+ periodSeconds: 5+```++This allows up to 5 minutes (60 x 5 seconds) for startup.++### Port Conflicts++**Symptoms:** "Port already in use" error.++**Find what's using the port:**++```bash+# Linux/macOS+lsof -i :3000++# Or using netstat+netstat -tlnp | grep 3000+```++**Solutions:**++{/* prettier-ignore */}+<Steps>+ <Step>+ Stop the conflicting service+ </Step>+ <Step>+ Change Documenso's port mapping: `-p 3001:3000`+ </Step>+</Steps>++---++## Database Issues++### Connection Refused++```+Error: connect ECONNREFUSED 127.0.0.1:5432+```++**Causes:**++- PostgreSQL not running+- Incorrect host in connection string+- Firewall blocking connection+- Database container not started yet++**Solutions:**++{/* prettier-ignore */}+<Steps>+ <Step>+ Verify PostgreSQL is running:++```bash+# Direct PostgreSQL+pg_isready -h localhost -p 5432++# Docker Compose+docker compose ps database+```++ </Step>+ <Step>+ Check connection string host matches database location+ </Step>+ <Step>+ For Docker Compose, ensure the database service is defined and started+ </Step>+ <Step>+ Verify network connectivity between containers+ </Step>+</Steps>++### Authentication Failed++```+Error: password authentication failed for user "documenso"+```++**Causes:**++- Incorrect password+- Password contains unescaped special characters+- User does not exist++**Solutions:**++{/* prettier-ignore */}+<Steps>+ <Step>+ URL-encode special characters in password (`@` becomes `%40`, `#` becomes `%23`)+ </Step>+ <Step>+ Verify credentials match database configuration+ </Step>+ <Step>+ Reset the password:++```sql+ALTER USER documenso WITH PASSWORD 'newpassword';+```++ </Step>+</Steps>++### Database Does Not Exist++```+Error: database "documenso" does not exist+```++**Solution:** Create the database:++```sql+CREATE DATABASE documenso;+GRANT ALL PRIVILEGES ON DATABASE documenso TO documenso;+```++### Too Many Connections++```+Error: too many connections for role "documenso"+```++**Causes:**++- Connection pool exhausted+- Multiple instances without connection pooling+- Connections not being released++**Solutions:**++{/* prettier-ignore */}+<Steps>+ <Step>+ Reduce connection pool size in connection string:++```+postgresql://user:password@host:5432/documenso?connection_limit=5+```++ </Step>+ <Step>+ Increase PostgreSQL `max_connections`+ </Step>+ <Step>+ Implement connection pooling with PgBouncer+ </Step>+</Steps>++### Migration Failures++**Symptoms:** Application fails to start with migration errors.++**Check migration status:**++```sql+SELECT * FROM _prisma_migrations WHERE finished_at IS NULL;+```++**Common causes:**++| Cause | Solution |+| ------------------------- | --------------------------------------------- |+| Database locked | Wait for other processes to complete |+| Insufficient disk | Free up disk space on database server |+| Permission denied | Grant schema modification permissions to user |+| Connection through pooler | Use direct database connection for migrations |++**Retry failed migration:**++{/* prettier-ignore */}+<Steps>+ <Step>+ Fix the underlying issue+ </Step>+ <Step>+ Mark migration as rolled back:++```sql+UPDATE _prisma_migrations SET rolled_back_at = NOW() WHERE migration_name = 'failed_migration';+```++ </Step>+ <Step>+ Restart the application+ </Step>+</Steps>++### SSL Required++```+Error: SSL/TLS required+```++**Solution:** Add SSL mode to connection string:++```+postgresql://user:password@host:5432/documenso?sslmode=require+```++---++## Email Issues++### Emails Not Sending++**Symptoms:** No emails received, no errors in logs.++**Diagnostic steps:**++{/* prettier-ignore */}+<Steps>+ <Step>+ Check email configuration:++```bash+docker exec documenso printenv | grep SMTP+```++ </Step>+ <Step>+ Verify all required variables are set:++| Variable | Required |+| -------------------------------- | -------- |+| `NEXT_PRIVATE_SMTP_TRANSPORT` | Yes |+| `NEXT_PRIVATE_SMTP_FROM_ADDRESS` | Yes |+| `NEXT_PRIVATE_SMTP_FROM_NAME` | Yes |++ </Step>+ <Step>+ Test SMTP connectivity:++```bash+# Test connection to SMTP server+telnet smtp.example.com 587+```++ </Step>+</Steps>++### SMTP Connection Timeout++```+Error: Connection timeout+```++**Causes:**++- Incorrect SMTP hostname or port+- Firewall blocking outbound SMTP+- SMTP server unreachable++**Solutions:**++{/* prettier-ignore */}+<Steps>+ <Step>+ Verify hostname and port match provider documentation+ </Step>+ <Step>+ Check outbound firewall rules for ports 25, 465, 587+ </Step>+ <Step>+ Test connectivity from the container:++```bash+docker exec documenso nc -zv smtp.example.com 587+```++ </Step>+</Steps>++### SMTP Authentication Failed++```+Error: Invalid login or authentication failed+```++**Causes:**++- Incorrect username or password+- Account requires app-specific password+- Account security restrictions++**Solutions:**++{/* prettier-ignore */}+<Steps>+ <Step>+ Double-check credentials+ </Step>+ <Step>+ For Gmail/Microsoft with 2FA, generate an app password+ </Step>+ <Step>+ Check provider for security alerts or blocked sign-ins+ </Step>+</Steps>++### Emails Going to Spam++**Causes:**++- Missing SPF record+- Missing DKIM signature+- No DMARC policy+- Poor sender reputation++**Solutions:**++{/* prettier-ignore */}+<Steps>+ <Step>+ Configure SPF record for your domain+ </Step>+ <Step>+ Set up DKIM signing with your email provider+ </Step>+ <Step>+ Add a DMARC policy+ </Step>+ <Step>+ Use a reputable email provider+ </Step>+ <Step>+ Test deliverability at [mail-tester.com](https://www.mail-tester.com)+ </Step>+</Steps>++### From Address Not Authorized++```+Error: Sender address rejected+```++**Cause:** The `NEXT_PRIVATE_SMTP_FROM_ADDRESS` is not authorized to send from your email provider.++**Solutions:**++{/* prettier-ignore */}+<Steps>+ <Step>+ Verify the domain in your email provider's settings+ </Step>+ <Step>+ Use an email address from a verified domain+ </Step>+ <Step>+ Check provider-specific sender authorization requirements+ </Step>+</Steps>++---++## Signing Issues++### No Certificate Found++```+Error: No certificate found for local signing+```++**Causes:**++- Certificate path not configured+- Certificate file not mounted+- Environment variable not set++**Solutions:**++{/* prettier-ignore */}+<Steps>+ <Step>+ Verify certificate configuration:++```bash+docker exec documenso printenv | grep SIGNING+```++ </Step>+ <Step>+ Check file exists at configured path:++```bash+docker exec documenso ls -la /opt/documenso/cert.p12+```++ </Step>+ <Step>+ Ensure either `NEXT_PRIVATE_SIGNING_LOCAL_FILE_PATH` or `NEXT_PRIVATE_SIGNING_LOCAL_FILE_CONTENTS` is set+ </Step>+</Steps>++### Certificate Permission Denied++```+Error: EACCES: permission denied, open '/opt/documenso/cert.p12'+```++**Cause:** Application cannot read the certificate file.++**Solution:** Fix file permissions:++```bash+# On host before mounting+sudo chown 1001 certificate.p12+chmod 400 certificate.p12+```++### Invalid Certificate Password++```+Error: mac verify failure+```++**Cause:** Incorrect passphrase for the certificate.++**Solutions:**++{/* prettier-ignore */}+<Steps>+ <Step>+ Verify `NEXT_PRIVATE_SIGNING_PASSPHRASE` matches the certificate password+ </Step>+ <Step>+ Check for trailing whitespace or encoding issues+ </Step>+ <Step>+ Test the password:++```bash+openssl pkcs12 -in certificate.p12 -noout+```++ </Step>+</Steps>++### Failed to Get Private Key++```+Error: Failed to get private key bags+```++**Cause:** Certificate has no password or incompatible encryption.++**Solution:** Re-create the certificate with a password and compatible encryption:++```bash+openssl pkcs12 -export -out certificate.p12 -inkey private.key -in certificate.crt \+ -keypbe PBE-SHA1-3DES \+ -certpbe PBE-SHA1-3DES \+ -macalg sha1+```++<Callout type="warn">+ You must set a non-empty password when creating the certificate. Certificates without passwords+ will fail.+</Callout>++### Certificate Expired++```+Error: Certificate has expired+```++**Solution:**++{/* prettier-ignore */}+<Steps>+ <Step>+ Check expiration date:++```bash+openssl pkcs12 -in certificate.p12 -nokeys | openssl x509 -noout -dates+```++ </Step>+ <Step>+ Generate a new certificate or obtain a renewed one from your CA+ </Step>+ <Step>+ Update the certificate file and restart Documenso+ </Step>+</Steps>++### Base64 Decode Error++```+Error: Invalid base64 in NEXT_PRIVATE_SIGNING_LOCAL_FILE_CONTENTS+```++**Cause:** Incorrect base64 encoding or line breaks in the value.++**Solution:** Encode without line breaks:++```bash+# macOS+base64 -i certificate.p12 | tr -d '\n'++# Linux+base64 -w 0 certificate.p12+```++---++## Storage Issues++### S3 Access Denied++```+Error: Access Denied+```++**Causes:**++- Incorrect IAM credentials+- Bucket policy doesn't allow operations+- CORS not configured++**Solutions:**++{/* prettier-ignore */}+<Steps>+ <Step>+ Verify IAM user has required permissions:++```json+{+ "Effect": "Allow",+ "Action": ["s3:PutObject", "s3:GetObject", "s3:DeleteObject"],+ "Resource": "arn:aws:s3:::your-bucket/*"+}+```++ </Step>+ <Step>+ Configure CORS for presigned URL uploads+ </Step>+ <Step>+ Verify credentials are correct and not expired+ </Step>+</Steps>++### S3 Bucket Not Found++```+Error: The specified bucket does not exist+```++**Causes:**++- Bucket name typo+- Bucket in different region+- Bucket doesn't exist++**Solutions:**++{/* prettier-ignore */}+<Steps>+ <Step>+ Verify bucket exists:++```bash+aws s3 ls s3://your-bucket+```++ </Step>+ <Step>+ Check `NEXT_PRIVATE_UPLOAD_REGION` matches bucket region+ </Step>+ <Step>+ Create the bucket if it doesn't exist+ </Step>+</Steps>++### Signature Mismatch++```+Error: SignatureDoesNotMatch+```++**Causes:**++- Incorrect secret access key+- Clock skew between server and S3++**Solutions:**++{/* prettier-ignore */}+<Steps>+ <Step>+ Verify credentials are correct+ </Step>+ <Step>+ Synchronize server time using NTP:++```bash+# Check time+date++# Sync time (Linux)+sudo ntpdate pool.ntp.org+```++ </Step>+</Steps>++### Path-Style Access Required++```+Error: The bucket you are attempting to access must be addressed using the specified endpoint+```++**Cause:** S3-compatible service requires path-style URLs.++**Solution:** Enable path-style access:++```bash+NEXT_PRIVATE_UPLOAD_FORCE_PATH_STYLE=true+```++### File Upload Timeout++**Symptoms:** Large file uploads fail or timeout.++**Causes:**++- Upload size exceeds limit+- Network timeout+- Reverse proxy timeout++**Solutions:**++{/* prettier-ignore */}+<Steps>+ <Step>+ Check configured upload limit: `NEXT_PUBLIC_DOCUMENT_SIZE_UPLOAD_LIMIT`+ </Step>+ <Step>+ Increase reverse proxy timeout (nginx `client_body_timeout`)+ </Step>+ <Step>+ For very large files, verify S3 multipart upload is working+ </Step>+</Steps>++---++## Performance Issues++### Slow Response Times++**Diagnostic steps:**++{/* prettier-ignore */}+<Steps>+ <Step>+ Check container resource usage:++```bash+docker stats documenso+```++ </Step>+ <Step>+ Monitor database performance:++```sql+SELECT query, calls, mean_time+FROM pg_stat_statements+ORDER BY mean_time DESC+LIMIT 10;+```++ </Step>+ <Step>+ Check for memory pressure or CPU throttling+ </Step>+</Steps>++**Common causes and solutions:**++| Cause | Solution |+| ------------------- | --------------------------------------------- |+| Insufficient memory | Increase container memory limits |+| Database slow | Add indexes, increase database resources |+| Network latency | Move database closer to application |+| Large documents | Enable S3 storage instead of database storage |++### High Memory Usage++**Symptoms:** Container OOM killed, slow response times.++**Solutions:**++{/* prettier-ignore */}+<Steps>+ <Step>+ Increase memory limits:++```yaml+# Docker Compose+services:+ documenso:+ deploy:+ resources:+ limits:+ memory: 2G+```++ </Step>+ <Step>+ If using database storage, switch to S3 for large files+ </Step>+ <Step>+ Review and optimize any custom integrations+ </Step>+</Steps>++### Database Performance Degradation++**Symptoms:** Slow queries, timeouts.++**Diagnostic queries:**++```sql+-- Check table sizes+SELECT relname, pg_size_pretty(pg_total_relation_size(relid))+FROM pg_catalog.pg_statio_user_tables+ORDER BY pg_total_relation_size(relid) DESC;++-- Find long-running queries+SELECT pid, now() - pg_stat_activity.query_start AS duration, query+FROM pg_stat_activity+WHERE state != 'idle'+ORDER BY duration DESC;+```++**Solutions:**++{/* prettier-ignore */}+<Steps>+ <Step>+ Run VACUUM ANALYZE to update statistics:++```sql+VACUUM ANALYZE;+```++ </Step>+ <Step>+ Check for missing indexes on frequently queried columns+ </Step>+ <Step>+ Consider upgrading database resources+ </Step>+ <Step>+ Archive old documents and audit logs+ </Step>+</Steps>++### Slow Document Signing++**Symptoms:** Document completion takes a long time.++**Causes:**++- Timestamp server latency+- Large PDF files+- Certificate issues++**Solutions:**++{/* prettier-ignore */}+<Steps>+ <Step>+ Use a faster timestamp server or one geographically closer+ </Step>+ <Step>+ Optimize PDF file sizes before upload+ </Step>+ <Step>+ Verify certificate is valid and not causing retries+ </Step>+</Steps>++---++## Network Issues++### Cannot Reach Application++**Diagnostic steps:**++{/* prettier-ignore */}+<Steps>+ <Step>+ Verify container is running and port is exposed:++```bash+docker ps | grep documenso+```++ </Step>+ <Step>+ Check port binding:++```bash+netstat -tlnp | grep 3000+```++ </Step>+ <Step>+ Test local connectivity:++```bash+curl http://localhost:3000/api/health+```++ </Step>+</Steps>++### Reverse Proxy Issues++**Symptoms:** 502 Bad Gateway, connection refused through proxy.++**Solutions:**++{/* prettier-ignore */}+<Steps>+ <Step>+ Verify upstream is reachable from the proxy+ </Step>+ <Step>+ Check proxy configuration points to correct port+ </Step>+ <Step>+ Ensure headers are forwarded correctly:++```nginx+proxy_set_header Host $host;+proxy_set_header X-Real-IP $remote_addr;+proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;+proxy_set_header X-Forwarded-Proto $scheme;+```++ </Step>+</Steps>++### WebSocket Connection Failures++**Symptoms:** Real-time updates not working.++**Solution:** Configure reverse proxy for WebSocket support:++```nginx+location / {+ proxy_http_version 1.1;+ proxy_set_header Upgrade $http_upgrade;+ proxy_set_header Connection "upgrade";+}+```++### DNS Resolution Failures++```+Error: getaddrinfo ENOTFOUND hostname+```++**Causes:**++- Incorrect hostname+- DNS not configured in container+- Network isolation++**Solutions:**++{/* prettier-ignore */}+<Steps>+ <Step>+ Verify hostname is correct+ </Step>+ <Step>+ Check DNS configuration:++```bash+docker exec documenso cat /etc/resolv.conf+```++ </Step>+ <Step>+ For Docker Compose, use service names for inter-container communication+ </Step>+</Steps>++---++## Getting Help++### Before Asking for Help++Gather this information before seeking support:++{/* prettier-ignore */}+<Steps>+ <Step>+ **Documenso version:**++```bash+docker inspect documenso --format='{{.Config.Image}}'+```++ </Step>+ <Step>+ **Deployment method:** Docker, Docker Compose, Kubernetes, or other+ </Step>+ <Step>+ **Relevant logs:** Filter to show errors around the issue+ </Step>+ <Step>+ **Steps to reproduce:** What actions trigger the problem+ </Step>+ <Step>+ **Environment:** Cloud provider, OS, database type+ </Step>+</Steps>++### Community Support++- **[GitHub Discussions](https://github.com/documenso/documenso/discussions)**+- **[Discord](https://documen.so/discord)**: Join the Documenso community Discord+- **[GitHub Issues](https://github.com/documenso/documenso/issues)**: For confirmed bugs, open an issue++### Reporting Bugs++When reporting bugs, include:++{/* prettier-ignore */}+<Steps>+ <Step>+ Clear description of the expected vs actual behavior+ </Step>+ <Step>+ Steps to reproduce+ </Step>+ <Step>+ Documenso version+ </Step>+ <Step>+ Relevant logs (redact sensitive information)+ </Step>+ <Step>+ Environment details+ </Step>+</Steps>++### Security Issues++For security vulnerabilities, do not open a public issue. Contact [email protected] directly.++---++## Troubleshooting Checklist++Use this checklist when diagnosing issues:++<Accordions type="multiple">+ <Accordion title="Check application logs for errors">+ Run `docker logs documenso` or `docker compose logs documenso` (or `kubectl logs` for+ Kubernetes) and look for error messages.+ </Accordion>+ <Accordion title="Verify all required environment variables are set">+ Compare your `.env` or configuration against [Environment+ Variables](/docs/self-hosting/configuration/environment).+ </Accordion>+ <Accordion title="Confirm database connectivity">+ Test the connection string with `psql` or the database CLI. Ensure the database is running and+ reachable.+ </Accordion>+ <Accordion title="Test health endpoint responds">+ Run `curl http://localhost:3000/api/health` and verify it returns a successful response.+ </Accordion>+ <Accordion title="Check container resource usage (CPU, memory)">+ Use `docker stats` or your container runtime's monitoring to ensure adequate resources.+ </Accordion>+ <Accordion title="Verify certificate is valid and accessible">+ Check `curl http://localhost:3000/api/certificate-status` and ensure file permissions are+ correct.+ </Accordion>+ <Accordion title="Confirm email configuration">+ Verify SMTP settings in [Email Configuration](/docs/self-hosting/configuration/email) and check+ logs for delivery errors.+ </Accordion>+ <Accordion title="Check network connectivity to external services">+ Ensure outbound connections to SMTP, S3, and other external services are allowed.+ </Accordion>+ <Accordion title="Review recent changes (upgrades, config changes)">+ Check release notes and compare your configuration before and after the change.+ </Accordion>+</Accordions>++---++## See Also++- [Backups](/docs/self-hosting/maintenance/backups) - Backup and restore procedures+- [Upgrades](/docs/self-hosting/maintenance/upgrades) - Upgrade procedures+- [Database Configuration](/docs/self-hosting/configuration/database) - Database setup reference+- [Email Configuration](/docs/self-hosting/configuration/email) - Email troubleshooting+- [Signing Certificate](/docs/self-hosting/configuration/signing-certificate) - Certificate troubleshooting+- [Storage Configuration](/docs/self-hosting/configuration/storage) - Storage troubleshootingdiff --git a/apps/docs/content/docs/self-hosting/maintenance/upgrades.mdx b/apps/docs/content/docs/self-hosting/maintenance/upgrades.mdxnew file mode 100644index 000000000..4ac7879cf--- /dev/null+++ b/apps/docs/content/docs/self-hosting/maintenance/upgrades.mdx@@ -0,0 +1,651 @@+---+title: Upgrades+description: Upgrade your self-hosted Documenso installation to get the latest features, security patches, and bug fixes.+---++import { Accordion, Accordions } from 'fumadocs-ui/components/accordion';+import { Callout } from 'fumadocs-ui/components/callout';+import { Step, Steps } from 'fumadocs-ui/components/steps';+import { Tab, Tabs } from 'fumadocs-ui/components/tabs';++## Version Policy++Documenso follows [Semantic Versioning](https://semver.org/):++| Version Type | Format | Description |+| ------------ | ------- | ------------------------------------------ |+| Major | `x.0.0` | Breaking changes, may require manual steps |+| Minor | `x.y.0` | New features, backward compatible |+| Patch | `x.y.z` | Bug fixes, security patches |++<Callout type="info">+ Review the [release notes](https://github.com/documenso/documenso/releases) before upgrading to+ understand what changes are included.+</Callout>++### Image Tags++| Tag | Description | Use Case |+| --------- | -------------------------------- | -------------------- |+| `latest` | Most recent stable release | Development, testing |+| `x.y.z` | Specific version (e.g., `1.5.0`) | Production |+| `release` | Latest build from release branch | Pre-release testing |++For production deployments, pin to a specific version tag to avoid unexpected updates.++## Checking for Updates++### View Current Version++Check your running Documenso version:++<Tabs items={['Docker', 'Docker Compose', 'Kubernetes']}>+<Tab value="Docker">++```bash+docker inspect documenso --format='{{.Config.Image}}'+```++</Tab>+<Tab value="Docker Compose">++```bash+docker compose images+```++</Tab>+<Tab value="Kubernetes">++```bash+kubectl get deployment documenso -n documenso -o jsonpath='{.spec.template.spec.containers[0].image}'+```++</Tab>+</Tabs>++### Check for New Releases++View available releases on GitHub:++```bash+curl -s https://api.github.com/repos/documenso/documenso/releases/latest | grep tag_name+```++Or visit the [releases page](https://github.com/documenso/documenso/releases).++### Check Available Docker Tags++List available image tags:++<Tabs items={['DockerHub', 'GitHub Container Registry']}>+<Tab value="DockerHub">++```bash+curl -s https://hub.docker.com/v2/repositories/documenso/documenso/tags | jq -r '.results[].name'+```++</Tab>+<Tab value="GitHub Container Registry">++```bash+curl -s https://api.github.com/orgs/documenso/packages/container/documenso/versions | jq -r '.[].metadata.container.tags[]'+```++</Tab>+</Tabs>++## Backup Before Upgrading++<Callout type="error">+ Always back up your database before upgrading. Upgrades may include database migrations that+ cannot be reversed.+</Callout>++### Database Backup++<Tabs items={['Docker Compose', 'Kubernetes', 'External Database']}>+<Tab value="Docker Compose">++```bash+docker compose exec database pg_dump -U documenso documenso > backup-$(date +%Y%m%d-%H%M%S).sql+```++</Tab>+<Tab value="Kubernetes">++```bash+kubectl exec -n documenso deploy/postgres -- pg_dump -U documenso documenso > backup-$(date +%Y%m%d-%H%M%S).sql+```++</Tab>+<Tab value="External Database">++Use your database provider's backup tools or `pg_dump`:++```bash+pg_dump "postgresql://user:password@host:5432/documenso" > backup-$(date +%Y%m%d-%H%M%S).sql+```++</Tab>+</Tabs>++### Configuration Backup++Back up your environment configuration:++<Tabs items={['Docker / env file', 'Kubernetes']}>+<Tab value="Docker / env file">++```bash+cp .env .env.backup-$(date +%Y%m%d)+```++</Tab>+<Tab value="Kubernetes">++Export your secrets and configmaps:++```bash+kubectl get secret documenso-secrets -n documenso -o yaml > secrets-backup.yaml+kubectl get configmap documenso-config -n documenso -o yaml > configmap-backup.yaml+```++</Tab>+</Tabs>++See [Backups](/docs/self-hosting/maintenance/backups) for automated backup strategies.++## Upgrade Process++### Docker++{/* prettier-ignore */}+<Steps>+<Step>+### Pull the new image++```bash+docker pull documenso/documenso:1.6.0+```++Replace `1.6.0` with your target version.++</Step>+<Step>+### Stop the current container++```bash+docker stop documenso+docker rm documenso+```++</Step>+<Step>+### Start with the new image++```bash+docker run -d \+ --name documenso \+ -p 3000:3000 \+ --env-file .env \+ -v /path/to/cert.p12:/opt/documenso/cert.p12:ro \+ documenso/documenso:1.6.0+```++</Step>+<Step>+### Verify the upgrade++```bash+docker logs -f documenso+```++Wait for "Ready" or "Listening on port 3000" in the output.++Test the health endpoint:++```bash+curl http://localhost:3000/api/health+```++</Step>+</Steps>++### Docker Compose++{/* prettier-ignore */}+<Steps>+<Step>+### Update the image tag++Edit `compose.yml` or your `.env` file to specify the new version:++```yaml+services:+ documenso:+ image: documenso/documenso:1.6.0+```++Or if using environment variable substitution:++```bash+# In .env+DOCUMENSO_VERSION=1.6.0+```++```yaml+# In compose.yml+services:+ documenso:+ image: documenso/documenso:${DOCUMENSO_VERSION:-latest}+```++</Step>+<Step>+### Pull the new image++```bash+docker compose pull+```++</Step>+<Step>+### Apply the update++```bash+docker compose --env-file .env up -d+```++Docker Compose recreates containers that have changed images.++</Step>+<Step>+### Verify the upgrade++```bash+docker compose ps+docker compose logs -f documenso+```++Confirm the container is running and healthy.++</Step>+</Steps>++### Kubernetes++{/* prettier-ignore */}+<Steps>+<Step>+### Update the deployment image++Edit the deployment directly:++```bash+kubectl set image deployment/documenso \+ documenso=documenso/documenso:1.6.0 \+ -n documenso+```++Or update your manifest file:++```yaml+spec:+ template:+ spec:+ containers:+ - name: documenso+ image: documenso/documenso:1.6.0+```++Then apply:++```bash+kubectl apply -f deployment.yaml+```++</Step>+<Step>+### Monitor the rollout++```bash+kubectl rollout status deployment/documenso -n documenso+```++Watch pods transition:++```bash+kubectl get pods -n documenso -w+```++</Step>+<Step>+### Verify the upgrade++Check the new pods are running:++```bash+kubectl get pods -n documenso -o wide+```++Test the health endpoint:++```bash+kubectl port-forward svc/documenso 3000:80 -n documenso &+curl http://localhost:3000/api/health+```++</Step>+</Steps>++## Database Migrations++Documenso runs database migrations automatically when the container starts. No manual intervention is required.++### Migration Process++{/* prettier-ignore */}+<Steps>+<Step>+### Container starts++The container starts and connects to the database.++</Step>+<Step>+### Prisma checks for migrations++Prisma checks for pending migrations.++</Step>+<Step>+### Migrations run++Migrations are applied in order.++</Step>+<Step>+### Application starts++The application starts after migrations complete.++</Step>+</Steps>++### Checking Migration Status++View migration logs:++<Tabs items={['Docker / Docker Compose', 'Kubernetes']}>+<Tab value="Docker / Docker Compose">++```bash+docker logs documenso 2>&1 | grep -i migration+```++</Tab>+<Tab value="Kubernetes">++```bash+kubectl logs -l app.kubernetes.io/name=documenso -n documenso | grep -i migration+```++</Tab>+</Tabs>++### Slow Migrations++Large databases may take longer to migrate. The startup probe in Kubernetes allows up to 150 seconds (30 failures x 5 second period) for migrations to complete.++If migrations take longer:++{/* prettier-ignore */}+<Steps>+<Step>+### Adjust startup probe++Increase `failureThreshold` on the startup probe.++</Step>+<Step>+### Run migrations separately (optional)++Consider running migrations manually before upgrading (see Manual Migration below).++</Step>+</Steps>++### Manual Migration (Advanced)++To run migrations manually before upgrading:++```bash+# Pull the new image+docker pull documenso/documenso:1.6.0++# Run migrations only+docker run --rm \+ -e NEXT_PRIVATE_DATABASE_URL="postgresql://user:password@host:5432/documenso" \+ documenso/documenso:1.6.0 \+ npx prisma migrate deploy+```++<Callout type="warn">+ This is an advanced operation. In most cases, automatic migrations are sufficient.+</Callout>++## Breaking Changes++Major version upgrades may include breaking changes that require manual steps.++### Before a Major Upgrade++{/* prettier-ignore */}+<Steps>+<Step>+### Read release notes++Read the [release notes](https://github.com/documenso/documenso/releases) carefully.++</Step>+<Step>+### Check environment variables++Check for required environment variable changes.++</Step>+<Step>+### Review configuration++Review any configuration deprecations.++</Step>+<Step>+### Back up database++Back up your database.++</Step>+<Step>+### Plan for downtime++Plan for potential downtime.++</Step>+</Steps>++### Common Breaking Changes++| Change Type | Action Required |+| ------------------------- | -------------------------------------------- |+| New required env variable | Add the variable to your configuration |+| Removed env variable | Remove from configuration to avoid confusion |+| Renamed env variable | Update to the new name |+| Database schema change | Automatic migration (back up first) |+| API changes | Update integrations using the API |++### Environment Variable Changes++Compare your current environment with the latest example:++```bash+# Download latest example+curl -O https://raw.githubusercontent.com/documenso/documenso/main/.env.example++# Compare with your current config+diff .env .env.example+```++## Rollback Procedure++If an upgrade fails, roll back to the previous version.++### Container Rollback++<Tabs items={['Docker', 'Docker Compose', 'Kubernetes']}>+<Tab value="Docker">++```bash+# Stop the new container+docker stop documenso+docker rm documenso++# Start with the previous image+docker run -d \+ --name documenso \+ -p 3000:3000 \+ --env-file .env \+ -v /path/to/cert.p12:/opt/documenso/cert.p12:ro \+ documenso/documenso:1.5.0+```++</Tab>+<Tab value="Docker Compose">++```bash+# Revert the image tag in compose.yml or .env+# Then recreate containers+docker compose --env-file .env up -d+```++</Tab>+<Tab value="Kubernetes">++```bash+# View rollout history+kubectl rollout history deployment/documenso -n documenso++# Rollback to previous version+kubectl rollout undo deployment/documenso -n documenso++# Or rollback to a specific revision+kubectl rollout undo deployment/documenso -n documenso --to-revision=2+```++</Tab>+</Tabs>++### Database Rollback++<Callout type="error">+ Database migrations cannot be automatically reversed. If you need to rollback after migrations+ have run, restore from your backup.+</Callout>++Restore from backup:++<Tabs items={['Docker Compose', 'External Database']}>+<Tab value="Docker Compose">++```bash+docker compose exec -T database psql -U documenso documenso < backup-20240115-120000.sql+```++</Tab>+<Tab value="External Database">++```bash+psql "postgresql://user:password@host:5432/documenso" < backup-20240115-120000.sql+```++</Tab>+</Tabs>++## Troubleshooting Upgrades++<Accordions type="multiple">+ <Accordion title="Container fails to start after upgrade">+ **Check logs:** `docker logs documenso`++ **Common causes:**+ - Missing env variable: check release notes for new required variables+ - Database connection error: verify database is accessible and credentials are valid+ - Migration failure: check logs for the specific migration error+ - Certificate error: verify certificate mount and passphrase++ </Accordion>+ <Accordion title="Migration errors">+ **What to do:**+ - Check the specific error in the logs+ - Verify database connectivity+ - Ensure the database user has `ALTER` permissions+ - Check for sufficient disk space on the database server++ **Test connectivity:**++ ```bash+ docker run --rm postgres:15 psql "postgresql://user:password@host:5432/documenso" -c "SELECT 1"+ ```++ </Accordion>+ <Accordion title="Application errors after upgrade">+ **If the application starts but behaves unexpectedly:**+ - Clear browser cache and cookies+ - Check for new environment variables in release notes+ - Verify all environment variables are correctly set+ - Check application logs:++ ```bash+ docker logs documenso 2>&1 | grep -i -E "(warn|error)"+ ```+ </Accordion>+ <Accordion title="Performance issues after upgrade">+ **If performance degrades:**+ - New indexes being created can cause temporary slowdown (normal)+ - Monitor database CPU and memory usage+ - Review release notes for known performance impacts+ - Allow time for database query plans to stabilize+ </Accordion>+ <Accordion title="Rollback failed">+ **If rollback also fails:**+ - Verify the old image tag exists and is accessible+ - Check that your backup is valid and complete+ - Review environment configuration for any changes+ - Consider restoring to a clean database from backup+ </Accordion>+</Accordions>++## Upgrade Checklist++Use this checklist for each upgrade:++- [ ] Review release notes for the target version+- [ ] Check for breaking changes or new requirements+- [ ] Back up the database+- [ ] Back up environment configuration+- [ ] Note the current image tag for potential rollback+- [ ] Pull the new image+- [ ] Apply the upgrade+- [ ] Verify container starts successfully+- [ ] Check logs for migration completion+- [ ] Test the health endpoint+- [ ] Verify core functionality (login, document upload, signing)+- [ ] Monitor for errors in logs++---++## See Also++- [Backups](/docs/self-hosting/maintenance/backups) - Automated backup strategies+- [Troubleshooting](/docs/self-hosting/maintenance/troubleshooting) - Common issues and solutions+- [Environment Variables](/docs/self-hosting/configuration/environment) - Configuration referencediff --git a/apps/docs/content/docs/self-hosting/meta.json b/apps/docs/content/docs/self-hosting/meta.jsonnew file mode 100644index 000000000..d3757be0f--- /dev/null+++ b/apps/docs/content/docs/self-hosting/meta.json@@ -0,0 +1,6 @@+{+ "title": "Self-Hosting",+ "description": "Run your own instance",+ "root": true,+ "pages": ["getting-started", "deployment", "configuration", "maintenance"]+}diff --git a/apps/docs/content/docs/users/documents/add-fields.mdx b/apps/docs/content/docs/users/documents/add-fields.mdxnew file mode 100644index 000000000..cce483563--- /dev/null+++ b/apps/docs/content/docs/users/documents/add-fields.mdx@@ -0,0 +1,296 @@+---+title: Add Fields+description: Place signature, text, date, and other fields on your document.+---++import { Callout } from 'fumadocs-ui/components/callout';+import { Step, Steps } from 'fumadocs-ui/components/steps';+import { Tab, Tabs } from 'fumadocs-ui/components/tabs';++## Overview++Fields are placeholders that recipients fill in when signing your document. You drag fields from the palette onto your document, position them where you want information collected, and assign them to specific recipients.++++## Add a Field to Your Document++{/* prettier-ignore */}+<Steps>+<Step>+### Select a recipient++In the document editor, select the recipient you want to assign fields to from the recipient list in the sidebar. The selected recipient's color highlights which fields belong to them.++</Step>++<Step>+### Drag a field onto the document++Click and drag a field type from the field palette onto your document. Available field types include:++<Tabs+ items={[+ 'Signature',+ 'Initials',+ 'Name',+ 'Email',+ 'Date',+ 'Text',+ 'Number',+ 'Checkbox',+ 'Radio',+ 'Dropdown',+ ]}+>+ <Tab value="Signature">Captures the recipient's legally binding signature</Tab>+ <Tab value="Initials">Abbreviated signature for acknowledging pages or clauses</Tab>+ <Tab value="Name">Recipient's full name (auto-filled when available)</Tab>+ <Tab value="Email">Recipient's email address (auto-filled)</Tab>+ <Tab value="Date">Date the field was completed (auto-filled)</Tab>+ <Tab value="Text">Free-form text input</Tab>+ <Tab value="Number">Numeric input with optional validation</Tab>+ <Tab value="Checkbox">Multiple selections from options</Tab>+ <Tab value="Radio">Single selection from options</Tab>+ <Tab value="Dropdown">Single selection from a menu</Tab>+</Tabs>++</Step>++<Step>+### Position the field++Drop the field where you want it on the document. You can drag it to reposition after placing.++</Step>+</Steps>++<Callout type="info">+ Each signer must have at least one Signature field assigned to them. The document cannot be sent+ without this.+</Callout>++## Assign Fields to Recipients++Fields are color-coded by recipient. To change which recipient a field belongs to:++{/* prettier-ignore */}+<Steps>+ <Step>+ ### Select the field++ Click on the field to select it.++ </Step>+ <Step>+ ### Change the recipient++ In the field properties panel, change the **Recipient** dropdown.++ </Step>+ <Step>+ ### Confirm the assignment++ The field color updates to match the new recipient.++ </Step>+</Steps>++When you have multiple recipients, make sure each one has the appropriate fields assigned:++- **Signers** need at least one Signature field+- **Approvers** can have fields but don't require them+- **Viewers** cannot have fields assigned+- **Assistants** can pre-fill fields for other recipients++## Position and Resize Fields++### Moving Fields++Click and drag any field to reposition it on the document. Fields snap to help with alignment.++### Resizing Fields++Click a field to select it, then drag the corner handles to resize. This is useful for:++- Making signature fields larger for handwritten signatures+- Expanding text fields to accommodate longer input+- Fitting fields into existing form areas on your PDF++### Multi-Page Documents++Navigate between pages using the page controls. Fields placed on a page stay on that page. You can place fields on any page of your document.++## Configure Field Properties++Click on any field to open its properties panel. Available options vary by field type.++### Common Properties++| Property | Description |+| --------- | ------------------------------------------------------------- |+| Required | Recipient must complete this field to finish signing |+| Read-only | Lock the field with a pre-filled value that cannot be changed |+| Label | Text displayed above the field |+| Font size | Size of text in the field (8-96px) |++### Text Field Properties++| Property | Description |+| --------------- | ------------------------------------------ |+| Placeholder | Hint text shown when the field is empty |+| Default value | Pre-filled text that recipients can modify |+| Character limit | Maximum characters allowed |+| Text alignment | Left, center, or right |++### Number Field Properties++| Property | Description |+| ------------- | ----------------------------- |+| Minimum value | Lowest allowed number |+| Maximum value | Highest allowed number |+| Number format | Display format for the number |++### Selection Field Properties (Checkbox, Radio, Dropdown)++| Property | Description |+| ----------------- | --------------------------------------------------- |+| Options | List of selectable values |+| Default selection | Pre-selected option(s) |+| Direction | Vertical or horizontal layout (Checkbox/Radio only) |++++For detailed information on all field types, see [Field Types](/docs/concepts/field-types).++## Common Field Patterns++### Signature Block++A typical signature block includes the following fields:++1. **Signature**: Where the recipient signs+2. **Name**: Prints their full name below+3. **Date**: Records when they signed++++Place these fields together at the bottom of your document or wherever signature lines appear.++### Terms Acceptance++For documents requiring explicit agreement to terms:++{/* prettier-ignore */}+<Steps>+ <Step>+ ### Add a Checkbox field++ Add a **Checkbox** field with options like "I agree to the terms and conditions".++ </Step>+ <Step>+ ### Mark as required++ Mark the field as **Required**.++ </Step>+ <Step>+ ### Place near the terms++ Place it near the terms text.++ </Step>+</Steps>++### Information Collection++When gathering additional information from signers:++{/* prettier-ignore */}+<Steps>+ <Step>+ ### Add Text fields++ Add **Text** fields for addresses, job titles, or company names.++ </Step>+ <Step>+ ### Add Number fields++ Use **Number** fields for quantities, IDs, or phone numbers.++ </Step>+ <Step>+ ### Add Dropdown fields++ Use **Dropdown** fields for selections like country or department.++ </Step>+ <Step>+ ### Set placeholders++ Set **Placeholder** text to guide what information you need.++ </Step>+</Steps>++### Multiple Signers++When you have multiple people signing the same document:++{/* prettier-ignore */}+<Steps>+ <Step>+ ### Create signature blocks per signer++ Create separate signature blocks for each signer.++ </Step>+ <Step>+ ### Assign fields to recipients++ Assign each block's fields to the correct recipient.++ </Step>+ <Step>+ ### Verify with color coding++ Use the recipient color coding to verify assignments.++ </Step>+ <Step>+ ### Optional: enable signing order++ Consider enabling signing order if signers should sign in sequence.++ </Step>+</Steps>++## Edit or Delete Fields++<Tabs items={['Edit', 'Delete', 'Duplicate']}>+<Tab value="Edit">++Click on any field to select it and open its properties panel. Make your changes and they save automatically.++</Tab>+<Tab value="Delete">++Select the field and press **Delete** or **Backspace** on your keyboard. Alternatively, click the delete icon in the field properties panel.++</Tab>+<Tab value="Duplicate">++Select a field and copy it (**Ctrl+C** or **Cmd+C**), then paste (**Ctrl+V** or **Cmd+V**) to create a duplicate. This is useful when you need multiple similar fields.++</Tab>+</Tabs>++---++## See Also++- [Send Documents](/docs/users/documents/send) - Send for signing and start collecting signatures+- [Create Templates](/docs/users/templates/create) - Save this field layout as a reusable template+- [Field Types](/docs/concepts/field-types) - Detailed configuration options for all field typesdiff --git a/apps/docs/content/docs/users/documents/add-recipients.mdx b/apps/docs/content/docs/users/documents/add-recipients.mdxnew file mode 100644index 000000000..26eea9789--- /dev/null+++ b/apps/docs/content/docs/users/documents/add-recipients.mdx@@ -0,0 +1,187 @@+---+title: Add Recipients+description: Add signers, approvers, viewers, and CC recipients to your document. Each role determines how the recipient interacts with the document.+---++import { Callout } from 'fumadocs-ui/components/callout';+import { Step, Steps } from 'fumadocs-ui/components/steps';+import { Tab, Tabs } from 'fumadocs-ui/components/tabs';++## Add a Recipient++{/* prettier-ignore */}+<Steps>+<Step>+### Open the document editor++You can access the document editor by clicking on a document in your Documents dashboard.++If you're uploading a document, you'll be redirected to the document editor after the upload is complete automatically.++</Step>++<Step>+### Click add signer++In the Recipients section, click **+ Add Signer** to add a new recipient row.++++</Step>++<Step>+### Enter recipient details++Fill in the following information:++- **Email**: The recipient's email address (required)+- **Name**: The recipient's name (optional, but recommended for clarity)+- **Role**: What the recipient needs to do (see [Recipient Roles](/docs/concepts/recipient-roles))++</Step>+</Steps>++## Recipient Information++### Email Address++The email address is where the recipient receives their signing invitation.++Make sure it's correct - once you send the document, the invitation goes to this address and cannot be changed.++### Name++Adding a name helps recipients identify themselves when they receive the document. The name appears in:++- The signing invitation email+- The document activity log+- The completed document's signature certificate++If you leave the name blank, the email address is displayed instead.++## Assigning Roles++Each recipient needs a role that determines what actions they can take:++| Role | What they do |+| --------- | ----------------------------------------------- |+| Signer | Must sign the document |+| Approver | Must approve the document (signing is optional) |+| Viewer | Must confirm they viewed the document |+| Assistant | Pre-fills fields for other recipients |+| CC | Receives a copy after the document is completed |++For detailed information about each role, see [Recipient Roles](/docs/concepts/recipient-roles).++<Callout type="info">+ The Assistant role is only available when sequential signing is enabled.+</Callout>++## Multiple Recipients++You can add as many recipients as you need. Click **+ Add Signer** for each additional person.++Common scenarios:++<Tabs+ items={[+ 'Two-party agreement',+ 'Contract with witness',+ 'Approval workflow',+ 'Keep stakeholders informed',+ ]}+>+ <Tab value="Two-party agreement">Add yourself and the other party as signers.</Tab>+ <Tab value="Contract with witness">Add the main signer plus a viewer as witness.</Tab>+ <Tab value="Approval workflow">Add an approver first, then signers.</Tab>+ <Tab value="Keep stakeholders informed">Add CC recipients who receive the final document.</Tab>+</Tabs>++## Signing Order++By default, all recipients receive the document at the same time and can complete their actions in any order (parallel signing). You can change this to require recipients to act in a specific sequence.++### Parallel Signing (Default)++All recipients receive the document simultaneously. The document is completed when everyone finishes their required actions. Use this when:++- The order doesn't matter+- You want the fastest completion time+- Recipients are independent of each other++### Sequential Signing++Recipients receive the document one at a time, in the order you specify. Each person must complete their action before the next person is notified.++To enable sequential signing:++{/* prettier-ignore */}+<Steps>+ <Step>+ ### Enable signing order++ Toggle on **Enable signing order** in the Recipients section.++ </Step>+ <Step>+ ### Set the order for each recipient++ Assign an order number to each recipient (1, 2, 3, etc.).++ </Step>+ <Step>+ ### Use the same number for parallel steps++ Recipients with the same order number act simultaneously at that step.++ </Step>+</Steps>++<Callout type="info">+ Sequential signing is required to use the Assistant role. Assistants must act before the signers+ whose fields they pre-fill.+</Callout>++**Example workflow:**++| Order | Recipient | Role |+| ----- | ---------------- | --------- |+| 1 | Admin Assistant | Assistant |+| 2 | Department Head | Approver |+| 3 | Contract Party A | Signer |+| 3 | Contract Party B | Signer |+| - | Legal Team | CC |++In this example:++1. The assistant pre-fills information+2. The department head reviews and approves+3. Both contract parties sign at the same time+4. Legal receives a copy after completion++## Editing Recipients++You can modify recipient details anytime before sending the document:++- **Change email or name**: Click on the field and type the new value+- **Change role**: Select a different role from the dropdown+- **Change signing order**: Adjust the order number (if sequential signing is enabled)++<Callout type="warn">+ After sending a document, you cannot change recipients. If you need different recipients, you'll+ need to create a new document.+</Callout>++## Removing Recipients++To remove a recipient, click the delete icon (trash) next to their row. This also removes any fields assigned to that recipient.++You cannot remove recipients after the document has been sent.++---++## See Also++- [Add Fields](/docs/users/documents/add-fields) - Place signature, text, date, and other fields on your document+- [Send Documents](/docs/users/documents/send) - Send for signing and monitor progress+- [Recipient Roles](/docs/concepts/recipient-roles) - Detailed information about each rolediff --git a/apps/docs/content/docs/users/documents/advanced/ai-detection.mdx b/apps/docs/content/docs/users/documents/advanced/ai-detection.mdxnew file mode 100644index 000000000..b9eae4dfe--- /dev/null+++ b/apps/docs/content/docs/users/documents/advanced/ai-detection.mdx@@ -0,0 +1,132 @@+---+title: AI Recipient & Field Detection+description: Use Documenso's AI helpers to detect recipients and fields in draft documents.+---++import { Accordion, Accordions } from 'fumadocs-ui/components/accordion';+import { Callout } from 'fumadocs-ui/components/callout';+import { Step, Steps } from 'fumadocs-ui/components/steps';+import { Tab, Tabs } from 'fumadocs-ui/components/tabs';++## Overview++Documenso can suggest recipients and place fields automatically using Google Vertex AI (Gemini). The feature is optional and only available when your organisation or team has **AI Features** enabled. Documents are processed securely and providers do not retain your data for training.++## Requirements++- AI Features must be enabled in **Document Preferences** for your organisation or team.+- The envelope must be in **Draft** status.+- Helpful rate limits are in place (up to 3 detection requests per minute per IP) to prevent abuse. If you see a "too many requests" message, wait a minute or two and try again.++### Enable AI features++<Tabs items={['Organisation Settings', 'Team Settings']}>+<Tab value="Organisation Settings">++{/* prettier-ignore */}+<Steps>+<Step>+Go to **Settings** > **Document Preferences** > **AI Features**.+</Step>+<Step>+Set to **Enabled**.+</Step>+</Steps>++_This applies to teams that inherit organisation defaults._++</Tab>+<Tab value="Team Settings">++{/* prettier-ignore */}+<Steps>+<Step>+Go to **Team Settings** > **Document Preferences** > **AI Features**.+</Step>+<Step>+Choose **Enabled**, **Disabled**, or **Inherit**.+</Step>+</Steps>++</Tab>+</Tabs>++## Detect Recipients++Use this to identify who needs to sign or approve.++{/* prettier-ignore */}+<Steps>+ <Step>+ Open a draft document or template and go to the **Recipients** panel.+ </Step>+ <Step>+ Select the **sparkle** button to start detection. If AI is enabled, uploads from the dashboard may open the detector automatically.++ ++ </Step>+ <Step>+ Wait for progress to finish, then review the suggested recipients.+ </Step>+ <Step>+ Remove any incorrect entries, then click **Add recipients** to apply. Existing recipients and duplicates are preserved.+ </Step>+</Steps>++<Callout type="info">+ Detection is unavailable once an envelope is completed. You can re-run detection if you update the+ document; each run counts toward the rate limit.+</Callout>++## Detect Fields++Use this to auto-place fields on the pages of a draft.++{/* prettier-ignore */}+<Steps>+ <Step>+ Open the envelope editor and switch to the **Fields** tab.+ </Step>+ <Step>+ Select **Detect with AI**. Optionally provide context (e.g., "Alice is the tenant, Bob is the landlord") to improve recipient assignment.++ ++ ++ </Step>+ <Step>+ Watch the progress indicators (per page and total fields found).+ </Step>+ <Step>+ Review the summary and choose **Add fields** to place them in the editor.+ </Step>+</Steps>++<Callout type="info">+ Works only for draft envelopes and teams with AI features enabled. Existing fields are masked+ during detection to avoid duplicates. Fields are assigned to recipients based on nearby labels and+ your context message; you can edit them after adding.+</Callout>++## Best Practices++<Accordions type="multiple">+ <Accordion title="Keep labels near the intended fields">+ Place labels close to the intended fields (e.g. "Tenant signature", "Buyer email") to improve+ detection accuracy.+ </Accordion>+ <Accordion title="Provide short context when roles are ambiguous">+ Add brief context when recipient roles are unclear to help the AI assign fields correctly.+ </Accordion>+ <Accordion title="Always review suggestions before sending">+ AI assists but does not replace final checks. Review all suggestions before sending documents.+ </Accordion>+</Accordions>++## See Also++- [Add Recipients](/docs/users/documents/add-recipients) - Manually add recipients to documents+- [Add Fields](/docs/users/documents/add-fields) - Manually place fields on documents+- [AI Features (Self-Hosting)](/docs/self-hosting/configuration/advanced/ai-features) - Configure AI detection for self-hosted instancesdiff --git a/apps/docs/content/docs/users/documents/advanced/default-recipients.mdx b/apps/docs/content/docs/users/documents/advanced/default-recipients.mdxnew file mode 100644index 000000000..366346402--- /dev/null+++ b/apps/docs/content/docs/users/documents/advanced/default-recipients.mdx@@ -0,0 +1,54 @@+---+title: Default Document Recipients+description: Learn how to set default recipients with various roles for your documents.+---++import { Callout } from 'fumadocs-ui/components/callout';+import { Tab, Tabs } from 'fumadocs-ui/components/tabs';++## Overview++Documenso allows you to set default recipients for your documents. This is useful when you require specific recipients to be added to every document you send.++You can add default recipients with the same roles as the recipients you can add when sending a document:++<Tabs items={['Signer', 'Approver', 'Viewer', 'CC']}>+ <Tab value="Signer">The recipient will be required to sign the document.</Tab>+ <Tab value="Approver">The recipient will be required to approve the document.</Tab>+ <Tab value="Viewer">The recipient will be required to view the document.</Tab>+ <Tab value="CC">The recipient will receive a copy of the document.</Tab>+</Tabs>++You can set default recipients at the organisation or team level.++### Organisation level++To set default recipients at the organisation level, navigate to the organisation settings page and click the **"Document"** tab under the **"Preferences"** section.++Then scroll down to the **"Default Recipients"** section and add the recipients you want to be included in every document you send.++++The recipients are added with the **"CC"** role by default, but you can select a different role for each recipient.++++### Team level++Setting the default recipients at the team level follows the same process as setting them at the organisation level.++<Callout type="info">+ Setting the default recipients at the team level will override organisation-level defaults.+</Callout>++To set default recipients at the team level, navigate to the team settings page and click the **"Document"** tab under the **"Preferences"** section.++Then scroll down to the **"Default Recipients"** section. By default, the team will inherit the default recipients from the organisation. You can override these defaults by adding the recipients you want to be added to every document you send.++++## See Also++- [Add Recipients](/docs/users/documents/add-recipients) - Add recipients when sending a document+- [Document Preferences](/docs/users/organisations/preferences/document) - Configure other document defaults+- [Recipient Roles](/docs/concepts/recipient-roles) - Learn about the different recipient rolesdiff --git a/apps/docs/content/docs/users/documents/advanced/document-visibility.mdx b/apps/docs/content/docs/users/documents/advanced/document-visibility.mdxnew file mode 100644index 000000000..56b6eae9f--- /dev/null+++ b/apps/docs/content/docs/users/documents/advanced/document-visibility.mdx@@ -0,0 +1,74 @@+---+title: Document Visibility+description: Learn how to control the visibility of your team documents.+---++import { Callout } from 'fumadocs-ui/components/callout';+import { Tab, Tabs } from 'fumadocs-ui/components/tabs';++## Overview++The default document visibility option allows you to control who can view and access the documents uploaded within a team.++This value can either be set in the [document preferences](/docs/users/organisations/preferences/document), or when you [create the document](/docs/users/documents/send)++## Document Visibility Options++In **Default Document Visibility** (under document preferences), you can choose:++<Tabs items={['Everyone', 'Managers and above', 'Admins only', 'Inherit']}>+ <Tab value="Everyone">All team members can access and view the document.</Tab>+ <Tab value="Managers and above">Only managers and admins can access and view the document.</Tab>+ <Tab value="Admins only">Only admins can access and view the document.</Tab>+ <Tab value="Inherit">Use the organisation's default. Available for team-level settings only.</Tab>+</Tabs>++The default is Everyone. Change it in document preferences.++++## How It Works++When you create a document, its visibility depends on your role and the team's default. Select your role:++<Tabs items={['Member', 'Manager', 'Admin']}>+<Tab value="Member">++New documents use the team's default visibility. You cannot change the visibility in the document editor.++</Tab>+<Tab value="Manager">++**If the default is "Everyone" or "Managers and above":** New documents use that setting. You can change it in the editor to "Everyone" or "Managers and above" (not "Admins only").++**If the default is "Admins only":** New documents are admins-only. You cannot change it.++</Tab>+<Tab value="Admin">++New documents use the team's default. You can change the visibility to any option in the document editor.++</Tab>+</Tabs>++You can change visibility at any time by editing the document and choosing a different option.++++<Callout type="warning">+ Updating the default document visibility in the team's general preferences will not affect the+ visibility of existing documents. You will need to update the visibility of each document+ individually.+</Callout>++## A Note on Document Access++The `document owner` (the user who created the document) always has access to the document, regardless of the document's visibility settings. This means that even if a document is set to "Admins only", the document owner can still view and edit the document.++The `recipient` (the user who receives the document for signature, approval, etc.) also has access to the document, regardless of the document's visibility settings. This means that even if a document is set to "Admins only", the recipient can still view and sign the document.++## See Also++- [Document Preferences](/docs/users/organisations/preferences/document) - Configure default document settings+- [Team Members](/docs/users/organisations/members) - Understand team member roles+- [Send Documents](/docs/users/documents/send) - Send documents for signingdiff --git a/apps/docs/content/docs/users/documents/advanced/index.mdx b/apps/docs/content/docs/users/documents/advanced/index.mdxnew file mode 100644index 000000000..3f960cf99--- /dev/null+++ b/apps/docs/content/docs/users/documents/advanced/index.mdx@@ -0,0 +1,27 @@+---+title: Advanced+description: Advanced document features including PDF placeholders, AI detection, default recipients, and visibility controls.+---++<Cards>+ <Card+ title="PDF Placeholders"+ description="Use text placeholders in PDFs to automatically place fields."+ href="/docs/users/documents/advanced/pdf-placeholders"+ />+ <Card+ title="AI Recipient & Field Detection"+ description="Let AI automatically detect recipients and place fields."+ href="/docs/users/documents/advanced/ai-detection"+ />+ <Card+ title="Default Recipients"+ description="Automatically add recipients to every new document."+ href="/docs/users/documents/advanced/default-recipients"+ />+ <Card+ title="Document Visibility"+ description="Control who can see documents within a team."+ href="/docs/users/documents/advanced/document-visibility"+ />+</Cards>diff --git a/apps/docs/content/docs/users/documents/advanced/meta.json b/apps/docs/content/docs/users/documents/advanced/meta.jsonnew file mode 100644index 000000000..20a5c44a8--- /dev/null+++ b/apps/docs/content/docs/users/documents/advanced/meta.json@@ -0,0 +1,10 @@+{+ "title": "Advanced",+ "pages": [+ "...index",+ "pdf-placeholders",+ "ai-detection",+ "default-recipients",+ "document-visibility"+ ]+}diff --git a/apps/docs/content/docs/users/documents/advanced/pdf-placeholders.mdx b/apps/docs/content/docs/users/documents/advanced/pdf-placeholders.mdxnew file mode 100644index 000000000..7c28b7b4e--- /dev/null+++ b/apps/docs/content/docs/users/documents/advanced/pdf-placeholders.mdx@@ -0,0 +1,188 @@+---+title: PDF Placeholders+description: Learn how to use placeholder text in your PDFs for automatic field placement in Documenso.+---++import { Accordion, Accordions } from 'fumadocs-ui/components/accordion';+import { Callout } from 'fumadocs-ui/components/callout';++## Overview++Documenso can automatically detect placeholder text in your PDF documents and create fields at those locations. This allows you to prepare documents in your preferred editing tool (Word, Google Docs, etc.) with placeholders that become signature fields when uploaded.++## How It Works++When you upload a PDF, Documenso scans for text matching the placeholder pattern `{{...}}`. Each placeholder can specify:++1. **Field type**: What kind of field to create (signature, name, email, etc.)+2. **Recipient**: Which signer the field belongs to (r1, r2, etc.)+3. **Options**: Additional settings like required, read-only, font size, etc.++The placeholder text is automatically hidden after fields are created, so your final document looks clean.++## Placeholder Format++The basic format is:++```+{{FIELD_TYPE, RECIPIENT, option1=value1, option2=value2}}+```++### Examples++| Placeholder | Description |+| ----------------------------- | ----------------------------------- |+| `{{signature, r1}}` | Signature field for recipient 1 |+| `{{name, r1}}` | Name field for recipient 1 |+| `{{email, r2}}` | Email field for recipient 2 |+| `{{date, r1}}` | Date field for recipient 1 |+| `{{text, r1, required=true}}` | Required text field for recipient 1 |+| `{{initials, r1}}` | Initials field for recipient 1 |++## Supported Field Types++The following field types are supported in placeholders:++| Field Type | Placeholder Value |+| ---------- | ----------------- |+| Signature | `signature` |+| Initials | `initials` |+| Name | `name` |+| Email | `email` |+| Date | `date` |+| Text | `text` |+| Number | `number` |+| Radio | `radio` |+| Checkbox | `checkbox` |+| Dropdown | `dropdown` |++<Callout type="info">+ Field types are case-insensitive. `{{ SIGNATURE, r1 }}` and `{{ signature, r1 }}` are equivalent.+</Callout>++## Recipient Identifiers++Recipients are identified using `r1`, `r2`, `r3`, etc. The number corresponds to the order in which recipients are created:++- `r1` - First recipient+- `r2` - Second recipient+- `r3` - Third recipient++When you upload a PDF with placeholders, Documenso will:++1. Create placeholder recipients for each unique identifier found (e.g., `r1`, `r2`)+2. You can then update these with real email addresses before sending++<Callout type="warning">+ Placeholders without a recipient identifier (e.g., `{{ signature }}` without `r1`) are reserved+ for API use and will not create fields during upload.+</Callout>++## Field Options++You can customize fields by adding options after the recipient identifier:++### Common Options++| Option | Values | Description |+| ----------- | ------------------------- | ------------------------------------------ |+| `required` | `true`, `false` | Whether the field must be filled |+| `readOnly` | `true`, `false` | Whether the field is pre-filled and locked |+| `fontSize` | Number (e.g., `12`) | Font size in points |+| `textAlign` | `left`, `center`, `right` | Horizontal text alignment |++### Text Field Options++| Option | Values | Description |+| ---------------- | ------ | ------------------------------------- |+| `label` | Text | Label shown in the field |+| `placeholder` | Text | Placeholder text shown before signing |+| `text` | Text | Pre-filled text value |+| `characterLimit` | Number | Maximum characters allowed |++### Number Field Options++| Option | Values | Description |+| -------------- | ------------- | --------------------- |+| `value` | Number | Pre-filled value |+| `minValue` | Number | Minimum allowed value |+| `maxValue` | Number | Maximum allowed value |+| `numberFormat` | Format string | Number display format |++### Examples with Options++```+{{text, r1, required=true, label=Company Name}}+{{number, r1, minValue=0, maxValue=100, value=50}}+{{name, r1, fontSize=14}}+{{text, r2, readOnly=true, text=Contract #12345}}+```++<Callout type="info">+ Signature and Free Signature fields do not support additional options beyond the field type and+ recipient.+</Callout>++## Multiple Recipients Example++Here's how a document might look with placeholders for two signers:++```+AGREEMENT++Party A Signature: {{signature, r1}}+Party A Name: {{name, r1}}+Party A Date: {{date, r1}}++Party B Signature: {{signature, r2}}+Party B Name: {{name, r2}}+Party B Date: {{date, r2}}+```++When uploaded, this creates:++- 3 fields assigned to recipient 1 (Party A)+- 3 fields assigned to recipient 2 (Party B)+- 2 placeholder recipients that you can update with real email addresses++## Tips for Creating Documents++1. **Use a readable font** - Placeholders need to be readable by the PDF parser. Standard fonts like Arial, Helvetica, or Times New Roman work best.++2. **Don't split placeholders** - Ensure the entire placeholder text `{{...}}` is on a single line and not broken across text boxes.++3. **Size matters** - The field will be sized to match the placeholder text width. Use spaces or longer placeholder text if you need wider fields.++4. **Test with a draft** - Upload your document as a draft first to verify fields are detected correctly before sending.++<Callout type="info">+ Placeholder detection happens automatically when you upload a PDF. You can review and adjust the+ created fields in the document editor before sending.+</Callout>++## Troubleshooting++<Accordions type="multiple">+ <Accordion title="Placeholders Not Detected">+ - Ensure placeholders use double curly braces: `{{...}}`+ - Check that the placeholder includes a recipient identifier (e.g., `r1`)+ - Verify the field type is spelled correctly+ - Try using a standard font in your source document+ </Accordion>++<Accordion title="Wrong Field Position">+ - The field is placed at the exact location of the placeholder text - If the position seems off,+ check that your PDF wasn't scaled or reformatted when exported+</Accordion>++ <Accordion title="Placeholder Text Still Visible">+ - Placeholder text is covered with a white rectangle after field creation+ - If you see the text, try re-uploading the document+ </Accordion>+</Accordions>++## See Also++- [Add Fields to Documents](/docs/users/documents/add-fields) - Place fields manually on your documents+- [Field Types](/docs/concepts/field-types) - Detailed reference for all field types+- [Fields API](/docs/developers/api/fields) - Add fields programmatically via APIdiff --git a/apps/docs/content/docs/users/documents/direct-links.mdx b/apps/docs/content/docs/users/documents/direct-links.mdxnew file mode 100644index 000000000..97b180367--- /dev/null+++ b/apps/docs/content/docs/users/documents/direct-links.mdx@@ -0,0 +1,226 @@+---+title: Direct Links+description: Share a signing URL without knowing recipient emails in advance. Recipients can open the link, enter their information, and sign the document.+---++import { Callout } from 'fumadocs-ui/components/callout';+import { Step, Steps } from 'fumadocs-ui/components/steps';++## Overview++Use direct links when you:++- Need to collect signatures from people whose emails you don't have+- Want to embed signing into your website or application+- Are collecting signatures from a public audience (forms, petitions, agreements)++## Limitations++- Direct links only work with templates, not individual documents+- You cannot specify recipient details in advance - they enter their own information+- Each direct link is tied to a single recipient role in the template+- The template owner receives a notification for each completed signature++---++## Create a Direct Link++Direct links are created from templates. You'll need a template before you can generate a direct link.++{/* prettier-ignore */}+<Steps>+<Step>+### Go to your template++Navigate to **Templates** in the sidebar and find the template you want to share.++</Step>++<Step>+### Enable direct link++Click the three-dot menu on the template row and select **Direct link**.++In the modal that appears, click **Enable direct link** to proceed.++++</Step>++<Step>+### Select the recipient++Choose which recipient in your template will use the direct link:++- **Select an existing recipient**: Pick from recipients already defined in your template+- **Create one automatically**: Documenso creates a new "Direct Link Recipient" for you++++The person who opens the direct link will fill in this recipient's fields.++<Callout type="warn">+ The direct link recipient cannot be edited or deleted while the direct link is active. Disable the+ direct link first if you need to modify this recipient.+</Callout>++</Step>++<Step>+### Copy the link++After selecting a recipient, you'll see your direct link:++```+https://app.documenso.com/d/<unique-token>+```++++Copy this link and share it however you need - email, website, QR code, or social media.++</Step>+</Steps>++---++## What Recipients See++When someone opens your direct link:++1. They see the document with all fields assigned to the direct link recipient+2. They enter their name and email address+3. They complete any required fields (signature, text, checkboxes, etc.)+4. After signing, they receive a copy of the completed document via email++If the recipient has a Documenso account with the email they entered, the document also appears in their Documents dashboard.++---++## Manage Direct Links++### Disable a direct link++To temporarily stop accepting signatures:++{/* prettier-ignore */}+<Steps>+ <Step>+ Go to **Templates** and find your template.+ </Step>+ <Step>+ Click the three-dot menu and select **Direct link**.+ </Step>+ <Step>+ Toggle the direct link off.+ </Step>+</Steps>++The link URL remains the same. You can re-enable it later without generating a new link.++### Delete a direct link++To permanently remove a direct link:++{/* prettier-ignore */}+<Steps>+ <Step>+ Disable the direct link first (see above).+ </Step>+ <Step>+ Edit or delete the direct link recipient as needed.+ </Step>+ <Step>+ If you enable direct links again later, you'll get a new URL.+ </Step>+</Steps>++---++## Add Direct Links to Your Profile++You can showcase templates with direct links on your public Documenso profile:++{/* prettier-ignore */}+<Steps>+ <Step>+ Go to **Settings** > **Public Profile**.+ </Step>+ <Step>+ Enable your public profile if you haven't already.+ </Step>+ <Step>+ Add templates with active direct links to your profile.+ </Step>+ <Step>+ Visitors to your profile page can then sign those documents directly.+ </Step>+</Steps>++++This is useful for freelancers, consultants, or businesses who want clients to easily access common agreements.++---++## Use Cases++### Public forms and agreements++Create a template for documents that anyone can sign:++- Liability waivers+- NDAs for event attendees+- Consent forms+- Petition signatures++Share the direct link on your website, in emails, or via QR codes at physical locations.++### Embedded signing++Add signing capabilities to your website or app by embedding the direct link:++```html+<a href="https://app.documenso.com/d/your-token">Sign our agreement</a>+```++Or redirect users to the signing page after they complete another action in your application.++### Self-service contracts++Let customers or partners initiate contracts themselves:++{/* prettier-ignore */}+<Steps>+ <Step>+ Create a template with your standard terms.+ </Step>+ <Step>+ Share the direct link with customers or partners.+ </Step>+ <Step>+ Recipients sign and receive their copy automatically.+ </Step>+ <Step>+ You get notified and the signed document appears in your dashboard.+ </Step>+</Steps>++---++## Direct Links vs Standard Document Flow++| Feature | Standard Flow | Direct Links |+| ---------------------------- | ---------------------- | ---------------------------------------- |+| Know recipient email upfront | Required | Not required |+| Send email invitation | Yes | No (you share the link) |+| Multiple recipients | All specified | One recipient via link, others specified |+| Recipient enters their info | No | Yes |+| Works with | Documents or Templates | Templates only |++---++## See Also++- [Create a Template](/docs/users/templates/create) - Set up a template to use with direct links+- [API: Templates](/docs/developers/api/templates) - Generate documents from templates programmaticallydiff --git a/apps/docs/content/docs/users/documents/index.mdx b/apps/docs/content/docs/users/documents/index.mdxnew file mode 100644index 000000000..7a434ced5--- /dev/null+++ b/apps/docs/content/docs/users/documents/index.mdx@@ -0,0 +1,30 @@+---+title: Documents+description: Upload, prepare, and send documents for electronic signatures.+---++## Document Workflow++1. **[Upload](/docs/users/documents/upload)** - Upload your PDF and configure settings+2. **[Add Recipients](/docs/users/documents/add-recipients)** - Specify who needs to sign, approve, or view+3. **[Add Fields](/docs/users/documents/add-fields)** - Place signature, text, and other fields+4. **[Send](/docs/users/documents/send)** - Send for signing and monitor progress++---++## Additional Options++<Cards>+ <Card+ title="Direct Links"+ description="Share signing links without email invitations."+ href="/docs/users/documents/direct-links"+ />+</Cards>++---++## See Also++- [Document Lifecycle](/docs/concepts/document-lifecycle) - Understanding document statuses+- [Templates](/docs/users/templates) - Create reusable document templatesdiff --git a/apps/docs/content/docs/users/documents/meta.json b/apps/docs/content/docs/users/documents/meta.jsonnew file mode 100644index 000000000..8cdc90f51--- /dev/null+++ b/apps/docs/content/docs/users/documents/meta.json@@ -0,0 +1,4 @@+{+ "title": "Documents",+ "pages": ["upload", "add-recipients", "add-fields", "send", "direct-links", "advanced"]+}diff --git a/apps/docs/content/docs/users/documents/send.mdx b/apps/docs/content/docs/users/documents/send.mdxnew file mode 100644index 000000000..a87b1f128--- /dev/null+++ b/apps/docs/content/docs/users/documents/send.mdx@@ -0,0 +1,236 @@+---+title: Send Documents+description: Send your document for signing, customize email notifications, and manage post-send actions like resending or voiding.+---++import { Callout } from 'fumadocs-ui/components/callout';+import { Step, Steps } from 'fumadocs-ui/components/steps';+import { Tab, Tabs } from 'fumadocs-ui/components/tabs';++## Prerequisites++Before sending, ensure your document has:++- At least one recipient added+- Signature fields assigned to each signer+- Required email addresses for recipients with authentication enabled++## Send a Document++{/* prettier-ignore */}+<Steps>+ <Step>+ Click **Send Document** in the document editor.+ </Step>+ <Step>+ Choose the distribution method: **Email** (recipients get signing links by email) or **None**+ (you get links to share manually).+ </Step>+ <Step>+ If using email, configure subject, message, and reply-to as needed.+ </Step>+ <Step>+ Click **Send** or **Generate Links** to send the document.+ </Step>+</Steps>++Once sent, the document status changes from **Draft** to **Pending**.++## Email Customization++When sending via email, you can customize the email that recipients receive. There are 2 ways to customize the email.++You can customize it before sending the document, after pressing the **Send** button.++++Or you can customize it before sending the document, by clicking on the **Document Settings** button in the editor sidebar. On this page, you can also customize what emails are sent to the recipients.++++### Reply-to email (optional)++Set a reply-to address so recipient replies go to a specific email instead of the default.++### Subject (optional)++Customize the email subject line. If left blank, recipients see a default subject based on their role:++<Tabs items={['Signers', 'Approvers', 'Viewers']}>+ <Tab value="Signers">"Please sign this document"</Tab>+ <Tab value="Approvers">"Please approve this document"</Tab>+ <Tab value="Viewers">"Please view this document"</Tab>+</Tabs>++For team documents, the subject includes the team name.++### Message (optional)++Add a custom message that appears in the email body. You can use these variables:++- `{signer.name}` - Recipient's name+- `{signer.email}` - Recipient's email+- `{document.name}` - Document title++If left blank, a default message is generated based on the recipient's role and whether the sender is part of an organisation.++<Callout type="info">+ Enterprise organisations can configure custom sender email addresses from their organisation+ settings.+</Callout>++## What Recipients Receive++++Each recipient receives an email containing:++- The document title+- Your name and email (or team name for organisation accounts)+- Your custom message (or a default message)+- A button to access the document++The email includes a unique signing link specific to that recipient. This link expires once the document is completed or deleted.++## Document Status After Sending++After sending, your document moves through these statuses:++| Status | Meaning |+| ------------- | ------------------------------------------------ |+| **Pending** | Waiting for recipients to complete their actions |+| **Completed** | All recipients have completed their actions |+| **Rejected** | A recipient rejected the document |++You can track progress from the document detail page, which shows each recipient's signing status.++## Resend to Recipients++If a recipient hasn't acted on the document, you can send them a reminder:++{/* prettier-ignore */}+<Steps>+ <Step>+ Open the document from your Documents page.+ </Step>+ <Step>+ Click the actions menu (three dots) and select **Resend**.+ </Step>+ <Step>+ Check the recipients you want to remind, then click **Send reminder**.+ </Step>+</Steps>++Reminders are only available for:++- Documents with **Pending** status+- Recipients who haven't yet signed++The reminder email includes "Reminder:" prefixed to the subject line and uses the same message from the original send.++## Delete a Pending Document++To stop a signing process and remove a document:++{/* prettier-ignore */}+<Steps>+ <Step>+ Open the document from your Documents page.+ </Step>+ <Step>+ Click the actions menu (three dots) and select **Delete**.+ </Step>+ <Step>+ Type "delete" to confirm, then click **Delete**.+ </Step>+</Steps>++<Callout type="warn">+ Deleting a pending document is irreversible. The document is permanently deleted, all signatures+ are voided, and recipients receive a cancellation email.+</Callout>++### Delete Behavior by Status++| Status | What happens |+| ------------- | -------------------------------------------------------- |+| **Draft** | Permanently deleted, no notifications sent |+| **Pending** | Permanently deleted, recipients notified of cancellation |+| **Completed** | Hidden from your account, recipients keep their copies |++## Document Settings++Access document settings from the **Document Settings** button in the quick actions sidebar of the editor.++### General Settings++| Setting | Description |+| -------------------------------- | --------------------------------------------------------------- |+| **Language** | The language used for emails sent to recipients |+| **Allowed Signature Types** | Which signature methods recipients can use (draw, type, upload) |+| **Date Format** | The date format used for date fields |+| **Time Zone** | The time zone used for date fields |+| **External ID** | A custom identifier for integrating with your external systems |+| **Redirect URL** | Where signers are redirected after completing their actions |+| **Document Distribution Method** | Email (sends notifications) or None (generates signing links) |++### Security Settings++Control authentication requirements for accessing and signing the document.++**Document-level access control:**++| Option | Description |+| ------------------- | ------------------------------------------------------------------------ |+| **Require account** | The recipient must have an account and be signed in to view the document |+| **Require 2FA** | The recipient must use two-factor authentication |+| **None** | The document can be accessed directly via the signing link |++**Recipient Authentication** allows you to require additional verification when a recipient signs a signature field:++| Option | Description |+| ------------------- | -------------------------------------------- |+| **Require passkey** | The recipient must have a passkey configured |+| **Require 2FA** | The recipient must have 2FA enabled |+| **None** | No additional authentication |++You can set authentication at the document level and override it per recipient.++<Callout type="info">+ Recipient Authentication is an Enterprise feature. See the [Enterprise+ Edition](/docs/policies/enterprise-edition) for details.+</Callout>++### Attachments++Configure document attachments from the right-hand side of the editor header. Attachments are included with the signed document when it is completed.++## Distribution Without Email++If you choose **None** as the distribution method:++{/* prettier-ignore */}+<Steps>+ <Step>+ The document is sent without notifying recipients.+ </Step>+ <Step>+ You're redirected to the document page where signing links are displayed.+ </Step>+ <Step>+ Copy the links and share them through your preferred channel (SMS, messaging app, etc.).+ </Step>+</Steps>++This is useful when you want to:++- Send links via SMS or messaging apps+- Embed signing links in your own application+- Control the notification timing yourself++---++## See Also++- [Create Templates](/docs/users/templates/create) - Save time on documents you send repeatedly+- [Direct Links](/docs/users/documents/direct-links) - Let recipients sign without invitationsdiff --git a/apps/docs/content/docs/users/documents/upload.mdx b/apps/docs/content/docs/users/documents/upload.mdxnew file mode 100644index 000000000..bf5f863dd--- /dev/null+++ b/apps/docs/content/docs/users/documents/upload.mdx@@ -0,0 +1,158 @@+---+title: Upload Documents+description: Upload documents to Documenso to prepare them for signing. Covers supported formats, file size limits, and upload methods.+---++import { Accordion, Accordions } from 'fumadocs-ui/components/accordion';+import { Callout } from 'fumadocs-ui/components/callout';+import { Step, Steps } from 'fumadocs-ui/components/steps';++## Limitations++| Limitation | Value |+| ----------------------- | ----------------------------------- |+| Supported format | PDF only |+| Maximum file size | 50MB (configurable for self-hosted) |+| Encrypted PDFs | Not supported |+| Password-protected PDFs | Not supported |++<Callout type="warn">+ Documenso does not support password-protected or encrypted PDF files. Remove encryption before+ uploading.+</Callout>++## Upload Methods++++You can upload documents in two ways:++### Drag and Drop++{/* prettier-ignore */}+<Steps>+ <Step>+ ### Go to the Documents dashboard++ Open your [Documents dashboard](https://app.documenso.com/documents).++ </Step>+ <Step>+ ### Drag and drop your PDF++ Drag a PDF file from your computer and drop it anywhere on the page.++ </Step>+ <Step>+ ### Wait for the upload to complete++ The document will process and the editor will open when ready.++ </Step>+</Steps>++### File Picker++{/* prettier-ignore */}+<Steps>+ <Step>+ ### Go to the Documents dashboard++ Open your [Documents dashboard](https://app.documenso.com/documents).++ </Step>+ <Step>+ ### Open the upload dialog++ Click **Upload Document** in the top right.++ </Step>+ <Step>+ ### Select your file++ Choose a PDF file from your computer.++ </Step>+ <Step>+ ### Wait for the upload to complete++ The document will process and the editor will open when ready.++ </Step>+</Steps>++## Uploading Multiple Documents++You can upload multiple PDF files at once to create a single envelope containing multiple documents. The number of files you can upload per envelope depends on your plan.++To upload multiple files:++- Select multiple PDF files when using the file picker, or+- Drag and drop multiple PDF files at once++All files in the same upload become part of the same envelope and share the same recipients and signing workflow.++<Callout type="info">+ If you need separate signing workflows for each document, upload them individually.+</Callout>++## What Happens After Upload++When you upload a document:++1. **Processing**: Documenso validates the PDF and extracts page information+2. **Draft created**: A new document is created in `Draft` status+3. **Editor opens**: You're taken to the document editor to add recipients and fields++++The document remains in `Draft` status until you send it. You can close the editor and return later - draft documents are saved automatically.++## Troubleshooting++<Accordions type="multiple">+ <Accordion title="File is larger than 50MB">+ Reduce the file size before uploading:++ - Compress images within the PDF+ - Remove unnecessary pages+ - Use a PDF compression tool++ </Accordion>++<Accordion title="Only PDF files are allowed">+ Convert your document to PDF before uploading. Most applications (Word, Google Docs, etc.) can+ export to PDF format.+</Accordion>++<Accordion title="You cannot upload encrypted PDFs">+ The PDF is password-protected or encrypted. Open it in a PDF reader, remove the security settings,+ and save a new copy.+</Accordion>++ <Accordion title="You have reached your document limit">+ Your plan has a monthly document limit. Options:++ - Wait until your limit resets next month+ - Upgrade to a higher plan+ - Delete unused draft documents (this does not restore quota)++ </Accordion>++ <Accordion title="Upload fails with no error message">+ Check that:++ - Your internet connection is stable+ - The file is a valid PDF (try opening it in a PDF reader)+ - The file is not corrupted++ </Accordion>+</Accordions>++---++## See Also++- [Add Recipients](/docs/users/documents/add-recipients) - Specify who needs to sign+- [Add Fields](/docs/users/documents/add-fields) - Place signature and other fields on the document+- [Send Documents](/docs/users/documents/send) - Send the document and monitor progressdiff --git a/apps/docs/content/docs/users/getting-started/create-account.mdx b/apps/docs/content/docs/users/getting-started/create-account.mdxnew file mode 100644index 000000000..17030e730--- /dev/null+++ b/apps/docs/content/docs/users/getting-started/create-account.mdx@@ -0,0 +1,109 @@+---+title: Create an Account+description: Sign up for Documenso and configure your profile.+---++import { Callout } from 'fumadocs-ui/components/callout';+import { Step, Steps } from 'fumadocs-ui/components/steps';++## Choose a Plan++Documenso offers four plans:++| Plan | Best for |+| ---------- | ---------------------------------------------- |+| Free | Trying out document signing (limited features) |+| Individual | Solo professionals |+| Teams | Small to medium teams needing collaboration |+| Platform | Organizations requiring API access and volume |++See the [pricing page](https://documen.so/pricing) for feature details and limits.++<Callout type="info">+ All plans are subject to the [Fair Use Policy](/docs/policies/fair-use).+</Callout>++## Sign Up++{/* prettier-ignore */}+<Steps>+<Step>+### Go to the registration page++Navigate to [documen.so/free](https://documen.so/free) to create a free account. To start with a paid plan, visit the [pricing page](https://documen.so/pricing) and select your plan.++</Step>++<Step>+### Enter your details++Provide your name, email address, and create a password. Alternatively, sign up with Google for faster access.++{/* TODO: Add screenshot of registration form */}++</Step>++<Step>+### Verify your email++Check your inbox for a verification email and click the confirmation link. The email is sent from `[email protected]`.++<Callout type="info">+ If you don't see the email, check your spam folder.+</Callout>+</Step>+</Steps>++## Unlock More Features++For custom branding, team collaboration, API access, and other advanced features, you'll need a paid plan. Explore the [pricing page](https://documen.so/pricing) and choose the plan that fits your needs.++---++## Secure Your Account++After signing up, secure your account with additional authentication methods.++{/* prettier-ignore */}+<Steps>+ <Step>+ ### Go to Security settings++ Go to **Settings > Security** to enable 2FA for an extra layer of protection.++ ++ </Step>+ <Step>+ ### Enable two-factor authentication++ Click the option to enable two-factor authentication and follow the setup wizard.++ ++ </Step>+ <Step>+ ### Go to Passkeys settings++ Passkeys provide passwordless authentication using your device's biometrics or security key. Go to **Settings > Security** to manage passkeys.++ ++ </Step>+ <Step>+ ### Add a passkey++ Click **Add Passkey** to register a new passkey for your account.++ ++ </Step>+</Steps>++---++## See Also++- [Send Your First Document](/docs/users/getting-started/send-first-document) - Upload a PDF and collect signatures+- [Profile Settings](/docs/users/settings/profile) - Update your name and configure your public profile+- [Security Settings](/docs/users/settings/security) - Enable two-factor authenticationdiff --git a/apps/docs/content/docs/users/getting-started/index.mdx b/apps/docs/content/docs/users/getting-started/index.mdxnew file mode 100644index 000000000..9741f4ba0--- /dev/null+++ b/apps/docs/content/docs/users/getting-started/index.mdx@@ -0,0 +1,17 @@+---+title: Getting Started+description: Create your account and send your first document for signing.+---++<Cards>+ <Card+ title="Create an Account"+ description="Sign up for Documenso and set up your profile."+ href="/docs/users/getting-started/create-account"+ />+ <Card+ title="Send Your First Document"+ description="Walk through the complete process of sending a document for signing."+ href="/docs/users/getting-started/send-first-document"+ />+</Cards>diff --git a/apps/docs/content/docs/users/getting-started/meta.json b/apps/docs/content/docs/users/getting-started/meta.jsonnew file mode 100644index 000000000..447c5b858--- /dev/null+++ b/apps/docs/content/docs/users/getting-started/meta.json@@ -0,0 +1,4 @@+{+ "title": "Getting Started",+ "pages": ["create-account", "send-first-document"]+}diff --git a/apps/docs/content/docs/users/getting-started/send-first-document.mdx b/apps/docs/content/docs/users/getting-started/send-first-document.mdxnew file mode 100644index 000000000..2e2b482be--- /dev/null+++ b/apps/docs/content/docs/users/getting-started/send-first-document.mdx@@ -0,0 +1,108 @@+---+title: Send Your First Document+description: Upload a document, add recipients, and send for signing.+---++import { Callout } from 'fumadocs-ui/components/callout';+import { Step, Steps } from 'fumadocs-ui/components/steps';++## Prerequisites++- A [Documenso account](/docs/users/getting-started/create-account).+- A PDF document to send for signing.++## Limitations++- Maximum file size: 50MB (configurable for self-hosted)+- Supported format: PDF only+- Maximum 5 documents can be uploaded at once on standard plans++## Send a Document++{/* prettier-ignore */}+<Steps>+<Step>+### Upload your document++- Go to your [Documents dashboard](https://app.documenso.com/documents)+- Click **Upload Document** in the top right+- Select your PDF file or drag and drop it into the upload area++++After uploading, you'll be taken to the document editor.++++</Step>++<Step>+### Add recipients++In the editor, add the people who must take an action or receive a copy of the document.++- Click **+ Add Signer**+- Enter the recipient's email address and name+- Select their role:+ - **Signer** - Must sign the document+ - **Approver** - Must approve (signature optional)+ - **Viewer** - Must confirm they viewed it+ - **CC** - Receives a copy after completion (no action required)++Add additional recipients by clicking **+ Add Signer** again.++++<Callout type="info">+ Enable **Signing Order** if recipients need to sign in a specific sequence.+</Callout>++</Step>++<Step>+### Add signature fields++Navigate to the **Add Fields** section. For each recipient:++- Select the recipient in the right sidebar+- Drag a **Signature** field onto the document where they should sign+- Optionally add other fields like **Name**, **Date**, or **Initials**++Fields are color-coded by recipient. Resize fields by dragging their corners.++++<Callout type="info">At minimum, each signer needs one Signature field assigned to them.</Callout>++</Step>++<Step>+### Send the document++- Click **Send Document** in the left sidebar (or navigate to the Preview section)+- Review that everything looks correct+- Click **Send**++Your document is now sent.++</Step>+</Steps>++## What Happens Next++1. **Recipients receive an email** with a link to sign the document+2. **Recipients sign** by clicking the link and completing their assigned fields+3. **You get notified** when each recipient completes their action+4. **Everyone receives a copy** of the fully signed document once all signatures are collected++++You can track progress from your Documents dashboard. Click on any document to see which recipients have signed and which are pending.++---++## See Also++- [Create Templates](/docs/users/templates/create) - Save time on documents you send repeatedly+- [Direct Links](/docs/users/documents/direct-links) - Let recipients sign without email invitations+- [Upload and Configure](/docs/users/documents/upload) - Customize document settings for more controldiff --git a/apps/docs/content/docs/users/index.mdx b/apps/docs/content/docs/users/index.mdxnew file mode 100644index 000000000..8c50bfae9--- /dev/null+++ b/apps/docs/content/docs/users/index.mdx@@ -0,0 +1,145 @@+---+title: User Guide+description: Learn how to send documents for signing, create templates, and collaborate with your team.+---++## Getting Started++New to Documenso? Start here to create your account and send your first document.++<Cards>+ <Card+ title="Create an Account"+ description="Sign up and configure your profile."+ href="/docs/users/getting-started/create-account"+ />+ <Card+ title="Send Your First Document"+ description="Upload a PDF, add recipients, place fields, and send for signing."+ href="/docs/users/getting-started/send-first-document"+ />+</Cards>++---++## Documents++Upload, prepare, and send documents for electronic signatures.++<Cards>+ <Card+ title="Upload and Prepare"+ description="Upload your PDF and configure document settings."+ href="/docs/users/documents/upload"+ />+ <Card+ title="Add Recipients"+ description="Specify who needs to sign, approve, or view."+ href="/docs/users/documents/add-recipients"+ />+ <Card+ title="Add Fields"+ description="Place signature, text, date, and other fields."+ href="/docs/users/documents/add-fields"+ />+ <Card+ title="Send and Track"+ description="Send for signing and monitor progress."+ href="/docs/users/documents/send"+ />+ <Card+ title="Direct Links"+ description="Share signing links without email invitations."+ href="/docs/users/documents/direct-links"+ />+</Cards>++---++## Templates++Create reusable templates for documents you send frequently.++<Cards>+ <Card+ title="Create Templates"+ description="Build templates from scratch or from existing documents."+ href="/docs/users/templates/create"+ />+ <Card+ title="Use Templates"+ description="Send documents using your saved templates."+ href="/docs/users/templates/use"+ />+</Cards>++---++## Organisations++Collaborate with your organisation on document signing.++<Cards>+ <Card+ title="About Organisations"+ description="Learn about organisations and how they work."+ href="/docs/users/organisations/overview"+ />+ <Card+ title="Create a Team"+ description="Set up a team within your organisation."+ href="/docs/users/organisations/create-team"+ />+ <Card+ title="Manage Members"+ description="Invite members and assign roles."+ href="/docs/users/organisations/members"+ />+ <Card+ title="Single Sign-On"+ description="Configure SSO for your organisation."+ href="/docs/users/organisations/single-sign-on"+ />+</Cards>++---++## Settings++Configure your account and security options.++<Cards>+ <Card+ title="Profile"+ description="Update your name, email, and signature."+ href="/docs/users/settings/profile"+ />+ <Card+ title="Security"+ description="Manage passwords, two-factor authentication, and passkeys."+ href="/docs/users/settings/security"+ />+</Cards>++---++## Prerequisites++To follow this guide, you need a Documenso account. You can [create a free account](https://app.documenso.com/signup) or use a [self-hosted instance](/docs/self-hosting).++---++## Looking for Something Else?++<Cards>+ <Card+ title="Developer Documentation"+ description="Integrate Documenso into your applications using the API."+ href="/docs/developers"+ />+ <Card+ title="Self-Hosting Guide"+ description="Deploy and run your own Documenso instance."+ href="/docs/self-hosting"+ />+</Cards>diff --git a/apps/docs/content/docs/users/meta.json b/apps/docs/content/docs/users/meta.jsonnew file mode 100644index 000000000..fd406261c--- /dev/null+++ b/apps/docs/content/docs/users/meta.json@@ -0,0 +1,6 @@+{+ "title": "Users",+ "description": "Send and sign documents",+ "root": true,+ "pages": ["getting-started", "documents", "templates", "organisations", "settings"]+}diff --git a/apps/docs/content/docs/users/organisations/billing.mdx b/apps/docs/content/docs/users/organisations/billing.mdxnew file mode 100644index 000000000..c27e9fbe5--- /dev/null+++ b/apps/docs/content/docs/users/organisations/billing.mdx@@ -0,0 +1,24 @@+---+title: Billing+description: Learn how to manage your organisation's billing and subscription.+---++import { Callout } from 'fumadocs-ui/components/callout';+import { Step, Steps } from 'fumadocs-ui/components/steps';++### Billing and Subscription Management++Organisations handle billing centrally, making it easier to manage:++- **Unified Billing**: One subscription covers all teams in the organisation+- **Seat Management**: Add or remove seats across all teams automatically (Teams plan)++You can change plans, view invoices and manage your subscription from the billing page which is accessible from the organisation settings.++++## See Also++- [Create a Team](/docs/users/organisations/create-team) - Set up a new team+- [Team Members](/docs/users/organisations/members) - Manage team members and seats+- [Enterprise Edition](/docs/policies/enterprise-edition) - Enterprise licensing optionsdiff --git a/apps/docs/content/docs/users/organisations/create-team.mdx b/apps/docs/content/docs/users/organisations/create-team.mdxnew file mode 100644index 000000000..d6eb980c1--- /dev/null+++ b/apps/docs/content/docs/users/organisations/create-team.mdx@@ -0,0 +1,166 @@+---+title: Create a Team+description: Set up a new team to collaborate on documents, templates, and settings within your organisation.+---++import { Callout } from 'fumadocs-ui/components/callout';+import { Step, Steps } from 'fumadocs-ui/components/steps';+import { Tab, Tabs } from 'fumadocs-ui/components/tabs';++## Prerequisites++- An organisation.+ - Teams exist within an organisations.+- Organisation Admin or Manager role to create teams.++## Limitations++| Field | Constraint |+| ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |+| **Team name** | 3-30 characters |+| **Team URL** | 3-30 characters; lowercase letters, numbers, dashes, and underscores only.<br />Cannot start or end with dashes or underscores.<br />No consecutive dashes or underscores. |+| **Teams** | Maximum number depends on your plan |++## Create a Team++{/* prettier-ignore */}+<Steps>+<Step>+### Open the create team dialog++- Go to your organisation page+- Click **Create team**++++</Step>++<Step>+### Enter team details++Fill in the required information:++- **Team Name**: A display name for your team (3-30 characters)+- **Team URL**: A unique identifier used in URLs like `app.documenso.com/t/your-team-url`++The Team URL is automatically generated from your team name, but you can customize it.++++</Step>++<Step>+### Configure member access++Choose whether to allow all organisation members to access this team:++<Tabs items={['Checked', 'Unchecked']}>+<Tab value="Checked">++All current and future organisation members can access team documents.++</Tab>+<Tab value="Unchecked">++Only organisation admins and managers are added initially. You can control member access manually later.++</Tab>+</Tabs>++<Callout type="info">You can change member access settings later from team settings.</Callout>++</Step>++<Step>+### Create the team++Click **Create Team** to finish. You'll be taken to your new team's workspace.++</Step>+</Steps>++## Team Settings++After creating a team, you can configure additional settings from **Team Settings**:++<Tabs items={['General', 'Branding', 'Other']}>+<Tab value="General">++| Setting | Description |+| ------- | ----------- |+| **Team Name** | Update the display name. |+| **Team URL** | Change the URL identifier (this changes all team links). |+| **Team Avatar** | Upload an image to identify your team. |+| **Team Email** | Add an email address for your team (see [Team Email](#team-email) below). |++</Tab>+<Tab value="Branding">++Customize how your team's documents appear to recipients:++| Setting | Description |+| ------- | ----------- |+| **Enable Custom Branding** | Turn branding on/off, or inherit from organisation settings. |+| **Branding Logo** | Upload your logo (max 5MB, JPG, PNG, or WebP) to display on signing pages. |+| **Brand Website** | Link your logo to your website. |+| **Brand Details** | Additional information shown at the bottom of emails. |++<Callout type="info">+ Team branding settings can inherit from your organisation. Select "Inherit from organisation" to+ use organisation-level branding, or configure team-specific branding.+</Callout>++</Tab>+<Tab value="Other">++| Setting | Description |+| ------- | ----------- |+| **Document Preferences** | Default settings for new documents. |+| **Email Preferences** | Customize email notifications. |+| **Public Profile** | Configure your team's public presence. |+| **API Tokens** | Generate tokens for API access. |+| **Webhooks** | Set up integrations with external services. |++</Tab>+</Tabs>++++## Team Email++Adding a team email address enables several capabilities:++| Capability | Description |+| ----------------------- | ------------------------------------------------------------------------------------------------ |+| **Team Inbox** | View signing requests sent to this email address. |+| **Send on behalf** | Documents sent from the team appear to come from the team email rather than your personal email. |+| **Track documents** | See documents sent from this email in the team's document list. |+| **Consistent branding** | Recipients see the team identity rather than individual sender details. |++To configure a team email:++{/* prettier-ignore */}+<Steps>+ <Step>+ Go to **Team Settings** > **General**.+ </Step>+ <Step>+ Enter the email address in the **Team Email** field.+ </Step>+ <Step>+ Click **Update** to save.+ </Step>+</Steps>++<Callout type="info">+ The team email is used as the sender identity for documents sent from the team. Recipients will+ see this email address in signing notifications.+</Callout>++---++## See Also++- [Manage Members](/docs/users/organisations/members) - Add team members and configure their roles+- [Create Templates](/docs/users/templates/create) - Set up reusable document templates for your team+- [Single Sign-On](/docs/users/organisations/single-sign-on) - Configure SSO for your organisationdiff --git a/apps/docs/content/docs/users/organisations/email-domains.mdx b/apps/docs/content/docs/users/organisations/email-domains.mdxnew file mode 100644index 000000000..cd94dfa32--- /dev/null+++ b/apps/docs/content/docs/users/organisations/email-domains.mdx@@ -0,0 +1,145 @@+---+title: Email Domains+description: Learn how to create and manage email domains in Documenso.+---++import { Accordion, Accordions } from 'fumadocs-ui/components/accordion';+import { Callout } from 'fumadocs-ui/components/callout';+import { Step, Steps } from 'fumadocs-ui/components/steps';++## Overview++Email Domains allow you to send emails to recipients from your own domain instead of the default Documenso email address.++<Callout type="info">+ **Enterprise Only**: Email Domains is only available to Enterprise customers and custom plans+</Callout>++## Creating Email Domains++Before setting up email domains, ensure you have:++- An Enterprise subscription+- Access to your domain's DNS settings+- Access to your Documenso organisation as an admin or manager++{/* prettier-ignore */}+<Steps>++<Step>+### Access email domains settings++Navigate to your Organisation email domains settings page and click the "Add Email Domain" button.++++</Step>++<Step>+### Configure DNS records++After adding your domain, Documenso will provide you with the following required DNS records that need to be configured on your domain:++- **SPF Record**: Specifies which servers are authorized to send emails from your domain+- **DKIM Record**: Provides email authentication and prevents tampering++++<Callout type="info">+ If you already have an SPF record configured, you will need to update it to include Amazon SES as+ an authorized server instead of creating a new record.+</Callout>++Configure these records in your domain's DNS settings according to their specific instructions.++</Step>++<Step>+### Verify domain configuration++Once you've added the DNS records, return to the Documenso email domains settings page and click the "Verify" button.++This will trigger a verification process which will check if the DNS records are properly configured. If successful, the domain will be marked as "Active".++++<Callout type="info">+ Please note that it may take up to 48 hours for the DNS records to propagate.+</Callout>+</Step>++</Steps>++## Creating Emails++Once your email domain has been configured, you can create multiple email addresses which your members can use when sending documents to recipients.++{/* prettier-ignore */}+<Steps>++<Step>+### Select the email domain you want to use++Navigate to the email domains settings page and click "Manage" on the domain you want to use.++++</Step>++<Step>+### Add a new email++Click on the "Add Email" button to begin the setup process.++++</Step>++<Step>+### Use email++Once you have added an email, you can configure it to be the default email on either the:++- Organisation email preferences page+- Team email preferences page++When a draft document is created, it will inherit the email configured on the team if set, otherwise it will inherit the email configured in the organisation.++You can also configure the email address directly on the document to override the default email if required.++</Step>++</Steps>++## Notes++- If you change the default email, it will not retroactively update any existing documents with the old default email.+- If the email domain becomes invalid, all emails using that domain will fail to send.++## Troubleshooting++<Accordions type="multiple">+ <Accordion title="DNS Verification Fails">+ - Double-check all DNS record values+ - Ensure records are added to the correct domain+ - Wait for DNS propagation (up to 48 hours)++ </Accordion>+ <Accordion title="Emails Not Delivering">+ - Check domain reputation and blacklist status+ - Verify SPF, DKIM, and DMARC records+ - Review bounce and spam reports++ </Accordion>+</Accordions>++<Callout type="info">+ For additional support with Email Domains configuration, contact our support team at+</Callout>++## See Also++- [Email Preferences](/docs/users/organisations/preferences/email) - Configure email notification defaults+- [Branding](/docs/users/organisations/preferences/branding) - Customize emails and signing pages+- [Enterprise Edition](/docs/policies/enterprise-edition) - Enterprise features including email domainsdiff --git a/apps/docs/content/docs/users/organisations/groups.mdx b/apps/docs/content/docs/users/organisations/groups.mdxnew file mode 100644index 000000000..2525b079f--- /dev/null+++ b/apps/docs/content/docs/users/organisations/groups.mdx@@ -0,0 +1,150 @@+---+title: Groups+description: Learn how to manage your team's global preferences.+---++import { Callout } from 'fumadocs-ui/components/callout';+import { Step, Steps } from 'fumadocs-ui/components/steps';+import { Tab, Tabs } from 'fumadocs-ui/components/tabs';++## Overview++Organisation groups lets you manage users across your organisation efficiently. Instead of assigning users to teams one by one, groups allow you to manage access at scale with consistent permissions.++## Key Benefits++<Tabs items={['Instant Access', 'Bulk Operations', 'Role Consistency', 'Audit Trail']}>+<Tab value="Instant Access">++New hires get immediate, appropriate access across all relevant teams.++</Tab>+<Tab value="Bulk Operations">++Remove an entire group (e.g. a departing contractor team) and all members lose access simultaneously.++</Tab>+<Tab value="Role Consistency">++The same role is applied consistently across teams. Avoid accidentally giving admin access when member access was intended.++</Tab>+<Tab value="Audit Trail">++Easily track which groups have access to which teams.++</Tab>+</Tabs>++## Example: Legal Compliance Team++A legal team needs access across **Sales**, **Marketing**, **HR**, and **Operations**. Instead of adding each person to every team:++{/* prettier-ignore */}+<Steps>+<Step>+### Create the group++Create a **Legal Compliance** group with **Member** organisation role.++</Step>+<Step>+### Add members++Add legal team members to the group.++</Step>+<Step>+### Assign to teams++Assign the group to the required teams.++</Step>+</Steps>++<Callout type="info">+ When someone joins, add them to the group and they will get access to all assigned teams. When+ they leave, remove them and access is revoked everywhere.+</Callout>++## Getting Started++Go to the **Groups** section in your organisation settings.++### Role Types++<Tabs items={['Organisation Role', 'Team Role']}>+<Tab value="Organisation Role">++A global role for all members of the group. Set to **Organisation Member** in most cases, otherwise members get access to all teams by default.++</Tab>+<Tab value="Team Role">++The team role you select when assigning the group to a team (e.g. Member, Manager).++</Tab>+</Tabs>++### Create a Group++{/* prettier-ignore */}+<Steps>+<Step>+### Name the group++Give it a descriptive name (e.g. "Legal Compliance").++</Step>+<Step>+### Set organisation role++Define the default role for group members.++</Step>+<Step>+### Add members++Include organisation members in the group.++</Step>+</Steps>++++### Assign a Group to a Team++{/* prettier-ignore */}+<Steps>+<Step>+### Open team settings++Go to the team and click **Settings** > **Groups** tab.++</Step>+<Step>+### Add the group++Click **Add groups** and select the group. Members are automatically added to the team.++</Step>+</Steps>++++### Manage Groups++Click **Manage** on a group to view which teams it's assigned to and edit its settings.++++## What's Next?++- [Create Your First Team](/docs/users/organisations/create-team)+- [Document Preferences](/docs/users/organisations/preferences/document)++## See Also++- [Team Members](/docs/users/organisations/members) - Manage individual team members and roles+- [Create a Team](/docs/users/organisations/create-team) - Set up a new team in your organisation+- [Document Preferences](/docs/users/organisations/preferences/document) - Manage default document settingsdiff --git a/apps/docs/content/docs/users/organisations/index.mdx b/apps/docs/content/docs/users/organisations/index.mdxnew file mode 100644index 000000000..3bc36f44f--- /dev/null+++ b/apps/docs/content/docs/users/organisations/index.mdx@@ -0,0 +1,55 @@+---+title: Organisations+description: Collaborate with your organisation using shared documents, teams, and SSO.+---++## Organisation Features++- **Shared documents**: Organisation members can access and manage documents+- **Role-based access**: Control what members can do+- **Teams**: Organise members into teams within your organisation+- **Centralized billing**: Single subscription for the organisation+- **SSO integration**: Use your identity provider++---++## Getting Started++<Cards>+ <Card+ title="About Organisations"+ description="Learn about organisations and how they work."+ href="/docs/users/organisations/overview"+ />+ <Card+ title="Create a Team"+ description="Set up a new team within your organisation."+ href="/docs/users/organisations/create-team"+ />+ <Card+ title="Manage Members"+ description="Add, remove, and configure member access."+ href="/docs/users/organisations/members"+ />+ <Card+ title="Preferences"+ description="Document, branding, and email settings."+ href="/docs/users/organisations/preferences"+ />+ <Card+ title="Email Domains"+ description="Send emails from your own domain."+ href="/docs/users/organisations/email-domains"+ />+ <Card+ title="Single Sign-On"+ description="Configure SSO with your identity provider."+ href="/docs/users/organisations/single-sign-on"+ />+</Cards>++---++## See Also++- [Security Settings](/docs/users/settings/security) - Configure 2FA and passkeysdiff --git a/apps/docs/content/docs/users/organisations/members.mdx b/apps/docs/content/docs/users/organisations/members.mdxnew file mode 100644index 000000000..41fab018d--- /dev/null+++ b/apps/docs/content/docs/users/organisations/members.mdx@@ -0,0 +1,183 @@+---+title: Team Members+description: Manage team member roles, invite and remove members, and configure access permissions.+---++import { Callout } from 'fumadocs-ui/components/callout';+import { Step, Steps } from 'fumadocs-ui/components/steps';++## Organisation Roles++Organisation members have different permission levels that determine what they can do across the organisation.++| Role | Manage Settings | Manage Teams | Manage Members | Billing | Delete Organisation |+| ----------- | --------------- | ------------ | -------------- | ------- | ------------------- |+| **Owner** | Yes | Yes | Yes | Yes | Yes |+| **Admin** | Yes | Yes | Yes | Yes | Yes |+| **Manager** | Yes | Yes | Yes | No | No |+| **Member** | No | No | No | No | No |++<Callout type="info">+ Organisation Admins and Managers automatically receive Team Admin access to all teams in the+ organisation.+</Callout>++## Team Member Roles++Teams have three roles with different permission levels:++| Role | Permissions |+| ----------- | ------------------------------------------------------------------------------------------------------ |+| **Admin** | Full access to team settings, can manage all members, delete the team, and control document visibility |+| **Manager** | Can manage team members (at or below their role level) and access manager-level documents |+| **Member** | Can access team documents shared with all members |++### Role hierarchy++Higher roles can manage users at or below their level:++- Admins can add, update, or remove **Admins**, **Managers**, and **Members**+- Managers can add, update, or remove **Managers** and **Members**+- Members cannot manage other team members++## Adding Team Members++Before adding someone to a team, they must first be a member of your organisation.++### Add existing organisation members++{/* prettier-ignore */}+<Steps>+ <Step>+ Go to your team settings and click **Add members**.+ </Step>+ <Step>+ Select organisation members from the list and click **Next**.+ </Step>+ <Step>+ Assign a team role to each member, then click **Add Members**.+ </Step>+</Steps>++<Callout type="info">+ If you can't find someone in the member list, they need to be invited to your organisation first.+ You can do this directly from the team member dialog.+</Callout>++### Invite new organisation members++If the person you want to add isn't in your organisation yet:++{/* prettier-ignore */}+<Steps>+ <Step>+ In the **Add members** dialog, click **Invite them to the organisation first**.+ </Step>+ <Step>+ Enter their email address and organisation role, then click **Send invite**.+ </Step>+ <Step>+ Once they accept, return to add them to the team.+ </Step>+</Steps>++### Bulk invite via CSV++You can invite multiple members at once by uploading a CSV file. The CSV should have the following structure:++| Email address | Role |+| ------------------- | ------- |+| [email protected] | Admin |+| [email protected] | Manager |+| [email protected] | Member |++## Accepting Invitations++When someone invites you to an organisation:++{/* prettier-ignore */}+<Steps>+ <Step>+ Check your email for the invitation and click the link.+ </Step>+ <Step>+ Sign in or create a Documenso account.+ </Step>+ <Step>+ Accept the invitation.+ </Step>+</Steps>++After joining the organisation, a team admin or manager can add you to specific teams.++## Changing Member Roles++To change a team member's role:++{/* prettier-ignore */}+<Steps>+ <Step>+ Go to your team settings and find the member in the list.+ </Step>+ <Step>+ Click the actions menu (three dots) and select **Update role**.+ </Step>+ <Step>+ Choose the new role and click **Update**.+ </Step>+</Steps>++<Callout type="warn">+ You can only change roles for members at or below your own role level. For example, managers+ cannot change an admin's role.+</Callout>++## Removing Members++To remove someone from a team:++{/* prettier-ignore */}+<Steps>+ <Step>+ Go to your team settings and find the member in the list.+ </Step>+ <Step>+ Click the actions menu (three dots) and select **Remove from team**.+ </Step>+ <Step>+ Confirm the removal.+ </Step>+</Steps>++Removing someone from a team doesn't remove them from the organisation. They can be re-added to the team later.++## Member Limits++Member limits depend on your plan. The Platform plan includes unlimited members but is limited to a single team. The Teams plan includes 5 organisation members, with additional members charged per seat.++| Plan | Included Members | Teams | Additional Members |+| -------------- | ---------------- | ------ | ------------------ |+| **Platform** | Unlimited | 1 | N/A |+| **Teams** | 5 | Custom | Per-seat pricing |+| **Enterprise** | Custom | Custom | Per agreement |++When you invite new members on a seat-based plan, your billing automatically adjusts. Check your organisation's billing settings to see your current member count and limits.++## Document Visibility++Team documents have visibility settings that control which roles can access them:++| Visibility | Who can see |+| --------------------- | ------------------- |+| **Admin only** | Only team admins |+| **Manager and above** | Admins and managers |+| **Everyone** | All team members |++Admins can set default visibility for new documents in team settings.++---++## See Also++- [Single Sign-On](/docs/users/organisations/single-sign-on) - Configure SSO for your organisation+- [Create a Team](/docs/users/organisations/create-team) - Set up additional teamsdiff --git a/apps/docs/content/docs/users/organisations/meta.json b/apps/docs/content/docs/users/organisations/meta.jsonnew file mode 100644index 000000000..f19f48f4d--- /dev/null+++ b/apps/docs/content/docs/users/organisations/meta.json@@ -0,0 +1,13 @@+{+ "title": "Organisations",+ "pages": [+ "overview",+ "create-team",+ "members",+ "groups",+ "email-domains",+ "preferences",+ "single-sign-on",+ "billing"+ ]+}diff --git a/apps/docs/content/docs/users/organisations/overview.mdx b/apps/docs/content/docs/users/organisations/overview.mdxnew file mode 100644index 000000000..5c8ed801c--- /dev/null+++ b/apps/docs/content/docs/users/organisations/overview.mdx@@ -0,0 +1,99 @@+---+title: Overview+description: Organisations are the top-level entity in Documenso, containing teams, members, and shared settings.+---++import { Accordion, Accordions } from 'fumadocs-ui/components/accordion';+import { Callout } from 'fumadocs-ui/components/callout';+import { Step, Steps } from 'fumadocs-ui/components/steps';++## What are Organisations?++Organisations are the top-level entity in Documenso's hierarchy. Each organisation can contain multiple teams, and each team can have multiple members.++++This structure provides:++| Benefit | Description |+| -------------------------- | ----------------------------------------------------------------- |+| **Centralized Management** | Control multiple teams from a single organisational dashboard. |+| **Unified Billing** | Manage billing and subscriptions at the organisation level. |+| **Access Control** | Define roles and groups across the entire organisation. |+| **Group Management** | Create custom groups to organise members and control team access. |+| **Global Settings** | Apply consistent settings across all teams in your organisation. |++## Create a New Organisation++<Callout type="info">+ You can create multiple organisations, but each organisation is billed separately.+</Callout>++{/* prettier-ignore */}+<Steps>++<Step>+### Open organisation creation++Navigate to the organisation section and click **Create Organisation**.++++</Step>++<Step>+### Select your plan++Choose a plan for your new organisation. If you want to upgrade an existing organisation, go to your organisation's billing settings.++</Step>++<Step>+### Name your organisation++Enter an **Organisation Name** as the display name for your organisation.++</Step>++</Steps>++Once created, you can create teams to organise your work. Each team operates independently but inherits organisation-level settings and branding.++## Organisation vs Team Settings++Teams inherit settings from their parent organisation by default. You can override these at the team level:++| Setting | Organisation Level | Team Level |+| ------------------------ | -------------------------- | ----------------------- |+| **Branding** | Sets default for all teams | Can override or inherit |+| **Document Preferences** | Sets default for all teams | Can override or inherit |+| **Email Preferences** | Sets default for all teams | Can override or inherit |+| **Document Visibility** | Sets default for all teams | Can override or inherit |+| **Billing** | Managed centrally | Not applicable |+| **SSO** | Configured centrally | Not applicable |+| **Members** | Managed at org level | Assigned per team |++## Best Practices++<Accordions type="multiple">+ <Accordion title="Use groups effectively">+ Leverage groups to simplify permission management across teams.+ </Accordion>+ <Accordion title="Set organisation-wide defaults">+ Configure document preferences, branding, and email settings at the organisation level for+ consistency.+ </Accordion>+ <Accordion title="Assign roles carefully">+ Organisation Admins and Managers automatically receive Team Admin access to all teams.+ </Accordion>+</Accordions>++---++## See Also++- [Create a Team](/docs/users/organisations/create-team) - Set up a team within your organisation+- [Team Members](/docs/users/organisations/members) - Manage member roles at the organisation and team level+- [Groups](/docs/users/organisations/groups) - Organise members into groups for bulk team access+- [Billing](/docs/users/organisations/billing) - Manage organisation billing and subscriptions+- [Document Preferences](/docs/users/organisations/preferences/document) - Configure default document settingsdiff --git a/apps/docs/content/docs/users/organisations/preferences/branding.mdx b/apps/docs/content/docs/users/organisations/preferences/branding.mdxnew file mode 100644index 000000000..21d5b980c--- /dev/null+++ b/apps/docs/content/docs/users/organisations/preferences/branding.mdx@@ -0,0 +1,149 @@+---+title: Branding+description: Customize how your documents appear to recipients by adding your logo to signing pages and company details in email notifications.+---++import { Accordion, Accordions } from 'fumadocs-ui/components/accordion';+import { Callout } from 'fumadocs-ui/components/callout';+import { Step, Steps } from 'fumadocs-ui/components/steps';++++## Plan Requirements++<Callout type="warn">+ Custom branding requires a **Teams plan or higher**. On lower plans, the branding settings page+ displays an upgrade prompt.+</Callout>++## What You Can Customize++| Setting | Description |+| ----------------- | ----------------------------------------------------------------------------- |+| **Logo** | Displayed on signing pages when recipients view and sign your documents |+| **Website URL** | Makes your logo clickable, linking to your website |+| **Brand Details** | Text shown at the bottom of email notifications (address, company info, etc.) |++## Limitations++| Item | Limit / Requirement |+| ----------------- | ------------------------------------------------- |+| Logo file size | Maximum 5MB |+| Supported formats | JPG, PNG, or WebP |+| Brand details | Maximum 500 characters |+| Website URL | Must be a valid URL (e.g., `https://example.com`) |++## Configure Branding++{/* prettier-ignore */}+<Steps>+<Step>+### Navigate to branding settings++Go to your organisation settings and select the **Branding** tab under **Preferences**. For team branding, go to your team's settings page and select the **Branding** tab under **Preferences**.++</Step>++<Step>+### Enable custom branding++Select **Yes** from the **Enable Custom Branding** dropdown.++When disabled, recipients see the default Documenso branding.++</Step>++<Step>+### Upload your logo++Click the file input to select an image from your computer. A preview displays after selection.++To remove an uploaded logo, click **Remove**.++</Step>++<Step>+### Add your website URL (optional)++Enter your website URL in the **Brand Website** field. When set, clicking your logo on the signing page opens your website in a new tab.++</Step>++<Step>+### Add brand details (optional)++Enter company information in the **Brand Details** field. This text appears at the bottom of email notifications sent to recipients.++Use this for:++- Company address+- Contact information+- Legal disclaimers++</Step>++<Step>+### Save changes++Click **Update** to save your branding settings.++</Step>+</Steps>++## Where Branding Appears++| Location | Effect |+| ----------------------- | ------------------------------------------------------------ |+| **Signing pages** | Recipients see your logo when viewing and signing documents |+| **Email notifications** | Brand details appear at the bottom of signing request emails |++## Organisation vs Team Branding++Branding can be configured at two levels:++### Organisation branding++Set default branding for your entire organisation in **Organisation Settings > Preferences > Branding**. All teams inherit these settings by default.++### Team branding++Override organisation branding for specific teams in **Team Settings > Preferences > Branding**. Team settings support three options:++| Setting | Behavior |+| ----------------------------- | ---------------------------------------------------------------- |+| **Yes** | Enable branding with team-specific logo and details |+| **No** | Disable branding for this team (show default Documenso branding) |+| **Inherit from organisation** | Use the organisation's branding settings |++<Callout type="info">+ When a team has **Inherit from organisation** selected, any changes to organisation branding+ automatically apply to that team.+</Callout>++For individual branding fields (logo, URL, details), leaving them blank also inherits from the organisation.++## Troubleshooting++<Accordions type="multiple">+ <Accordion title="Logo not appearing">+ - Verify custom branding is enabled (set to **Yes**)+ - Check that the image file is under 5MB+ - Ensure the file format is JPG, PNG, or WebP+ - Wait a few minutes for changes to propagate++ </Accordion>+ <Accordion title="Brand details not in emails">+ - Confirm the **Brand Details** field is filled in+ - Verify branding is enabled+ - Check that you saved changes by clicking **Update**++ </Accordion>+</Accordions>++---++## See Also++- [Profile Settings](/docs/users/settings/profile) - Update your name and public profile+- [Security Settings](/docs/users/settings/security) - Configure two-factor authentication+- [Create a Team](/docs/users/organisations/create-team) - Set up team-specific brandingdiff --git a/apps/docs/content/docs/users/organisations/preferences/document.mdx b/apps/docs/content/docs/users/organisations/preferences/document.mdxnew file mode 100644index 000000000..1ed043d2a--- /dev/null+++ b/apps/docs/content/docs/users/organisations/preferences/document.mdx@@ -0,0 +1,54 @@+---+title: Document+description: Learn how to manage your team's global preferences.+---++import { Callout } from 'fumadocs-ui/components/callout';++## Overview++Document preferences allow you to set the default settings when creating new documents and templates.++For example, you can set the default language for documents sent by the team, or set the allowed signatures types.++## Preferences++Document preferences can be set on either the organisation or team level.++By default, teams inherit the preferences from the organisation. You can override these preferences on the team level at any time.++To access the preferences, navigate to either the organisation or teams settings page and click the **Document** tab under the **Preferences** section.++++| Setting | Description |+| ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------- |+| **Default Document Visibility** | Default visibility for documents created by team members. See [document visibility](/docs/users/documents/advanced/document-visibility). |+| **Default Document Language** | Default language for documents and for email communications with recipients. |+| **Default Date Format** | Date format used for date fields and signing. |+| **Default Time Zone** | Timezone used for date fields and signing. |+| **Default Signature Settings** | Which signature types (typed, drawn, uploaded) recipients can use when signing. |+| **Send on Behalf of Team** | Whether the sender's name appears in team emails. See [sender details](#sender-details) below. |+| **Include the Signing Certificate** | Whether the signing certificate is embedded in signed PDFs. The certificate is always available separately from the logs page. |+| **Include the Audit Logs** | Whether the audit logs are embedded in the document when downloaded. The audit logs are always available separately from the logs page. |+| **Default Recipients** | Recipients that are automatically added to new documents. Can be overridden per document. |+| **Delegate Document Ownership** | Allow team API tokens to delegate document ownership to another team member. |+| **AI Features** | Enable AI-powered features such as automatic recipient detection. Only shown if AI features are configured on the instance. |++Document visibility, language, and signature settings can be overridden per document.++### Sender Details++If the **Sender Details** setting is enabled, the emails sent by the team will include the sender's name. The email will say:++> "Example User" on behalf of "Example Team" has invited you to sign "document.pdf"++If the **Sender Details** setting is disabled, the emails sent by the team will not include the sender's name. The email will say:++> "Example Team" has invited you to sign "document.pdf"++## See Also++- [Document Visibility](/docs/users/documents/advanced/document-visibility) - Control who can access documents+- [Email Preferences](/docs/users/organisations/preferences/email) - Configure email notification settings+- [Send Documents](/docs/users/documents/send) - Send documents for signingdiff --git a/apps/docs/content/docs/users/organisations/preferences/email.mdx b/apps/docs/content/docs/users/organisations/preferences/email.mdxnew file mode 100644index 000000000..12a4b31c1--- /dev/null+++ b/apps/docs/content/docs/users/organisations/preferences/email.mdx@@ -0,0 +1,32 @@+---+title: Email+description: Learn how to set the email preferences for your team account.+---++import { Callout } from 'fumadocs-ui/components/callout';++## Overview++Email preferences allow you to set the default settings when emailing documents to your recipients.++## Preferences++Email preferences can be set on either the organisation or team level.++By default, teams inherit the preferences from the organisation. You can override these preferences on the team level at any time.++To access the preferences, navigate to either the organisation or teams settings page and click the **Email** tab under the **Preferences** section.++++| Setting | Description |+| -------------------------- | ---------------------------------------------------------------------------------------------------------- |+| **Default Email** | The sender email address used when sending documents. Requires a verified [email domain](/docs/users/organisations/email-domains). Teams can inherit from the organisation or select their own. |+| **Reply to email** | Email address used in the "Reply To" field in outgoing emails. Leave blank to inherit from the organisation. |+| **Default Email Settings** | Controls which emails are sent to recipients during document signing (e.g. signing invitations, completion notifications). Teams can inherit from the organisation or override with custom settings. |++## See Also++- [Email Domains](/docs/users/organisations/email-domains) - Send emails from your own domain+- [Document Preferences](/docs/users/organisations/preferences/document) - Configure other document defaults+- [Send Documents](/docs/users/documents/send) - Customize emails when sending documentsdiff --git a/apps/docs/content/docs/users/organisations/preferences/index.mdx b/apps/docs/content/docs/users/organisations/preferences/index.mdxnew file mode 100644index 000000000..032a9b3b2--- /dev/null+++ b/apps/docs/content/docs/users/organisations/preferences/index.mdx@@ -0,0 +1,26 @@+---+title: Preferences+description: Configure default document, branding, and email settings for your organisation and teams.+---++Organisation preferences set defaults that teams inherit. Teams can override these settings individually.++---++<Cards>+ <Card+ title="Document"+ description="Default document visibility, language, date format, and signature settings."+ href="/docs/users/organisations/preferences/document"+ />+ <Card+ title="Branding"+ description="Customize signing pages and email notifications with your brand."+ href="/docs/users/organisations/preferences/branding"+ />+ <Card+ title="Email"+ description="Default sender email, reply-to address, and notification settings."+ href="/docs/users/organisations/preferences/email"+ />+</Cards>diff --git a/apps/docs/content/docs/users/organisations/preferences/meta.json b/apps/docs/content/docs/users/organisations/preferences/meta.jsonnew file mode 100644index 000000000..afcf02f8f--- /dev/null+++ b/apps/docs/content/docs/users/organisations/preferences/meta.json@@ -0,0 +1,4 @@+{+ "title": "Preferences",+ "pages": ["...index", "document", "branding", "email"]+}diff --git a/apps/docs/content/docs/users/organisations/single-sign-on/configuration.mdx b/apps/docs/content/docs/users/organisations/single-sign-on/configuration.mdxnew file mode 100644index 000000000..1f1ccabfb--- /dev/null+++ b/apps/docs/content/docs/users/organisations/single-sign-on/configuration.mdx@@ -0,0 +1,259 @@+---+title: Configuration+description: Configure Single Sign-On for your team using any OpenID Connect (OIDC) identity provider.+---++import { Accordion, Accordions } from 'fumadocs-ui/components/accordion';+import { Callout } from 'fumadocs-ui/components/callout';+import { Step, Steps } from 'fumadocs-ui/components/steps';+import { Tab, Tabs } from 'fumadocs-ui/components/tabs';++<Callout type="warn">SSO is only available on the Enterprise plan.</Callout>++## Supported Providers++Documenso supports any identity provider that implements the OpenID Connect (OIDC) protocol. Common providers include:++- Microsoft Entra ID (formerly Azure AD)+- Google Workspace+- Okta+- Auth0+- OneLogin+- JumpCloud++## Setting Up SSO++<Callout type="info">You must be an organisation admin or manager to configure SSO.</Callout>++{/* prettier-ignore */}+<Steps>+<Step>+### Access SSO settings++1. Navigate to your organisation settings+2. Select **Single Sign-On** from the sidebar++++</Step>++<Step>+### Get your redirect URI++At the top of the SSO settings page, you'll find the **Redirect URI** and **Required Scopes**. Copy these values - you'll need them when configuring your identity provider.++</Step>++<Step>+### Configure your identity provider++In your identity provider's admin console, create a new OIDC application with:++- **Redirect URI**: The value from the Documenso SSO settings page+- **Scopes**: `openid`, `email`, `profile`++After creating the application, note down:++- Client ID+- Client Secret+- OpenID Connect discovery URL (also called "well-known" URL)++</Step>++<Step>+### Enter SSO configuration++Back in Documenso, enter the following:++- **Issuer URL**: Your provider's OpenID Connect discovery endpoint+- **Client ID**: The application client ID from your provider+- **Client Secret**: The application secret from your provider++</Step>++<Step>+### Set allowed domains and default role++Configure which email domains can authenticate and what role new users receive (see sections below).++</Step>++<Step>+### Enable SSO++Toggle **Enable SSO portal** and click **Update** to activate SSO for your team.++</Step>+</Steps>++## SSO Configuration Settings++### Issuer URL++The OpenID Connect discovery endpoint for your identity provider.++| Provider | Issuer URL Format |+| ------------------ | ------------------------------------------------------------------------------------- |+| Google Workspace | `https://accounts.google.com/.well-known/openid-configuration` |+| Microsoft Entra ID | `https://login.microsoftonline.com/{tenant-id}/v2.0/.well-known/openid-configuration` |+| Okta | `https://{your-domain}.okta.com/.well-known/openid-configuration` |+| Auth0 | `https://{your-domain}.auth0.com/.well-known/openid-configuration` |++### Client Credentials++- **Client ID**: The unique identifier for your OIDC application+- **Client Secret**: The secret key used to authenticate your application++<Callout type="warn">+ Store your client secret securely. If compromised, regenerate it immediately in your identity+ provider.+</Callout>++### Default Organisation Role++The role assigned to users when they first sign in through SSO. You can change individual roles after they've joined.++<Tabs items={['Member', 'Manager', 'Admin']}>+ <Tab value="Member">Can view and sign documents shared with them.</Tab>+ <Tab value="Manager">Can manage documents and organisation settings.</Tab>+ <Tab value="Admin">Full access to organisation configuration.</Tab>+</Tabs>++### Allowed Email Domains++Restrict which email domains can authenticate through your SSO portal. Enter domains separated by spaces:++```+example.com subsidiary.example.com+```++Leave empty to allow any domain authenticated by your identity provider.++<Callout type="warn">+ Without domain restrictions, anyone who can authenticate with your identity provider can join your+ team.+</Callout>++## User Provisioning++When a user signs in through your SSO portal for the first time:++{/* prettier-ignore */}+<Steps>+<Step>+### Verify identity++Documenso verifies their identity with your provider.++</Step>+<Step>+### Create or link account++A new account is created, or linked if the email already exists.++</Step>+<Step>+### Add to organisation++The user is added to your organisation with the default role.++</Step>+<Step>+### Grant access++They can immediately access organisation documents.++</Step>+</Steps>++Users provisioned through SSO:++- Cannot change their email address+- Cannot set a Documenso password (they must use SSO)+- Are removed from SSO access if removed from your identity provider++## Signing In with SSO++Once SSO is enabled, your organisation's SSO portal URL is displayed at the top of the SSO settings page. Share this URL with your members so they can sign in through your identity provider.++<Callout type="info">+ SSO-only enforcement is not currently available. Users who have an existing Documenso account with a password can still sign in with their original method in addition to SSO.+</Callout>++## Troubleshooting++<Accordions type="multiple">+ {/* prettier-ignore */}+ <Accordion title="Invalid issuer URL">+ - Verify the URL is correct and publicly accessible++ - Ensure the URL points to an OpenID Connect discovery document++ - Check that the URL includes the full path (usually ending in `/.well-known/openid-configuration`)+ </Accordion>+ {/* prettier-ignore */}+ <Accordion title="Client authentication failed">+ - Verify the client ID and secret match your identity provider exactly++ - Check that the OIDC application hasn't been deleted or disabled.++ - Regenerate the client secret if you suspect it's incorrect.+</Accordion>+ {/* prettier-ignore */}+ <Accordion title="Redirect URI mismatch">+ - Copy the redirect URI exactly from Documenso's SSO settings++ - Check for trailing slashes. They must match exactly.++ - Ensure you're using HTTPS.+</Accordion>+ {/* prettier-ignore */}+ <Accordion title="User not provisioned">+ - Verify the user's email domain is in the allowed domains list++ - Check that the user exists in your identity provider++ - Ensure the user's account in your identity provider has an email address+</Accordion>+ {/* prettier-ignore */}+ <Accordion title="User already exists">+ If a user already has a Documenso account with the same email, their existing account will be linked to your team and they can sign in through your SSO portal going forward.+ </Accordion>+</Accordions>++## Testing Your SSO Portal++After configuring SSO, verify it works correctly:++{/* prettier-ignore */}+<Steps>+<Step>+### Open portal++Navigate to your portal URL (found at the top of the organisation SSO settings page).++</Step>+<Step>+### Sign in++Sign in with a test account from your configured domain.++</Step>+<Step>+### Verify provisioning++Verify the user is provisioned with the correct organisation role.++</Step>+</Steps>++### Custom Subdomain++To reduce friction for your users, create a custom subdomain that redirects to your SSO portal link. For example, `documenso.your-organisation.com` can redirect to the portal URL shown in your SSO settings.++---++## See Also++- [Manage Members](/docs/users/organisations/members) - Configure team member roles and permissions+- [Create a Team](/docs/users/organisations/create-team) - Set up additional teams in your organisationdiff --git a/apps/docs/content/docs/users/organisations/single-sign-on/index.mdx b/apps/docs/content/docs/users/organisations/single-sign-on/index.mdxnew file mode 100644index 000000000..4516924cd--- /dev/null+++ b/apps/docs/content/docs/users/organisations/single-sign-on/index.mdx@@ -0,0 +1,25 @@+---+title: Single Sign-On (SSO)+description: Configure Single Sign-On for your team using any OpenID Connect (OIDC) identity provider.+---++import { Callout } from 'fumadocs-ui/components/callout';++<Callout type="warn">SSO is only available on the Enterprise plan.</Callout>++Documenso supports any identity provider that implements the OpenID Connect (OIDC) protocol.++---++<Cards>+ <Card+ title="Configuration"+ description="Set up SSO for your organisation with any OIDC provider."+ href="/docs/users/organisations/single-sign-on/configuration"+ />+ <Card+ title="Microsoft Entra ID"+ description="Step-by-step guide for configuring Microsoft Entra ID (Azure AD)."+ href="/docs/users/organisations/single-sign-on/microsoft-entra-id"+ />+</Cards>diff --git a/apps/docs/content/docs/users/organisations/single-sign-on/meta.json b/apps/docs/content/docs/users/organisations/single-sign-on/meta.jsonnew file mode 100644index 000000000..1e0405403--- /dev/null+++ b/apps/docs/content/docs/users/organisations/single-sign-on/meta.json@@ -0,0 +1,4 @@+{+ "title": "Single Sign-On",+ "pages": ["...index", "configuration", "microsoft-entra-id"]+}diff --git a/apps/docs/content/docs/users/organisations/single-sign-on/microsoft-entra-id.mdx b/apps/docs/content/docs/users/organisations/single-sign-on/microsoft-entra-id.mdxnew file mode 100644index 000000000..469efa427--- /dev/null+++ b/apps/docs/content/docs/users/organisations/single-sign-on/microsoft-entra-id.mdx@@ -0,0 +1,125 @@+---+title: Microsoft Entra ID+description: Learn how to configure Microsoft Entra ID (Azure AD) for your organisation's SSO portal.+---++import { Callout } from 'fumadocs-ui/components/callout';+import { Step, Steps } from 'fumadocs-ui/components/steps';++<Callout type="warn">SSO is only available on the Enterprise plan.</Callout>++## Overview++Microsoft Entra ID (formerly Azure Active Directory) is a popular identity provider for enterprise SSO. This guide will walk you through creating an app registration and configuring it for use with your Documenso SSO portal.++## Prerequisites++- Access to Microsoft Entra ID (Azure AD) admin center+- Access to your Documenso organisation as an administrator or manager++<Callout type="warn">Each user in your Azure AD will need an email associated with it.</Callout>++## Creating an App Registration++{/* prettier-ignore */}+<Steps>+<Step>+### Access Azure portal++- Navigate to the Azure Portal+- Sign in with your Microsoft Entra ID administrator account+- Search for "Azure Active Directory" or "Microsoft Entra ID" in the search bar+- Click on "Microsoft Entra ID" from the results++</Step>++<Step>+### Create app registration++- In the left sidebar, click on "App registrations"+- Click the "New registration" button++</Step>++<Step>+### Configure app registration++Fill in the registration form with the following details:++- **Name**: Your preferred name (e.g. `Documenso SSO Portal`)+- **Supported account types**: Choose based on your needs+- **Redirect URI (Web)**: Found in the Documenso SSO portal settings page++Click "Register" to create the app registration.++</Step>++<Step>+### Get client ID++After registration, you'll be taken to the app's overview page. The **Application (client) ID** is displayed prominently - this is your Client ID for Documenso.++</Step>++<Step>+### Create client secret++- In the left sidebar, click on "Certificates & secrets"+- Click "New client secret"+- Add a description (e.g., "Documenso SSO Secret")+- Choose an expiration period (recommended 12-24 months)+- Click "Add"++<Callout type="info">+ Copy the **Secret value**, not the **Secret ID**. You won't be able to access it again after you+ leave the page.+</Callout>++</Step>+</Steps>++## Getting Your OpenID Configuration URL++{/* prettier-ignore */}+<Steps>+<Step>+### Open Microsoft Entra ID++In the Azure portal, go to **Microsoft Entra ID**.++</Step>+<Step>+### Go to overview++Click **Overview** in the left sidebar.++</Step>+<Step>+### Open endpoints++Click **Endpoints** in the horizontal tab.++</Step>+<Step>+### Copy the URL++Copy the **OpenID Connect metadata document** value.++</Step>+</Steps>++## Configure Documenso SSO Portal++Now you have all the information needed to configure your Documenso SSO portal:++| Field | Value |+| ----------------- | ------------------------------------------------------------------- |+| **Issuer URL** | The "OpenID Connect metadata document" value from the previous step |+| **Client ID** | The Application (client) ID from your app registration |+| **Client Secret** | The secret value you copied during creation |++## See Also++- [Single Sign-On](/docs/users/organisations/single-sign-on) - General SSO configuration guide+- [OAuth Providers (Self-Hosting)](/docs/self-hosting/configuration/advanced/oauth-providers) - Configure OAuth for self-hosted instances+- [Security Settings](/docs/users/settings/security) - Manage account security optionsdiff --git a/apps/docs/content/docs/users/settings/api-tokens.mdx b/apps/docs/content/docs/users/settings/api-tokens.mdxnew file mode 100644index 000000000..c58886875--- /dev/null+++ b/apps/docs/content/docs/users/settings/api-tokens.mdx@@ -0,0 +1,26 @@+---+title: API Tokens+description: Create and manage API tokens for programmatic access to your Documenso account.+---++import { Callout } from 'fumadocs-ui/components/callout';++## Overview++API tokens allow external applications to access your Documenso account programmatically. Tokens can be scoped to your personal account or to a specific team.++For detailed instructions on creating and managing API tokens, see the [Authentication](/docs/developers/getting-started/authentication) guide in the developer documentation.++## Best Practices++- **Use separate tokens per integration** — if one is compromised, revoke only that token+- **Set expiration dates** — shorter lifespans reduce risk if a token is leaked+- **Use the minimum required scope** — only grant access to what the integration needs++---++## See Also++- [Authentication](/docs/developers/getting-started/authentication) - API authentication guide+- [Security Settings](/docs/users/settings/security) - Manage passwords, 2FA, and passkeys+- [Sessions & Activity](/docs/users/settings/sessions) - Monitor account activitydiff --git a/apps/docs/content/docs/users/settings/delete-account.mdx b/apps/docs/content/docs/users/settings/delete-account.mdxnew file mode 100644index 000000000..569dc1bc2--- /dev/null+++ b/apps/docs/content/docs/users/settings/delete-account.mdx@@ -0,0 +1,44 @@+---+title: Delete Account+description: Permanently delete your Documenso account and all associated data.+---++import { Callout } from 'fumadocs-ui/components/callout';+import { Step, Steps } from 'fumadocs-ui/components/steps';++<Callout type="error">+ Account deletion is permanent and irreversible. All documents, signatures, templates, and account+ data will be permanently removed. Any active subscription will be cancelled.+</Callout>++## Before Deleting++- Download any documents you need to keep+- Cancel any active subscriptions+- Disable two-factor authentication (required before deletion)++## Delete Your Account++{/* prettier-ignore */}+<Steps>+ <Step>+ Go to **Settings** > **Profile** and scroll to the **Delete Account** section.+ </Step>+ <Step>+ Click **Delete Account**.+ </Step>+ <Step>+ Type your email address to confirm and click **Confirm Deletion**.+ </Step>+</Steps>++<Callout type="info">+ If you have two-factor authentication enabled, you must disable it before deleting your account.+</Callout>++---++## See Also++- [Profile Settings](/docs/users/settings/profile) - Manage your profile and signature+- [Security Settings](/docs/users/settings/security) - Manage 2FA and passkeysdiff --git a/apps/docs/content/docs/users/settings/index.mdx b/apps/docs/content/docs/users/settings/index.mdxnew file mode 100644index 000000000..25c22fa81--- /dev/null+++ b/apps/docs/content/docs/users/settings/index.mdx@@ -0,0 +1,43 @@+---+title: Settings+description: Manage your personal account settings, security, and profile.+---++<Cards>+ <Card+ title="Profile"+ description="Update your name, email, and signature."+ href="/docs/users/settings/profile"+ />+ <Card+ title="Public Profile"+ description="Share your profile and link templates."+ href="/docs/users/settings/public-profile"+ />+ <Card+ title="Security"+ description="Passwords, two-factor authentication, and passkeys."+ href="/docs/users/settings/security"+ />+ <Card+ title="Sessions & Activity"+ description="View active sessions and monitor account activity."+ href="/docs/users/settings/sessions"+ />+ <Card+ title="API Tokens"+ description="Manage tokens for programmatic access."+ href="/docs/users/settings/api-tokens"+ />+ <Card+ title="Delete Account"+ description="Permanently delete your account and data."+ href="/docs/users/settings/delete-account"+ />+</Cards>++---++## See Also++- [Organisations](/docs/users/organisations) - Manage your organisation, branding, and email domainsdiff --git a/apps/docs/content/docs/users/settings/meta.json b/apps/docs/content/docs/users/settings/meta.jsonnew file mode 100644index 000000000..859fb1dd8--- /dev/null+++ b/apps/docs/content/docs/users/settings/meta.json@@ -0,0 +1,4 @@+{+ "title": "Settings",+ "pages": ["profile", "public-profile", "security", "sessions", "api-tokens", "delete-account"]+}diff --git a/apps/docs/content/docs/users/settings/profile.mdx b/apps/docs/content/docs/users/settings/profile.mdxnew file mode 100644index 000000000..a0a17a004--- /dev/null+++ b/apps/docs/content/docs/users/settings/profile.mdx@@ -0,0 +1,78 @@+---+title: Profile+description: Manage your profile information and signature.+---++import { Callout } from 'fumadocs-ui/components/callout';+import { Step, Steps } from 'fumadocs-ui/components/steps';++## Avatar++Your avatar appears on documents you send and in your public profile.++{/* prettier-ignore */}+<Steps>+ <Step>+ Go to **Settings** > **Profile**.+ </Step>+ <Step>+ Click **Upload Avatar** next to your current avatar and select an image (PNG or JPG, max 1MB).+ </Step>+</Steps>++To remove your avatar, hover over the image and click **Remove**.++## Name++Your name appears on documents and email notifications sent to recipients.++{/* prettier-ignore */}+<Steps>+ <Step>+ Go to **Settings** > **Profile**.+ </Step>+ <Step>+ Update the **Full Name** field and click **Update profile**.+ </Step>+</Steps>+++Your email address is shown as read-only on the profile page. To change your email address, contact support.++## Signature++Your signature is used as the default when you sign documents. You can create your signature using three methods:++{/* prettier-ignore */}+<Steps>+ <Step>+ Go to **Settings** > **Profile** and click on the **Signature** field to open the signature editor.+ </Step>+ <Step>+ Choose one of three methods:++ | Method | Description |+ | ---------- | ---------------------------------------------------------- |+ | **Draw** | Use your mouse or touchscreen to draw your signature |+ | **Type** | Enter your name and select from generated signature styles |+ | **Upload** | Upload an image of your signature |++ </Step>+ <Step>+ Click **Next** to confirm your signature, then click **Update profile** to save.+ </Step>+</Steps>++<Callout type="info">+ When signing documents, you can create a different signature for that specific document without+ changing your default signature.+</Callout>++---++## See Also++- [Public Profile](/docs/users/settings/public-profile) - Share your profile and link templates+- [Security Settings](/docs/users/settings/security) - Manage passwords, 2FA, and passkeys+- [Delete Account](/docs/users/settings/delete-account) - Permanently delete your accountdiff --git a/apps/docs/content/docs/users/settings/public-profile.mdx b/apps/docs/content/docs/users/settings/public-profile.mdxnew file mode 100644index 000000000..4c9952d83--- /dev/null+++ b/apps/docs/content/docs/users/settings/public-profile.mdx@@ -0,0 +1,67 @@+---+title: Public Profile+description: Configure your public profile and link templates for others to discover.+---++import { Callout } from 'fumadocs-ui/components/callout';+import { Step, Steps } from 'fumadocs-ui/components/steps';++Your public profile allows others to view your information and access templates you share publicly. Your profile is accessible at:++```+https://app.documenso.com/p/<your-username>+```++++## Configure Your Public Profile++{/* prettier-ignore */}+<Steps>+ <Step>+ Go to **Settings** > **Public Profile**.+ </Step>+ <Step>+ Toggle **Show/Hide** to control profile visibility.+ </Step>+ <Step>+ Set your **Public profile URL** (personal accounts only) and add a **Bio** if desired.+ </Step>+ <Step>+ Click **Update** to save.+ </Step>+</Steps>++++## Link Templates to Your Public Profile++Display templates on your public profile so visitors can sign documents directly:++{/* prettier-ignore */}+<Steps>+ <Step>+ Go to **Settings** > **Public Profile**.+ </Step>+ <Step>+ Click **Link template** in the Templates section and select templates that have direct links+ enabled.+ </Step>+ <Step>+ Linked templates will appear on your public profile page.+ </Step>+</Steps>++<Callout type="info">+ Only templates with direct links enabled can be added to your public profile. See [Direct+ Links](/docs/users/documents/direct-links) to learn more.+</Callout>++<Callout type="info">A free Documenso account gives you 5 free signatures per month.</Callout>++---++## See Also++- [Profile Settings](/docs/users/settings/profile) - Update your name, email, and signature+- [Direct Links](/docs/users/documents/direct-links) - Share signing links without email invitationsdiff --git a/apps/docs/content/docs/users/settings/security.mdx b/apps/docs/content/docs/users/settings/security.mdxnew file mode 100644index 000000000..f84b072b1--- /dev/null+++ b/apps/docs/content/docs/users/settings/security.mdx@@ -0,0 +1,166 @@+---+title: Security+description: Manage your password, enable two-factor authentication (2FA), and configure passkeys.+---++import { Callout } from 'fumadocs-ui/components/callout';+import { Step, Steps } from 'fumadocs-ui/components/steps';++## Change Your Password++If you signed up with email and password (not Google or another provider), you can change your password at any time.++{/* prettier-ignore */}+<Steps>+ <Step>+ Click your avatar in the top right corner.+ </Step>+ <Step>+ Go to **Settings**.+ </Step>+ <Step>+ Open the **Security** tab.+ </Step>+ <Step>+ Enter your current password, new password, and confirmation, then click **Update password**.+ </Step>+</Steps>++<Callout type="info">+ The password change form only appears if you have a password-based account. If you signed up with+ Google or another provider, you won't see this option.+</Callout>++## Two-Factor Authentication (2FA)++Two-factor authentication (2FA) and passkeys are used for high-security and high-compliance signatures in addition to account login.++Two-factor authentication adds a second layer of security by requiring a code from an authenticator app when you sign in or sign documents.++++### Enable 2FA++{/* prettier-ignore */}+<Steps>+ <Step>+ ### Open 2FA setup++ Go to **Settings**, open the **Security** tab, find the Two factor authentication section, and click **Enable 2FA**.++ </Step>+ <Step>+ ### Scan the QR code++ Open your authenticator app (Google Authenticator, Authy, 1Password, etc.) and scan the QR code. If you can't scan, reveal the setup key and enter it manually.++ </Step>+ <Step>+ ### Verify and save++ Enter the 6-digit code from your app, click **Enable**, then save your recovery codes (see [Recovery Codes](#recovery-codes) below).++ </Step>+</Steps>++<Callout type="info">+ Logging in with Google does not require a 2FA code. As an authentication provider, your Google+ account is considered secure (e.g. you can configure 2FA on your Google account separately).+</Callout>++<Callout type="info">+ Logging in with a passkey does not require a 2FA code. Passkeys are considered two-factor by+ design — the passkey itself is the first factor, and access to the device that holds it is the+ second factor.+</Callout>++### Disable 2FA++{/* prettier-ignore */}+<Steps>+ <Step>+ Go to **Settings**.+ </Step>+ <Step>+ Open the **Security** tab.+ </Step>+ <Step>+ Click **Disable 2FA**, enter a code from your authenticator app, then click **Disable**.+ </Step>+</Steps>++## Recovery Codes++Recovery codes let you access your account if you lose access to your authenticator app. When you enable 2FA, Documenso generates a set of backup codes.++### View Recovery Codes++{/* prettier-ignore */}+<Steps>+ <Step>+ Go to **Settings**, open the **Security** tab.+ </Step>+ <Step>+ Click **View Codes** in the Recovery codes section.+ </Step>+ <Step>+ Enter a code from your authenticator app to view your recovery codes.+ </Step>+</Steps>++### Store Recovery Codes Safely++- Click **Download** to save them as a text file+- Store them in a secure location (password manager, safe, etc.)+- Each code can only be used once++<Callout type="warn">+ If you lose both your authenticator app and your recovery codes, you will be locked out of your+ account. Store your recovery codes securely.+</Callout>++## Passkeys++Passkeys provide passwordless authentication using biometrics, hardware security keys, or password managers. You can use passkeys to sign in to Documenso and to authenticate when signing documents.++++### Add a Passkey++{/* prettier-ignore */}+<Steps>+ <Step>+ ### Open passkeys++ Go to **Settings**, open the **Security** tab, then click **Manage passkeys**.++ </Step>+ <Step>+ ### Add and name your passkey++ Click **Add passkey**, enter a name (e.g. "MacBook Touch ID", "YubiKey"), then follow your browser's prompts to complete registration.++ </Step>+</Steps>++++### Manage Passkeys++From the passkeys page, you can:++- **Rename** a passkey by clicking the edit button+- **Delete** a passkey by clicking the delete button++<Callout type="info">+ Passkeys are device-specific. If you use multiple devices, add a passkey on each one.+</Callout>++---++## See Also++- [Sessions & Activity](/docs/users/settings/sessions) - View active sessions and security activity+- [API Tokens](/docs/users/settings/api-tokens) - Manage programmatic access tokens+- [Profile](/docs/users/settings/profile) - Update your name, email, and signature+- [Delete Account](/docs/users/settings/delete-account) - Permanently delete your accountdiff --git a/apps/docs/content/docs/users/settings/sessions.mdx b/apps/docs/content/docs/users/settings/sessions.mdxnew file mode 100644index 000000000..15a9c31c2--- /dev/null+++ b/apps/docs/content/docs/users/settings/sessions.mdx@@ -0,0 +1,82 @@+---+title: Sessions & Activity+description: View active sessions, monitor security activity, and manage linked accounts.+---++import { Callout } from 'fumadocs-ui/components/callout';+import { Step, Steps } from 'fumadocs-ui/components/steps';+import { Tab, Tabs } from 'fumadocs-ui/components/tabs';++## Active Sessions++View and manage all devices currently logged into your account.++### View Sessions++Go to **Settings**, open the **Security** tab, then click **Manage sessions**.++The sessions table shows:++| Column | Description |+| ----------- | ------------------------------ |+| Device | Browser and operating system |+| IP Address | The IP address of the session |+| Last Active | When the session was last used |+| Created | When the session started |++Your current session is marked with a "Current" badge.++### Revoke a Session++<Tabs items={['Revoke one session', 'Log out all']}>+<Tab value="Revoke one session">++Find the session in the list and click **Revoke**.++</Tab>+<Tab value="Log out all">++Click **Log out all** at the top of the page and confirm. Your current session stays active; all others are terminated.++</Tab>+</Tabs>++## Security Activity++Monitor recent security-related events on your account. Go to **Settings**, open the **Security** tab, then click **View activity**.++The activity log shows events such as:++| Event | Description |+| ---------------- | ------------------------------------- |+| Sign-in attempts | Login attempts to your account |+| Password changes | When your password was changed |+| 2FA changes | When 2FA was enabled or disabled |+| Session changes | When sessions were created or revoked |++## Linked Accounts++View and manage login methods connected to your account (Google, email/password, etc.). Go to **Settings**, open the **Security** tab, and click **Manage linked accounts**.++To remove a login method:++{/* prettier-ignore */}+<Steps>+ <Step>+ Find the provider in the list under **Manage linked accounts**.+ </Step>+ <Step>+ Click **Unlink** and confirm.+ </Step>+</Steps>++<Callout type="warn">+ Ensure you have at least one login method available before unlinking an account.+</Callout>++---++## See Also++- [Security Settings](/docs/users/settings/security) - Manage passwords, 2FA, and passkeys+- [API Tokens](/docs/users/settings/api-tokens) - Manage programmatic access tokensdiff --git a/apps/docs/content/docs/users/templates/create.mdx b/apps/docs/content/docs/users/templates/create.mdxnew file mode 100644index 000000000..d5b98f2a6--- /dev/null+++ b/apps/docs/content/docs/users/templates/create.mdx@@ -0,0 +1,215 @@+---+title: Create Templates+description: Build reusable document templates for contracts, agreements, and other documents you send frequently.+---++import { Callout } from 'fumadocs-ui/components/callout';+import { Step, Steps } from 'fumadocs-ui/components/steps';++## Overview++Templates are reusable document configurations that save you from recreating the same setup every time you send a similar document. A template stores your PDF, recipient roles, field placements, and settings so you can generate new documents with a few clicks.++Use templates when you:++- Send the same type of document regularly (contracts, NDAs, onboarding forms)+- Need consistent field placement across documents+- Want to pre-configure recipients and signing workflows+- Plan to use [direct links](/docs/users/documents/direct-links) for public signing++## Create a Template from Scratch++{/* prettier-ignore */}+<Steps>+<Step>+### Go to templates++Navigate to **Templates** in the sidebar and click **Upload Template**.++++</Step>++<Step>+### Upload your document++Select one or more PDF files to upload. If you select multiple files, they're combined into a single template.++After uploading, you'll enter the template editor where you can configure recipients, fields, and settings.++++</Step>++<Step>+### Add recipients++Add the people who will interact with documents created from this template. For each recipient, specify:++- **Email**: Use a real email if the recipient is always the same person, or a placeholder email (like `[email protected]`) if it changes each time+- **Name**: Optional, but helps identify recipients+- **Role**: What the recipient needs to do (Signer, Approver, Viewer, CC)++++</Step>++<Step>+### Add fields++Drag fields from the field palette onto your document and assign them to recipients. At minimum, each signer needs one signature field.++See [Add Fields](/docs/users/documents/add-fields) for detailed guidance on field types and configuration.++</Step>++<Step>+### Save the template++Click **Save Template** to finish. Your template appears in the Templates list, ready to use.++</Step>+</Steps>++---++## Placeholder Recipients++Templates often need placeholder recipients - people whose actual email addresses you won't know until you use the template. For example, a sales contract template might have:++- **You** (your real email) - Always signs as the company representative+- **Client** (placeholder) - Different person for each contract++### Setting up placeholders++Use any email format that's clearly a placeholder:++- `[email protected]`+- `[email protected]`+- `[email protected]`++When you [use the template](/docs/users/templates/use), you'll replace these placeholders with actual recipient emails.++### When to use real emails++Use real email addresses when the recipient is always the same person:++- Your own email for documents you always sign+- A team member who reviews all contracts+- A compliance officer who needs to approve every agreement++---++## Template Settings++Click the settings icon in the template editor to configure these options:++### Title++The template name shown in your Templates list. Use a descriptive name like "Standard NDA" or "Freelance Contract - Hourly" so you can find it quickly.++The title also becomes the default document name when you create documents from the template. Recipients see this name in their signing invitation.++### External ID++An optional identifier for integrating with external systems. Use this to:++- Match templates to records in your CRM or contract management system+- Track which template generated a document in your analytics+- Reference templates in API calls++The external ID has no effect on document signing - it's purely for your reference.++### Global settings++Additional options that apply to all documents created from this template:++| Setting | Description |+| ------------ | ---------------------------------------------------------------- |+| Date format | How dates appear in Date fields (e.g., MM/DD/YYYY or DD/MM/YYYY) |+| Time zone | Time zone used for date calculations |+| Redirect URL | Where to send recipients after they finish signing |+| Language | Language for the signing interface and emails |++---++## Template Visibility++All templates are created in a team context. Team members can see, edit, delete, and use the templates in that team. See [Organisations](/docs/users/organisations) to learn about creating and managing organisations.++---++## Edit a Template++To modify an existing template:++{/* prettier-ignore */}+<Steps>+ <Step>+ Go to **Templates** and find the template you want to edit.+ </Step>+ <Step>+ Click on the template to open it in the editor.+ </Step>+ <Step>+ Make your changes to recipients, fields, or settings.+ </Step>+ <Step>+ Click **Save Template**.+ </Step>+</Steps>++Changes only affect future documents created from the template. Documents already created from this template are not updated.++---++## Duplicate a Template++To create a copy of an existing template:++{/* prettier-ignore */}+<Steps>+ <Step>+ Go to **Templates** and find the template.+ </Step>+ <Step>+ Click the three-dot menu and select **Duplicate**.+ </Step>+ <Step>+ The copy opens in the editor; make any changes and save with a new name.+ </Step>+</Steps>++This is useful when you need a variation of an existing template without modifying the original.++---++## Delete a Template++To delete a template:++{/* prettier-ignore */}+<Steps>+ <Step>+ Go to **Templates** and find the template.+ </Step>+ <Step>+ Click the three-dot menu and select **Delete**.+ </Step>+ <Step>+ Confirm the deletion.+ </Step>+</Steps>++<Callout type="warn">+ Deleting a template is permanent. Documents already created from the template are not affected,+ but you won't be able to create new documents from it.+</Callout>++---++## See Also++- [Use a Template](/docs/users/templates/use) - Create documents from your template+- [Direct Links](/docs/users/documents/direct-links) - Share a signing link without knowing recipient emails+- [API: Templates](/docs/developers/api/templates) - Create and use templates programmaticallydiff --git a/apps/docs/content/docs/users/templates/index.mdx b/apps/docs/content/docs/users/templates/index.mdxnew file mode 100644index 000000000..61b1ba089--- /dev/null+++ b/apps/docs/content/docs/users/templates/index.mdx@@ -0,0 +1,34 @@+---+title: Templates+description: Create reusable document templates for common signing workflows.+---++## Why Use Templates?++- **Save time**: Don't recreate the same document structure repeatedly+- **Consistency**: Ensure fields are placed correctly every time+- **Efficiency**: Pre-configure recipients and settings++---++## Template Workflow++<Cards>+ <Card+ title="Create a Template"+ description="Build a reusable template from a document."+ href="/docs/users/templates/create"+ />+ <Card+ title="Use a Template"+ description="Create documents from your templates."+ href="/docs/users/templates/use"+ />+</Cards>++---++## See Also++- [Documents](/docs/users/documents) - Sending individual documents+- [API Templates](/docs/developers/api/templates) - Create templates via APIdiff --git a/apps/docs/content/docs/users/templates/meta.json b/apps/docs/content/docs/users/templates/meta.jsonnew file mode 100644index 000000000..23bec564d--- /dev/null+++ b/apps/docs/content/docs/users/templates/meta.json@@ -0,0 +1,4 @@+{+ "title": "Templates",+ "pages": ["create", "use"]+}diff --git a/apps/docs/content/docs/users/templates/use.mdx b/apps/docs/content/docs/users/templates/use.mdxnew file mode 100644index 000000000..2405f3593--- /dev/null+++ b/apps/docs/content/docs/users/templates/use.mdx@@ -0,0 +1,147 @@+---+title: Use Templates+description: Create documents from your templates by filling in recipient details and optionally sending immediately.+---++import { Callout } from 'fumadocs-ui/components/callout';+import { Step, Steps } from 'fumadocs-ui/components/steps';+import { Tab, Tabs } from 'fumadocs-ui/components/tabs';++## Create a Document from a Template++{/* prettier-ignore */}+<Steps>+<Step>+### Open the template++Navigate to **Templates** in the sidebar and find the template you want to use. Click on the template to open its detail page, or click the three-dot menu and select **Use Template**.++++</Step>++<Step>+### Click use template++From the template detail page, click the **Use Template** button. A dialog opens where you configure the document.++++</Step>++<Step>+### Fill in recipient details++For each recipient defined in the template, enter their:++- **Email** (required): The recipient's email address+- **Name** (optional): The recipient's display name++If the template has pre-filled recipient information, those fields appear with the existing values. You can modify them or leave them as-is.++</Step>++<Step>+### Choose how to create the document++<Tabs items={['Create as draft', 'Create and send']}>+<Tab value="Create as draft">++Creates the document without sending. You can review and edit it before sending. Leave the **Send document** checkbox unchecked.++</Tab>+<Tab value="Create and send">++Creates the document and immediately sends it to recipients. Check the **Send document** checkbox to send immediately.++</Tab>+</Tabs>++</Step>++<Step>+### New document++Click **Create as draft** or **Create and send** depending on what you want to do. You are then redirected to the new document.++</Step>+</Steps>++## Upload a Custom Document++You can replace the template's PDF with a different document when creating from a template. This keeps all the field positions and recipient settings but uses your uploaded file.++{/* prettier-ignore */}+<Steps>+ <Step>+ In the Use Template dialog, check **Upload custom document**.+ </Step>+ <Step>+ Click **Upload** next to each document you want to replace and select a PDF from your computer.+ </Step>+ <Step>+ Complete the rest of the form and create the document.+ </Step>+</Steps>++<Callout type="info">+ The uploaded document must be a PDF. Field positions are preserved from the template, so the new+ document should have a similar layout.+</Callout>++## Sequential Signing++If the template uses sequential signing, recipients receive the document in order. The signing order displays next to each recipient in the dialog and cannot be changed when using the template.++To modify the signing order, edit the template itself before creating documents from it.++## Distribution Methods++How recipients receive the document depends on the template's distribution method:++| Distribution method | What happens |+| ------------------- | ----------------------------------------------------------- |+| **Email** | Recipients receive an email with a link to sign |+| **None** | No emails sent. You receive signing links to share manually |++When using a template with no email distribution and selecting **Create as pending**, you're redirected to the document page where signing links are displayed for you to copy and share.++## Template vs Document Differences++When you create a document from a template, the document becomes independent. Changes you make to the document don't affect the template, and changes to the template don't affect existing documents.++| What you can change | Template | Document created from template |+| ------------------- | -------- | -------------------------------- |+| Recipients | Yes | Yes (before sending) |+| Fields | Yes | Yes (before sending) |+| PDF content | Yes | Only at creation (custom upload) |+| Settings | Yes | Yes (before sending) |++Documents created from a template are tracked on the template's detail page under **Documents created from template**.++## Bulk Send++To create multiple documents from one template with different recipients, use bulk send:++{/* prettier-ignore */}+<Steps>+ <Step>+ Go to the template detail page or templates list.+ </Step>+ <Step>+ Click the three-dot menu and select **Bulk send**.+ </Step>+ <Step>+ Upload a CSV file with recipient information. Each row creates a separate document.+ </Step>+</Steps>++This is useful for sending the same document to many people, such as offer letters or agreements.++---++## See Also++- [Create a Template](/docs/users/templates/create) - Build reusable templates from your documents+- [Direct Links](/docs/users/documents/direct-links) - Let recipients sign without knowing their email upfront+- [Send Documents](/docs/users/documents/send) - Sending options and email customizationdiff --git a/apps/docs/next.config.mjs b/apps/docs/next.config.mjsnew file mode 100644index 000000000..73242d16c--- /dev/null+++ b/apps/docs/next.config.mjs@@ -0,0 +1,462 @@+import { createMDX } from 'fumadocs-mdx/next';++const withMDX = createMDX();++/** @type {import('next').NextConfig} */+const config = {+ reactStrictMode: true,+ async rewrites() {+ return [+ {+ source: '/docs/:path*.mdx',+ destination: '/llms.mdx/docs/:path*',+ },+ ];+ },+ async redirects() {+ return [+ // ============================================================+ // Legacy docs site redirects (old site had no /docs prefix)+ // ============================================================++ // Root+ { source: '/users', destination: '/docs/users', permanent: true },+ { source: '/developers', destination: '/docs/developers', permanent: true },++ // --- Users: Getting Started ---+ {+ source: '/users/get-started/account-creation',+ destination: '/docs/users/getting-started/create-account',+ permanent: true,+ },+ {+ source: '/users/get-started/account-security',+ destination: '/docs/users/settings/security',+ permanent: true,+ },++ // --- Users: Profile & Settings ---+ { source: '/users/profile', destination: '/docs/users/settings/profile', permanent: true },+ { source: '/users/support', destination: '/docs/policies/support', permanent: true },++ // --- Users: Organisations ---+ { source: '/users/organisations', destination: '/docs/users/organisations', permanent: true },+ {+ source: '/users/organisations/members',+ destination: '/docs/users/organisations/members',+ permanent: true,+ },+ {+ source: '/users/organisations/groups',+ destination: '/docs/users/organisations/groups',+ permanent: true,+ },+ {+ source: '/users/organisations/teams',+ destination: '/docs/users/organisations/overview',+ permanent: true,+ },+ {+ source: '/users/organisations/billing',+ destination: '/docs/users/organisations/billing',+ permanent: true,+ },+ {+ source: '/users/organisations/sso',+ destination: '/docs/users/organisations/single-sign-on',+ permanent: true,+ },+ {+ source: '/users/organisations/sso/microsoft-entra-id',+ destination: '/docs/users/organisations/single-sign-on/microsoft-entra-id',+ permanent: true,+ },++ // --- Users: Documents ---+ {+ source: '/users/documents/sending-documents',+ destination: '/docs/users/documents',+ permanent: true,+ },+ {+ source: '/users/documents/document-preferences',+ destination: '/docs/users/organisations/preferences/document',+ permanent: true,+ },+ {+ source: '/users/documents/document-visibility',+ destination: '/docs/users/documents/advanced/document-visibility',+ permanent: true,+ },+ {+ source: '/users/documents/fields',+ destination: '/docs/users/documents/add-fields',+ permanent: true,+ },+ {+ source: '/users/documents/pdf-placeholders',+ destination: '/docs/users/documents/advanced/pdf-placeholders',+ permanent: true,+ },+ {+ source: '/users/documents/email-preferences',+ destination: '/docs/users/organisations/preferences/email',+ permanent: true,+ },+ {+ source: '/users/documents/ai-detection',+ destination: '/docs/users/documents/advanced/ai-detection',+ permanent: true,+ },+ {+ source: '/users/documents/default-recipients',+ destination: '/docs/users/documents/advanced/default-recipients',+ permanent: true,+ },++ // --- Users: Templates, Branding, etc. ---+ { source: '/users/templates', destination: '/docs/users/templates', permanent: true },+ {+ source: '/users/branding',+ destination: '/docs/users/organisations/preferences/branding',+ permanent: true,+ },+ {+ source: '/users/email-domains',+ destination: '/docs/users/organisations/email-domains',+ permanent: true,+ },+ {+ source: '/users/direct-links',+ destination: '/docs/users/documents/direct-links',+ permanent: true,+ },+ { source: '/users/fair-use', destination: '/docs/policies/fair-use', permanent: true },++ // --- Users: Licenses ---+ { source: '/users/licenses', destination: '/docs/policies/licenses', permanent: true },+ {+ source: '/users/licenses/community-edition',+ destination: '/docs/policies/community-edition',+ permanent: true,+ },+ {+ source: '/users/licenses/enterprise-edition',+ destination: '/docs/policies/enterprise-edition',+ permanent: true,+ },++ // --- Users: Compliance ---+ {+ source: '/users/compliance/signature-levels',+ destination: '/docs/compliance/signature-levels',+ permanent: true,+ },+ {+ source: '/users/compliance/standards-and-regulations',+ destination: '/docs/compliance/standards',+ permanent: true,+ },++ // --- Developers: Local Development ---+ {+ source: '/developers/local-development',+ destination: '/docs/developers/local-development',+ permanent: true,+ },+ {+ source: '/developers/local-development/quickstart',+ destination: '/docs/developers/local-development/quickstart',+ permanent: true,+ },+ {+ source: '/developers/local-development/manual',+ destination: '/docs/developers/local-development/manual',+ permanent: true,+ },+ {+ source: '/developers/local-development/gitpod',+ destination: '/docs/developers/local-development/gitpod',+ permanent: true,+ },+ {+ source: '/developers/local-development/signing-certificate',+ destination: '/docs/developers/local-development/signing-certificate',+ permanent: true,+ },+ {+ source: '/developers/local-development/translations',+ destination: '/docs/developers/local-development/translations',+ permanent: true,+ },++ // --- Developers: Self-Hosting (moved to top-level section) ---+ { source: '/developers/self-hosting', destination: '/docs/self-hosting', permanent: true },+ {+ source: '/developers/self-hosting/signing-certificate',+ destination: '/docs/self-hosting/configuration/signing-certificate',+ permanent: true,+ },+ {+ source: '/developers/self-hosting/how-to',+ destination: '/docs/self-hosting/getting-started/quick-start',+ permanent: true,+ },+ {+ source: '/developers/self-hosting/setting-up-oauth-providers',+ destination: '/docs/self-hosting/configuration/advanced/oauth-providers',+ permanent: true,+ },+ {+ source: '/developers/self-hosting/telemetry',+ destination: '/docs/self-hosting/configuration/telemetry',+ permanent: true,+ },+ {+ source: '/developers/self-hosting/ai-features',+ destination: '/docs/self-hosting/configuration/advanced/ai-features',+ permanent: true,+ },++ // --- Developers: Contributing ---+ {+ source: '/developers/contributing',+ destination: '/docs/developers/contributing',+ permanent: true,+ },+ {+ source: '/developers/contributing/contributing-translations',+ destination: '/docs/developers/contributing/contributing-translations',+ permanent: true,+ },++ // --- Developers: Public API (restructured) ---+ { source: '/developers/public-api', destination: '/docs/developers/api', permanent: true },+ {+ source: '/developers/public-api/authentication',+ destination: '/docs/developers/getting-started/authentication',+ permanent: true,+ },+ {+ source: '/developers/public-api/rate-limits',+ destination: '/docs/developers/api/rate-limits',+ permanent: true,+ },+ {+ source: '/developers/public-api/versioning',+ destination: '/docs/developers/api/versioning',+ permanent: true,+ },+ {+ source: '/developers/public-api/reference',+ destination: '/docs/developers/api',+ permanent: true,+ },++ // --- Developers: Embedding ---+ {+ source: '/developers/embedding',+ destination: '/docs/developers/embedding',+ permanent: true,+ },+ {+ source: '/developers/embedding/react',+ destination: '/docs/developers/embedding/sdks/react',+ permanent: true,+ },+ {+ source: '/developers/embedding/vue',+ destination: '/docs/developers/embedding/sdks/vue',+ permanent: true,+ },+ {+ source: '/developers/embedding/svelte',+ destination: '/docs/developers/embedding/sdks/svelte',+ permanent: true,+ },+ {+ source: '/developers/embedding/solid',+ destination: '/docs/developers/embedding/sdks/solid',+ permanent: true,+ },+ {+ source: '/developers/embedding/preact',+ destination: '/docs/developers/embedding/sdks/preact',+ permanent: true,+ },+ {+ source: '/developers/embedding/angular',+ destination: '/docs/developers/embedding/sdks/angular',+ permanent: true,+ },+ {+ source: '/developers/embedding/css-variables',+ destination: '/docs/developers/embedding/css-variables',+ permanent: true,+ },+ {+ source: '/developers/embedding/authoring',+ destination: '/docs/developers/embedding/authoring',+ permanent: true,+ },+ {+ source: '/developers/embedded-authoring',+ destination: '/docs/developers/embedding/authoring',+ permanent: true,+ },++ // --- Developers: Webhooks & Developer Mode ---+ { source: '/developers/webhooks', destination: '/docs/developers/webhooks', permanent: true },+ {+ source: '/developers/developer-mode/field-coordinates',+ destination: '/docs/developers/api/developer-mode',+ permanent: true,+ },++ // --- Self-Hosting (old paths without /docs prefix) ---+ { source: '/self-hosting', destination: '/docs/self-hosting', permanent: true },+ {+ source: '/self-hosting/getting-started',+ destination: '/docs/self-hosting/getting-started',+ permanent: true,+ },+ {+ source: '/self-hosting/getting-started/requirements',+ destination: '/docs/self-hosting/getting-started/requirements',+ permanent: true,+ },+ {+ source: '/self-hosting/getting-started/quick-start',+ destination: '/docs/self-hosting/getting-started/quick-start',+ permanent: true,+ },+ {+ source: '/self-hosting/getting-started/tips',+ destination: '/docs/self-hosting/getting-started/tips',+ permanent: true,+ },+ {+ source: '/self-hosting/deployment',+ destination: '/docs/self-hosting/deployment',+ permanent: true,+ },+ {+ source: '/self-hosting/deployment/docker',+ destination: '/docs/self-hosting/deployment/docker',+ permanent: true,+ },+ {+ source: '/self-hosting/deployment/docker-compose',+ destination: '/docs/self-hosting/deployment/docker-compose',+ permanent: true,+ },+ {+ source: '/self-hosting/deployment/railway',+ destination: '/docs/self-hosting/deployment/railway',+ permanent: true,+ },+ {+ source: '/self-hosting/deployment/kubernetes',+ destination: '/docs/self-hosting/deployment/kubernetes',+ permanent: true,+ },+ {+ source: '/self-hosting/deployment/manual',+ destination: '/docs/self-hosting/deployment/manual',+ permanent: true,+ },+ {+ source: '/self-hosting/configuration',+ destination: '/docs/self-hosting/configuration',+ permanent: true,+ },+ {+ source: '/self-hosting/configuration/environment',+ destination: '/docs/self-hosting/configuration/environment',+ permanent: true,+ },+ {+ source: '/self-hosting/configuration/database',+ destination: '/docs/self-hosting/configuration/database',+ permanent: true,+ },+ {+ source: '/self-hosting/configuration/email',+ destination: '/docs/self-hosting/configuration/email',+ permanent: true,+ },+ {+ source: '/self-hosting/configuration/storage',+ destination: '/docs/self-hosting/configuration/storage',+ permanent: true,+ },+ {+ source: '/self-hosting/configuration/telemetry',+ destination: '/docs/self-hosting/configuration/telemetry',+ permanent: true,+ },+ {+ source: '/self-hosting/configuration/signing-certificate',+ destination: '/docs/self-hosting/configuration/signing-certificate',+ permanent: true,+ },+ {+ source: '/self-hosting/configuration/signing-certificate/local',+ destination: '/docs/self-hosting/configuration/signing-certificate/local',+ permanent: true,+ },+ {+ source: '/self-hosting/configuration/signing-certificate/google-cloud-hsm',+ destination: '/docs/self-hosting/configuration/signing-certificate/google-cloud-hsm',+ permanent: true,+ },+ {+ source: '/self-hosting/configuration/signing-certificate/timestamp-server',+ destination: '/docs/self-hosting/configuration/signing-certificate/timestamp-server',+ permanent: true,+ },+ {+ source: '/self-hosting/configuration/signing-certificate/troubleshooting',+ destination: '/docs/self-hosting/configuration/signing-certificate/troubleshooting',+ permanent: true,+ },+ {+ source: '/self-hosting/configuration/advanced',+ destination: '/docs/self-hosting/configuration/advanced',+ permanent: true,+ },+ {+ source: '/self-hosting/configuration/advanced/oauth-providers',+ destination: '/docs/self-hosting/configuration/advanced/oauth-providers',+ permanent: true,+ },+ {+ source: '/self-hosting/configuration/advanced/ai-features',+ destination: '/docs/self-hosting/configuration/advanced/ai-features',+ permanent: true,+ },+ {+ source: '/self-hosting/maintenance',+ destination: '/docs/self-hosting/maintenance',+ permanent: true,+ },+ {+ source: '/self-hosting/maintenance/upgrades',+ destination: '/docs/self-hosting/maintenance/upgrades',+ permanent: true,+ },+ {+ source: '/self-hosting/maintenance/backups',+ destination: '/docs/self-hosting/maintenance/backups',+ permanent: true,+ },+ {+ source: '/self-hosting/maintenance/troubleshooting',+ destination: '/docs/self-hosting/maintenance/troubleshooting',+ permanent: true,+ },+ ];+ },+};++export default withMDX(config);diff --git a/apps/docs/package.json b/apps/docs/package.jsonnew file mode 100644index 000000000..e7dfada04--- /dev/null+++ b/apps/docs/package.json@@ -0,0 +1,36 @@+{+ "name": "@documenso/docs",+ "version": "0.0.0",+ "private": true,+ "scripts": {+ "build": "next build",+ "dev": "next dev",+ "start": "next start",+ "types:check": "fumadocs-mdx && next typegen && tsc --noEmit",+ "postinstall": "fumadocs-mdx"+ },+ "dependencies": {+ "@radix-ui/react-tabs": "^1.1.13",+ "fumadocs-core": "16.5.0",+ "fumadocs-mdx": "14.2.6",+ "fumadocs-ui": "16.5.0",+ "lucide-react": "^0.563.0",+ "mermaid": "^11.12.2",+ "next": "16.1.6",+ "next-plausible": "^3.12.5",+ "next-themes": "^0.4.6",+ "react": "^19.2.4",+ "react-dom": "^19.2.4",+ "tailwind-merge": "^3.4.0"+ },+ "devDependencies": {+ "@tailwindcss/postcss": "^4.1.18",+ "@types/mdx": "^2.0.13",+ "@types/node": "^25.1.0",+ "@types/react": "^19.2.10",+ "@types/react-dom": "^19.2.3",+ "postcss": "^8.5.6",+ "tailwindcss": "^4.1.18",+ "typescript": "^5.9.3"+ }+}diff --git a/apps/docs/postcss.config.mjs b/apps/docs/postcss.config.mjsnew file mode 100644index 000000000..a34a3d560--- /dev/null+++ b/apps/docs/postcss.config.mjs@@ -0,0 +1,5 @@+export default {+ plugins: {+ '@tailwindcss/postcss': {},+ },+};diff --git a/apps/docs/public/apple-touch-icon.png b/apps/docs/public/apple-touch-icon.pngnew file mode 100644index 000000000..22b756a89Binary files /dev/null and b/apps/docs/public/apple-touch-icon.png differdiff --git a/apps/docs/public/default-recipients/organisation-default-recipients-role-step.webp b/apps/docs/public/default-recipients/organisation-default-recipients-role-step.webpnew file mode 100644index 000000000..2c769bcddBinary files /dev/null and b/apps/docs/public/default-recipients/organisation-default-recipients-role-step.webp differdiff --git a/apps/docs/public/default-recipients/organisation-default-recipients-select-step.webp b/apps/docs/public/default-recipients/organisation-default-recipients-select-step.webpnew file mode 100644index 000000000..a20f5a6c6Binary files /dev/null and b/apps/docs/public/default-recipients/organisation-default-recipients-select-step.webp differdiff --git a/apps/docs/public/default-recipients/team-default-recipients.webp b/apps/docs/public/default-recipients/team-default-recipients.webpnew file mode 100644index 000000000..5eac9e6e0Binary files /dev/null and b/apps/docs/public/default-recipients/team-default-recipients.webp differdiff --git a/apps/docs/public/developer-mode/field-coordinates-legacy-editor.webp b/apps/docs/public/developer-mode/field-coordinates-legacy-editor.webpnew file mode 100644index 000000000..7cf99a3b9Binary files /dev/null and b/apps/docs/public/developer-mode/field-coordinates-legacy-editor.webp differdiff --git a/apps/docs/public/developer-mode/field-coordinates-new-editor.webp b/apps/docs/public/developer-mode/field-coordinates-new-editor.webpnew file mode 100644index 000000000..ea6980da2Binary files /dev/null and b/apps/docs/public/developer-mode/field-coordinates-new-editor.webp differdiff --git a/apps/docs/public/direct-links/choose-direct-link-recipient-documenso.webp b/apps/docs/public/direct-links/choose-direct-link-recipient-documenso.webpnew file mode 100644index 000000000..7dce51822Binary files /dev/null and b/apps/docs/public/direct-links/choose-direct-link-recipient-documenso.webp differdiff --git a/apps/docs/public/direct-links/documenso-profile.webp b/apps/docs/public/direct-links/documenso-profile.webpnew file mode 100644index 000000000..5a935a464Binary files /dev/null and b/apps/docs/public/direct-links/documenso-profile.webp differdiff --git a/apps/docs/public/direct-links/document-direct-link-documenso.webp b/apps/docs/public/direct-links/document-direct-link-documenso.webpnew file mode 100644index 000000000..860f4ee44Binary files /dev/null and b/apps/docs/public/direct-links/document-direct-link-documenso.webp differdiff --git a/apps/docs/public/direct-links/enable-document-direct-link-modal.webp b/apps/docs/public/direct-links/enable-document-direct-link-modal.webpnew file mode 100644index 000000000..0d54bf2f8Binary files /dev/null and b/apps/docs/public/direct-links/enable-document-direct-link-modal.webp differdiff --git a/apps/docs/public/document-signing/ai-field-detection-button.webp b/apps/docs/public/document-signing/ai-field-detection-button.webpnew file mode 100644index 000000000..0bad99e65Binary files /dev/null and b/apps/docs/public/document-signing/ai-field-detection-button.webp differdiff --git a/apps/docs/public/document-signing/ai-field-detection-dialog.webp b/apps/docs/public/document-signing/ai-field-detection-dialog.webpnew file mode 100644index 000000000..a586bf9e8Binary files /dev/null and b/apps/docs/public/document-signing/ai-field-detection-dialog.webp differdiff --git a/apps/docs/public/document-signing/ai-recipient-detect-button.webp b/apps/docs/public/document-signing/ai-recipient-detect-button.webpnew file mode 100644index 000000000..a22c6a1b6Binary files /dev/null and b/apps/docs/public/document-signing/ai-recipient-detect-button.webp differdiff --git a/apps/docs/public/document-signing/checkbox-field-document-editor-view.webp b/apps/docs/public/document-signing/checkbox-field-document-editor-view.webpnew file mode 100644index 000000000..29d87f5d8Binary files /dev/null and b/apps/docs/public/document-signing/checkbox-field-document-editor-view.webp differdiff --git a/apps/docs/public/document-signing/date-field-document-editor-view.webp b/apps/docs/public/document-signing/date-field-document-editor-view.webpnew file mode 100644index 000000000..589a7cff9Binary files /dev/null and b/apps/docs/public/document-signing/date-field-document-editor-view.webp differdiff --git a/apps/docs/public/document-signing/documenso-document-email-settings.webp b/apps/docs/public/document-signing/documenso-document-email-settings.webpnew file mode 100644index 000000000..0605344a0Binary files /dev/null and b/apps/docs/public/document-signing/documenso-document-email-settings.webp differdiff --git a/apps/docs/public/document-signing/documenso-document-fields.webp b/apps/docs/public/document-signing/documenso-document-fields.webpnew file mode 100644index 000000000..500545db7Binary files /dev/null and b/apps/docs/public/document-signing/documenso-document-fields.webp differdiff --git a/apps/docs/public/document-signing/documenso-documents-dashboard.webp b/apps/docs/public/document-signing/documenso-documents-dashboard.webpnew file mode 100644index 000000000..2fc47d123Binary files /dev/null and b/apps/docs/public/document-signing/documenso-documents-dashboard.webp differdiff --git a/apps/docs/public/document-signing/documenso-editor-email-settings.webp b/apps/docs/public/document-signing/documenso-editor-email-settings.webpnew file mode 100644index 000000000..f3be8ba83Binary files /dev/null and b/apps/docs/public/document-signing/documenso-editor-email-settings.webp differdiff --git a/apps/docs/public/document-signing/documenso-editor-general-settings.webp b/apps/docs/public/document-signing/documenso-editor-general-settings.webpnew file mode 100644index 000000000..c8ff54dfbBinary files /dev/null and b/apps/docs/public/document-signing/documenso-editor-general-settings.webp differdiff --git a/apps/docs/public/document-signing/documenso-editor-preview.webp b/apps/docs/public/document-signing/documenso-editor-preview.webpnew file mode 100644index 000000000..7bf5f2f63Binary files /dev/null and b/apps/docs/public/document-signing/documenso-editor-preview.webp differdiff --git a/apps/docs/public/document-signing/documenso-editor-security-settings.webp b/apps/docs/public/document-signing/documenso-editor-security-settings.webpnew file mode 100644index 000000000..53b6f4567Binary files /dev/null and b/apps/docs/public/document-signing/documenso-editor-security-settings.webp differdiff --git a/apps/docs/public/document-signing/documenso-sign-email.webp b/apps/docs/public/document-signing/documenso-sign-email.webpnew file mode 100644index 000000000..7e9f39dbaBinary files /dev/null and b/apps/docs/public/document-signing/documenso-sign-email.webp differdiff --git a/apps/docs/public/document-signing/documenso-signing-links.webp b/apps/docs/public/document-signing/documenso-signing-links.webpnew file mode 100644index 000000000..e14d7b499Binary files /dev/null and b/apps/docs/public/document-signing/documenso-signing-links.webp differdiff --git a/apps/docs/public/document-signing/dropdown-field-document-editor-view.webp b/apps/docs/public/document-signing/dropdown-field-document-editor-view.webpnew file mode 100644index 000000000..ce5b81751Binary files /dev/null and b/apps/docs/public/document-signing/dropdown-field-document-editor-view.webp differdiff --git a/apps/docs/public/document-signing/editor-overview.webp b/apps/docs/public/document-signing/editor-overview.webpnew file mode 100644index 000000000..319550467Binary files /dev/null and b/apps/docs/public/document-signing/editor-overview.webp differdiff --git a/apps/docs/public/document-signing/editor-upload-recipients.webp b/apps/docs/public/document-signing/editor-upload-recipients.webpnew file mode 100644index 000000000..c3c2a8ca4Binary files /dev/null and b/apps/docs/public/document-signing/editor-upload-recipients.webp differdiff --git a/apps/docs/public/document-signing/email-field-document-editor-view.webp b/apps/docs/public/document-signing/email-field-document-editor-view.webpnew file mode 100644index 000000000..37dab440eBinary files /dev/null and b/apps/docs/public/document-signing/email-field-document-editor-view.webp differdiff --git a/apps/docs/public/document-signing/initials-field-document-editor-view.webp b/apps/docs/public/document-signing/initials-field-document-editor-view.webpnew file mode 100644index 000000000..89ca68dbbBinary files /dev/null and b/apps/docs/public/document-signing/initials-field-document-editor-view.webp differdiff --git a/apps/docs/public/document-signing/name-field-document-editor-view.webp b/apps/docs/public/document-signing/name-field-document-editor-view.webpnew file mode 100644index 000000000..fbf8a8e9aBinary files /dev/null and b/apps/docs/public/document-signing/name-field-document-editor-view.webp differdiff --git a/apps/docs/public/document-signing/number-field-document-editor-view.webp b/apps/docs/public/document-signing/number-field-document-editor-view.webpnew file mode 100644index 000000000..aef5a2533Binary files /dev/null and b/apps/docs/public/document-signing/number-field-document-editor-view.webp differdiff --git a/apps/docs/public/document-signing/radio-field-document-editor-view.webp b/apps/docs/public/document-signing/radio-field-document-editor-view.webpnew file mode 100644index 000000000..0b0ac6549Binary files /dev/null and b/apps/docs/public/document-signing/radio-field-document-editor-view.webp differdiff --git a/apps/docs/public/document-signing/signature-field-document-editor-view.webp b/apps/docs/public/document-signing/signature-field-document-editor-view.webpnew file mode 100644index 000000000..a976a2dfeBinary files /dev/null and b/apps/docs/public/document-signing/signature-field-document-editor-view.webp differdiff --git a/apps/docs/public/document-signing/text-field-document-editor-view.webp b/apps/docs/public/document-signing/text-field-document-editor-view.webpnew file mode 100644index 000000000..288d38817Binary files /dev/null and b/apps/docs/public/document-signing/text-field-document-editor-view.webp differdiff --git a/apps/docs/public/email-domains/email-domain-sync.webp b/apps/docs/public/email-domains/email-domain-sync.webpnew file mode 100644index 000000000..cd62cce21Binary files /dev/null and b/apps/docs/public/email-domains/email-domain-sync.webp differdiff --git a/apps/docs/public/email-domains/email-domains-manage-create-email.webp b/apps/docs/public/email-domains/email-domains-manage-create-email.webpnew file mode 100644index 000000000..d3aafb982Binary files /dev/null and b/apps/docs/public/email-domains/email-domains-manage-create-email.webp differdiff --git a/apps/docs/public/email-domains/email-domains-manage.webp b/apps/docs/public/email-domains/email-domains-manage.webpnew file mode 100644index 000000000..ec0dc9269Binary files /dev/null and b/apps/docs/public/email-domains/email-domains-manage.webp differdiff --git a/apps/docs/public/email-domains/email-domains-record.webp b/apps/docs/public/email-domains/email-domains-record.webpnew file mode 100644index 000000000..f69696799Binary files /dev/null and b/apps/docs/public/email-domains/email-domains-record.webp differdiff --git a/apps/docs/public/email-domains/email-domains-settings-page.webp b/apps/docs/public/email-domains/email-domains-settings-page.webpnew file mode 100644index 000000000..512c436a0Binary files /dev/null and b/apps/docs/public/email-domains/email-domains-settings-page.webp differdiff --git a/apps/docs/public/embedding/copy-recipient-token.png b/apps/docs/public/embedding/copy-recipient-token.pngnew file mode 100644index 000000000..fde239b83Binary files /dev/null and b/apps/docs/public/embedding/copy-recipient-token.png differdiff --git a/apps/docs/public/embedding/enable-direct-link.png b/apps/docs/public/embedding/enable-direct-link.pngnew file mode 100644index 000000000..871a1c94dBinary files /dev/null and b/apps/docs/public/embedding/enable-direct-link.png differdiff --git a/apps/docs/public/embedding/team-templates.png b/apps/docs/public/embedding/team-templates.pngnew file mode 100644index 000000000..e052ecf2dBinary files /dev/null and b/apps/docs/public/embedding/team-templates.png differdiff --git a/apps/docs/public/favicon-16x16.png b/apps/docs/public/favicon-16x16.pngnew file mode 100644index 000000000..ddb28ae72Binary files /dev/null and b/apps/docs/public/favicon-16x16.png differdiff --git a/apps/docs/public/favicon-32x32.png b/apps/docs/public/favicon-32x32.pngnew file mode 100644index 000000000..210dcb4d1Binary files /dev/null and b/apps/docs/public/favicon-32x32.png differdiff --git a/apps/docs/public/fonts/inter-bold.ttf b/apps/docs/public/fonts/inter-bold.ttfnew file mode 100644index 000000000..8e82c70d1Binary files /dev/null and b/apps/docs/public/fonts/inter-bold.ttf differdiff --git a/apps/docs/public/fonts/inter-regular.ttf b/apps/docs/public/fonts/inter-regular.ttfnew file mode 100644index 000000000..8d4eebf20Binary files /dev/null and b/apps/docs/public/fonts/inter-regular.ttf differdiff --git a/apps/docs/public/fonts/inter-semibold.ttf b/apps/docs/public/fonts/inter-semibold.ttfnew file mode 100644index 000000000..c6aeeb16aBinary files /dev/null and b/apps/docs/public/fonts/inter-semibold.ttf differdiff --git a/apps/docs/public/get-started-images/documenso-account-security-page.webp b/apps/docs/public/get-started-images/documenso-account-security-page.webpnew file mode 100644index 000000000..c8b696f28Binary files /dev/null and b/apps/docs/public/get-started-images/documenso-account-security-page.webp differdiff --git a/apps/docs/public/get-started-images/documenso-add-passkey-box.webp b/apps/docs/public/get-started-images/documenso-add-passkey-box.webpnew file mode 100644index 000000000..5245a63a2Binary files /dev/null and b/apps/docs/public/get-started-images/documenso-add-passkey-box.webp differdiff --git a/apps/docs/public/get-started-images/documenso-enable-2-factor-authentication.webp b/apps/docs/public/get-started-images/documenso-enable-2-factor-authentication.webpnew file mode 100644index 000000000..1aa918cd8Binary files /dev/null and b/apps/docs/public/get-started-images/documenso-enable-2-factor-authentication.webp differdiff --git a/apps/docs/public/get-started-images/documenso-passkeys-page.webp b/apps/docs/public/get-started-images/documenso-passkeys-page.webpnew file mode 100644index 000000000..2ff521eb6Binary files /dev/null and b/apps/docs/public/get-started-images/documenso-passkeys-page.webp differdiff --git a/apps/docs/public/logo.png b/apps/docs/public/logo.pngnew file mode 100644index 000000000..4813aaaefBinary files /dev/null and b/apps/docs/public/logo.png differdiff --git a/apps/docs/public/organisations/organisation-branding.webp b/apps/docs/public/organisations/organisation-branding.webpnew file mode 100644index 000000000..e28df3530Binary files /dev/null and b/apps/docs/public/organisations/organisation-branding.webp differdiff --git a/apps/docs/public/organisations/organisation-document-preferences.webp b/apps/docs/public/organisations/organisation-document-preferences.webpnew file mode 100644index 000000000..6f2548590Binary files /dev/null and b/apps/docs/public/organisations/organisation-document-preferences.webp differdiff --git a/apps/docs/public/organisations/organisation-document-visibility.webp b/apps/docs/public/organisations/organisation-document-visibility.webpnew file mode 100644index 000000000..054827e8eBinary files /dev/null and b/apps/docs/public/organisations/organisation-document-visibility.webp differdiff --git a/apps/docs/public/organisations/organisation-email-preferences.webp b/apps/docs/public/organisations/organisation-email-preferences.webpnew file mode 100644index 000000000..a66e64316Binary files /dev/null and b/apps/docs/public/organisations/organisation-email-preferences.webp differdiff --git a/apps/docs/public/organisations/organisation-group-assignment.webp b/apps/docs/public/organisations/organisation-group-assignment.webpnew file mode 100644index 000000000..2ead5a1dfBinary files /dev/null and b/apps/docs/public/organisations/organisation-group-assignment.webp differdiff --git a/apps/docs/public/organisations/organisation-group-create.webp b/apps/docs/public/organisations/organisation-group-create.webpnew file mode 100644index 000000000..79f98a98dBinary files /dev/null and b/apps/docs/public/organisations/organisation-group-create.webp differdiff --git a/apps/docs/public/organisations/organisation-group-manage.webp b/apps/docs/public/organisations/organisation-group-manage.webpnew file mode 100644index 000000000..e907e423dBinary files /dev/null and b/apps/docs/public/organisations/organisation-group-manage.webp differdiff --git a/apps/docs/public/organisations/organisations-basic-diagram.webp b/apps/docs/public/organisations/organisations-basic-diagram.webpnew file mode 100644index 000000000..7f1a3da8bBinary files /dev/null and b/apps/docs/public/organisations/organisations-basic-diagram.webp differdiff --git a/apps/docs/public/organisations/organisations-billing.webp b/apps/docs/public/organisations/organisations-billing.webpnew file mode 100644index 000000000..03e2cb15fBinary files /dev/null and b/apps/docs/public/organisations/organisations-billing.webp differdiff --git a/apps/docs/public/organisations/organisations-create.webp b/apps/docs/public/organisations/organisations-create.webpnew file mode 100644index 000000000..f3c036365Binary files /dev/null and b/apps/docs/public/organisations/organisations-create.webp differdiff --git a/apps/docs/public/organisations/organisations-member-invite.webp b/apps/docs/public/organisations/organisations-member-invite.webpnew file mode 100644index 000000000..91fbeaa77Binary files /dev/null and b/apps/docs/public/organisations/organisations-member-invite.webp differdiff --git a/apps/docs/public/organisations/organisations-sso-settings.webp b/apps/docs/public/organisations/organisations-sso-settings.webpnew file mode 100644index 000000000..b6d46f77eBinary files /dev/null and b/apps/docs/public/organisations/organisations-sso-settings.webp differdiff --git a/apps/docs/public/public-api-images/api-tokens-page-documenso.webp b/apps/docs/public/public-api-images/api-tokens-page-documenso.webpnew file mode 100644index 000000000..0b8b00124Binary files /dev/null and b/apps/docs/public/public-api-images/api-tokens-page-documenso.webp differdiff --git a/apps/docs/public/public-api-images/documenso-api-key-blurred.webp b/apps/docs/public/public-api-images/documenso-api-key-blurred.webpnew file mode 100644index 000000000..b541e415eBinary files /dev/null and b/apps/docs/public/public-api-images/documenso-api-key-blurred.webp differdiff --git a/apps/docs/public/public-api-images/documenso-user-dropdown-menu.webp b/apps/docs/public/public-api-images/documenso-user-dropdown-menu.webpnew file mode 100644index 000000000..1699b9406Binary files /dev/null and b/apps/docs/public/public-api-images/documenso-user-dropdown-menu.webp differdiff --git a/apps/docs/public/public-profile/documenso-enable-public-profile-settings.webp b/apps/docs/public/public-profile/documenso-enable-public-profile-settings.webpnew file mode 100644index 000000000..b37621a45Binary files /dev/null and b/apps/docs/public/public-profile/documenso-enable-public-profile-settings.webp differdiff --git a/apps/docs/public/public-profile/documenso-public-profile-settings.webp b/apps/docs/public/public-profile/documenso-public-profile-settings.webpnew file mode 100644index 000000000..bfd4dfac7Binary files /dev/null and b/apps/docs/public/public-profile/documenso-public-profile-settings.webp differdiff --git a/apps/docs/public/teams/document-visibility-settings.webp b/apps/docs/public/teams/document-visibility-settings.webpnew file mode 100644index 000000000..d726efc77Binary files /dev/null and b/apps/docs/public/teams/document-visibility-settings.webp differdiff --git a/apps/docs/public/teams/team-create-dialog.webp b/apps/docs/public/teams/team-create-dialog.webpnew file mode 100644index 000000000..25c4f1a5bBinary files /dev/null and b/apps/docs/public/teams/team-create-dialog.webp differdiff --git a/apps/docs/public/teams/team-create.webp b/apps/docs/public/teams/team-create.webpnew file mode 100644index 000000000..1b1801805Binary files /dev/null and b/apps/docs/public/teams/team-create.webp differdiff --git a/apps/docs/public/templates/documenso-template-page-uploaded-document.webp b/apps/docs/public/templates/documenso-template-page-uploaded-document.webpnew file mode 100644index 000000000..2ad050894Binary files /dev/null and b/apps/docs/public/templates/documenso-template-page-uploaded-document.webp differdiff --git a/apps/docs/public/templates/documenso-template-page.webp b/apps/docs/public/templates/documenso-template-page.webpnew file mode 100644index 000000000..e69460477Binary files /dev/null and b/apps/docs/public/templates/documenso-template-page.webp differdiff --git a/apps/docs/public/templates/documenso-template-recipients.webp b/apps/docs/public/templates/documenso-template-recipients.webpnew file mode 100644index 000000000..f11b41d4eBinary files /dev/null and b/apps/docs/public/templates/documenso-template-recipients.webp differdiff --git a/apps/docs/public/templates/documenso-use-template.webp b/apps/docs/public/templates/documenso-use-template.webpnew file mode 100644index 000000000..81f60fc2fBinary files /dev/null and b/apps/docs/public/templates/documenso-use-template.webp differdiff --git a/apps/docs/public/webhook-images/create-webhook-dialog.webp b/apps/docs/public/webhook-images/create-webhook-dialog.webpnew file mode 100644index 000000000..25fd1cac8Binary files /dev/null and b/apps/docs/public/webhook-images/create-webhook-dialog.webp differdiff --git a/apps/docs/public/webhook-images/documenso-main-page.webp b/apps/docs/public/webhook-images/documenso-main-page.webpnew file mode 100644index 000000000..b9f67a5afBinary files /dev/null and b/apps/docs/public/webhook-images/documenso-main-page.webp differdiff --git a/apps/docs/public/webhook-images/webhook-detail-page.webp b/apps/docs/public/webhook-images/webhook-detail-page.webpnew file mode 100644index 000000000..ba9e0bf9eBinary files /dev/null and b/apps/docs/public/webhook-images/webhook-detail-page.webp differdiff --git a/apps/docs/public/webhook-images/webhook-run-page.webp b/apps/docs/public/webhook-images/webhook-run-page.webpnew file mode 100644index 000000000..0a103a1fbBinary files /dev/null and b/apps/docs/public/webhook-images/webhook-run-page.webp differdiff --git a/apps/docs/public/webhook-images/webhook-test-trigger.webp b/apps/docs/public/webhook-images/webhook-test-trigger.webpnew file mode 100644index 000000000..c5c93f94dBinary files /dev/null and b/apps/docs/public/webhook-images/webhook-test-trigger.webp differdiff --git a/apps/docs/public/webhook-images/webhooks-main-page.webp b/apps/docs/public/webhook-images/webhooks-main-page.webpnew file mode 100644index 000000000..ac8ea2e88Binary files /dev/null and b/apps/docs/public/webhook-images/webhooks-main-page.webp differdiff --git a/apps/docs/public/webhook-images/webhooks-page.webp b/apps/docs/public/webhook-images/webhooks-page.webpnew file mode 100644index 000000000..9df677425Binary files /dev/null and b/apps/docs/public/webhook-images/webhooks-page.webp differdiff --git a/apps/docs/source.config.ts b/apps/docs/source.config.tsnew file mode 100644index 000000000..52ed03ae4--- /dev/null+++ b/apps/docs/source.config.ts@@ -0,0 +1,23 @@+import { remarkMdxMermaid } from 'fumadocs-core/mdx-plugins';+import { defineConfig, defineDocs, frontmatterSchema, metaSchema } from 'fumadocs-mdx/config';++// You can customise Zod schemas for frontmatter and `meta.json` here+// see https://fumadocs.dev/docs/mdx/collections+export const docs = defineDocs({+ dir: 'content/docs',+ docs: {+ schema: frontmatterSchema,+ postprocess: {+ includeProcessedMarkdown: true,+ },+ },+ meta: {+ schema: metaSchema,+ },+});++export default defineConfig({+ mdxOptions: {+ remarkPlugins: [remarkMdxMermaid],+ },+});diff --git a/apps/docs/src/app/(home)/layout.tsx b/apps/docs/src/app/(home)/layout.tsxnew file mode 100644index 000000000..b1bf08edc--- /dev/null+++ b/apps/docs/src/app/(home)/layout.tsx@@ -0,0 +1,6 @@+import { baseOptions } from '@/lib/layout.shared';+import { HomeLayout } from 'fumadocs-ui/layouts/home';++export default function Layout({ children }: LayoutProps<'/'>) {+ return <HomeLayout {...baseOptions()}>{children}</HomeLayout>;+}diff --git a/apps/docs/src/app/(home)/page.tsx b/apps/docs/src/app/(home)/page.tsxnew file mode 100644index 000000000..0bd99fdd5--- /dev/null+++ b/apps/docs/src/app/(home)/page.tsx@@ -0,0 +1,271 @@+import type { Metadata } from 'next';+import Link from 'next/link';++import {+ BookOpenIcon,+ CodeIcon,+ FileTextIcon,+ GithubIcon,+ ServerIcon,+ ShieldCheckIcon,+ UserIcon,+} from 'lucide-react';++export const metadata: Metadata = {+ title: 'Documenso Docs',+ description:+ 'The official documentation for Documenso, the open-source document signing platform. Send documents for signatures, integrate with the API, or self-host with full control.',+};++export default function HomePage() {+ return (+ <main className="mx-auto max-w-4xl px-4 py-12">+ {/* Hero */}+ <div className="mb-16 pt-6 text-center">+ <h1 className="mb-4 text-4xl font-bold tracking-tight">Documenso Documentation</h1>+ <p className="text-fd-muted-foreground mx-auto mb-8 max-w-2xl text-lg">+ The open-source document signing platform. Send documents for signatures, integrate with+ your apps, or self-host with full control.+ </p>+ <div className="flex flex-wrap justify-center gap-3">+ <Link+ href="/docs/users"+ className="bg-documenso text-fd-primary-foreground hover:bg-documenso-dark/90 inline-flex items-center gap-2 rounded-lg px-5 py-2.5 text-sm font-medium transition-colors"+ >+ Get Started+ </Link>+ <a+ href="https://github.com/documenso/documenso"+ className="bg-fd-background hover:bg-fd-accent inline-flex items-center gap-2 rounded-lg border px-5 py-2.5 text-sm font-medium transition-colors"+ >+ <GithubIcon className="size-4" />+ View on GitHub+ </a>+ </div>+ </div>++ {/* Main Guide Cards */}+ <div className="mb-16 grid gap-4 md:grid-cols-3">+ <Link+ href="/docs/users"+ className="group bg-fd-card hover:border-fd-primary/50 relative flex flex-col rounded-xl border p-6 transition-all hover:shadow-md"+ >+ <div className="mb-4 flex size-12 items-center justify-center rounded-lg bg-emerald-500/10 text-emerald-600 dark:text-emerald-400">+ <UserIcon className="size-6" />+ </div>+ <h2 className="mb-2 text-lg font-semibold">User Guide</h2>+ <p className="text-fd-muted-foreground mb-4 flex-1 text-sm">+ Send documents, create templates, and manage your team using the web application.+ </p>+ <span className="text-fd-primary text-sm font-medium">Get started →</span>+ </Link>++ <Link+ href="/docs/developers"+ className="group bg-fd-card hover:border-fd-primary/50 relative flex flex-col rounded-xl border p-6 transition-all hover:shadow-md"+ >+ <div className="mb-4 flex size-12 items-center justify-center rounded-lg bg-blue-500/10 text-blue-600 dark:text-blue-400">+ <CodeIcon className="size-6" />+ </div>+ <h2 className="mb-2 text-lg font-semibold">Developer Guide</h2>+ <p className="text-fd-muted-foreground mb-4 flex-1 text-sm">+ Integrate document signing into your applications with the REST API, webhooks, and+ embedding.+ </p>+ <span className="text-fd-primary text-sm font-medium">View API docs →</span>+ </Link>++ <Link+ href="/docs/self-hosting"+ className="group bg-fd-card hover:border-fd-primary/50 relative flex flex-col rounded-xl border p-6 transition-all hover:shadow-md"+ >+ <div className="mb-4 flex size-12 items-center justify-center rounded-lg bg-purple-500/10 text-purple-600 dark:text-purple-400">+ <ServerIcon className="size-6" />+ </div>+ <h2 className="mb-2 text-lg font-semibold">Self-Hosting Guide</h2>+ <p className="text-fd-muted-foreground mb-4 flex-1 text-sm">+ Deploy your own Documenso instance with Docker, Kubernetes, or Railway.+ </p>+ <span className="text-fd-primary text-sm font-medium">Deploy now →</span>+ </Link>+ </div>++ {/* Quick Start & Core Concepts */}+ <div className="mb-16 grid gap-8 md:grid-cols-2">+ <div className="bg-fd-card/50 rounded-xl border p-6">+ <h3 className="mb-4 flex items-center gap-2 font-semibold">+ <BookOpenIcon className="text-fd-muted-foreground size-5" />+ Quick Start+ </h3>+ <div className="space-y-4">+ <div>+ <h4 className="mb-2 text-sm font-medium">Send your first document</h4>+ <ol className="text-fd-muted-foreground list-inside list-decimal space-y-1 text-sm">+ <li>+ <Link+ href="/docs/users/getting-started/create-account"+ className="text-fd-primary hover:underline"+ >+ Create an account+ </Link>+ </li>+ <li>+ <Link+ href="/docs/users/getting-started/send-first-document"+ className="text-fd-primary hover:underline"+ >+ Upload and send a document+ </Link>+ </li>+ </ol>+ </div>+ <div>+ <h4 className="mb-2 text-sm font-medium">Integrate with the API</h4>+ <ol className="text-fd-muted-foreground list-inside list-decimal space-y-1 text-sm">+ <li>+ <Link+ href="/docs/developers/getting-started/authentication"+ className="text-fd-primary hover:underline"+ >+ Get your API key+ </Link>+ </li>+ <li>+ <Link+ href="/docs/developers/getting-started/first-api-call"+ className="text-fd-primary hover:underline"+ >+ Make your first API call+ </Link>+ </li>+ </ol>+ </div>+ <div>+ <h4 className="mb-2 text-sm font-medium">Deploy self-hosted</h4>+ <ol className="text-fd-muted-foreground list-inside list-decimal space-y-1 text-sm">+ <li>+ <Link+ href="/docs/self-hosting/getting-started/requirements"+ className="text-fd-primary hover:underline"+ >+ Check requirements+ </Link>+ </li>+ <li>+ <Link+ href="/docs/self-hosting/getting-started/quick-start"+ className="text-fd-primary hover:underline"+ >+ Run with Docker+ </Link>+ </li>+ </ol>+ </div>+ </div>+ </div>++ <div className="bg-fd-card/50 rounded-xl border p-6">+ <h3 className="mb-4 flex items-center gap-2 font-semibold">+ <BookOpenIcon className="text-fd-muted-foreground size-5" />+ Core Concepts+ </h3>+ <div className="grid grid-cols-2 gap-3">+ <Link+ href="/docs/concepts/document-lifecycle"+ className="bg-fd-background hover:border-fd-primary/50 rounded-lg border p-3 text-sm transition-colors"+ >+ <div className="mb-1 font-medium">Document Lifecycle</div>+ <div className="text-fd-muted-foreground text-xs">Draft to completed</div>+ </Link>+ <Link+ href="/docs/concepts/recipient-roles"+ className="bg-fd-background hover:border-fd-primary/50 rounded-lg border p-3 text-sm transition-colors"+ >+ <div className="mb-1 font-medium">Recipient Roles</div>+ <div className="text-fd-muted-foreground text-xs">Signers and approvers</div>+ </Link>+ <Link+ href="/docs/concepts/field-types"+ className="bg-fd-background hover:border-fd-primary/50 rounded-lg border p-3 text-sm transition-colors"+ >+ <div className="mb-1 font-medium">Field Types</div>+ <div className="text-fd-muted-foreground text-xs">Signatures and inputs</div>+ </Link>+ <Link+ href="/docs/concepts/signing-certificates"+ className="bg-fd-background hover:border-fd-primary/50 rounded-lg border p-3 text-sm transition-colors"+ >+ <div className="mb-1 font-medium">Signing Certificates</div>+ <div className="text-fd-muted-foreground text-xs">Digital verification</div>+ </Link>+ </div>+ </div>+ </div>++ {/* Compliance & Policies */}+ <div className="mb-16 grid gap-4 md:grid-cols-2">+ <Link+ href="/docs/compliance"+ className="bg-fd-card/50 hover:border-fd-primary/50 flex items-start gap-4 rounded-xl border p-5 transition-all"+ >+ <div className="flex size-10 shrink-0 items-center justify-center rounded-lg bg-amber-500/10 text-amber-600 dark:text-amber-400">+ <ShieldCheckIcon className="size-5" />+ </div>+ <div>+ <h3 className="mb-1 font-semibold">Compliance & Legal</h3>+ <p className="text-fd-muted-foreground text-sm">+ ESIGN, UETA, eIDAS compliance, GDPR, and signature levels explained.+ </p>+ </div>+ </Link>++ <Link+ href="/docs/policies"+ className="bg-fd-card/50 hover:border-fd-primary/50 flex items-start gap-4 rounded-xl border p-5 transition-all"+ >+ <div className="flex size-10 shrink-0 items-center justify-center rounded-lg bg-slate-500/10 text-slate-600 dark:text-slate-400">+ <FileTextIcon className="size-5" />+ </div>+ <div>+ <h3 className="mb-1 font-semibold">Policies & Licensing</h3>+ <p className="text-fd-muted-foreground text-sm">+ AGPL and Enterprise licenses, fair use, privacy policy, and support.+ </p>+ </div>+ </Link>+ </div>++ {/* Community CTA */}+ <div className="from-fd-primary/5 to-fd-primary/10 rounded-xl border bg-gradient-to-r p-8 text-center">+ <h3 className="mb-2 text-lg font-semibold">Join the Community</h3>+ <p className="text-fd-muted-foreground mb-6 text-sm">+ Documenso is open source. Contribute, ask questions, or share feedback.+ </p>+ <div className="flex flex-wrap justify-center gap-3">+ <a+ href="https://github.com/documenso/documenso"+ className="bg-fd-background hover:bg-fd-accent inline-flex items-center gap-2 rounded-lg border px-4 py-2 text-sm font-medium transition-colors"+ >+ <GithubIcon className="size-4" />+ GitHub+ </a>+ <a+ href="https://documen.so/discord"+ className="bg-fd-background hover:bg-fd-accent inline-flex items-center gap-2 rounded-lg border px-4 py-2 text-sm font-medium transition-colors"+ >+ <svg className="size-4" viewBox="0 0 24 24" fill="currentColor">+ <path d="M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189Z" />+ </svg>+ Discord+ </a>+ <a+ href="https://app.documenso.com/signup"+ className="bg-documenso text-fd-primary-foreground hover:bg-documenso/90 inline-flex items-center gap-2 rounded-lg px-4 py-2 text-sm font-medium transition-colors"+ >+ Try Documenso+ </a>+ </div>+ </div>+ </main>+ );+}diff --git a/apps/docs/src/app/api/search/route.ts b/apps/docs/src/app/api/search/route.tsnew file mode 100644index 000000000..7ba7e8231--- /dev/null+++ b/apps/docs/src/app/api/search/route.ts@@ -0,0 +1,7 @@+import { source } from '@/lib/source';+import { createFromSource } from 'fumadocs-core/search/server';++export const { GET } = createFromSource(source, {+ // https://docs.orama.com/docs/orama-js/supported-languages+ language: 'english',+});diff --git a/apps/docs/src/app/apple-icon.png b/apps/docs/src/app/apple-icon.pngnew file mode 100644index 000000000..22b756a89Binary files /dev/null and b/apps/docs/src/app/apple-icon.png differdiff --git a/apps/docs/src/app/docs/[[...slug]]/page.tsx b/apps/docs/src/app/docs/[[...slug]]/page.tsxnew file mode 100644index 000000000..f2234442f--- /dev/null+++ b/apps/docs/src/app/docs/[[...slug]]/page.tsx@@ -0,0 +1,72 @@+import type { Metadata } from 'next';+import { notFound } from 'next/navigation';++import { LLMCopyButton, ViewOptions } from '@/components/ai/page-actions';+import { getPageImage, source } from '@/lib/source';+import { getMDXComponents } from '@/mdx-components';+import { DocsBody, DocsDescription, DocsPage, DocsTitle } from 'fumadocs-ui/layouts/docs/page';++const gitConfig = {+ user: 'documenso',+ repo: 'documenso',+ branch: 'main',+ contentPath: 'apps/docs/content/docs',+};++export default async function Page(props: PageProps<'/docs/[[...slug]]'>) {+ const params = await props.params;+ const page = source.getPage(params.slug);++ if (!page) {+ notFound();+ }++ const MDX = page.data.body;++ return (+ <DocsPage toc={page.data.toc} full={page.data.full}>+ {!page.data.full && (+ <>+ <DocsTitle>{page.data.title}</DocsTitle>+ <DocsDescription className="mb-0">{page.data.description}</DocsDescription>+ <div className="flex flex-row items-center gap-2 border-b pb-6">+ <LLMCopyButton markdownUrl={`${page.url}.mdx`} />+ <ViewOptions+ markdownUrl={`${page.url}.mdx`}+ githubUrl={`https://github.com/${gitConfig.user}/${gitConfig.repo}/blob/${gitConfig.branch}/${gitConfig.contentPath}/${page.path}`}+ />+ </div>+ </>+ )}+ <DocsBody>+ <MDX components={getMDXComponents()} />+ </DocsBody>+ </DocsPage>+ );+}++export function generateStaticParams() {+ return source.generateParams();+}++export async function generateMetadata(props: PageProps<'/docs/[[...slug]]'>): Promise<Metadata> {+ const params = await props.params;+ const page = source.getPage(params.slug);++ if (!page) {+ notFound();+ }++ const ogImage = getPageImage(page).url;++ return {+ title: page.data.title,+ description: page.data.description,+ openGraph: {+ images: ogImage,+ },+ twitter: {+ images: ogImage,+ },+ };+}diff --git a/apps/docs/src/app/docs/layout.tsx b/apps/docs/src/app/docs/layout.tsxnew file mode 100644index 000000000..8371fe953--- /dev/null+++ b/apps/docs/src/app/docs/layout.tsx@@ -0,0 +1,119 @@+'use client';++import { useMemo } from 'react';++import Link from 'next/link';+import { usePathname } from 'next/navigation';++import { cn } from '@/lib/cn';+import { baseOptions } from '@/lib/layout.shared';+import { getFilteredPageTree, source } from '@/lib/source';+import type * as PageTree from 'fumadocs-core/page-tree';+import { DocsLayout } from 'fumadocs-ui/layouts/docs';+import { CodeIcon, ServerIcon, UserIcon } from 'lucide-react';++const ROOT_SECTIONS = [+ {+ id: 'users',+ label: 'Users',+ subtitle: 'Send and sign documents',+ icon: UserIcon,+ href: '/docs/users',+ },+ {+ id: 'developers',+ label: 'Developers',+ subtitle: 'API and integrations',+ icon: CodeIcon,+ href: '/docs/developers',+ },+ {+ id: 'self-hosting',+ label: 'Self-Hosting',+ subtitle: 'Deploy your own instance',+ icon: ServerIcon,+ href: '/docs/self-hosting',+ },+];++// Find first page item in folder children+function getFirstPageUrl(children: PageTree.Node[]): string | undefined {+ for (const child of children) {+ if (child.type === 'page') {+ return child.url;+ }+ if (child.type === 'folder' && child.children.length > 0) {+ const url = getFirstPageUrl(child.children);+ if (url) return url;+ }+ }+ return undefined;+}++function SectionSwitcher({ activeSection }: { activeSection: string | null }) {+ return (+ <div className="flex flex-col gap-1">+ {ROOT_SECTIONS.map((section) => {+ const isActive = activeSection === section.id;+ const Icon = section.icon;+ return (+ <Link+ key={section.id}+ href={section.href}+ className={cn(+ 'flex items-start gap-3 rounded-lg px-3 py-2.5 transition-colors',+ isActive+ ? 'bg-fd-primary/10 text-fd-primary'+ : 'text-fd-muted-foreground hover:bg-fd-accent hover:text-fd-accent-foreground',+ )}+ >+ <Icon className={cn('mt-0.5 size-4 shrink-0', isActive ? 'text-fd-primary' : '')} />+ <div className="flex flex-col gap-0.5">+ <span className="text-sm font-medium">{section.label}</span>+ <span+ className={cn(+ 'text-xs',+ isActive ? 'text-fd-muted-foreground' : 'text-fd-muted-foreground/70',+ )}+ >+ {section.subtitle}+ </span>+ </div>+ </Link>+ );+ })}+ </div>+ );+}++export default function Layout({ children }: { children: React.ReactNode }) {+ const pathname = usePathname();++ const { tree, activeSection } = useMemo(() => {+ // Check if we're in a root section+ const pathParts = pathname.split('/').filter(Boolean);+ // pathParts = ['docs', 'users', 'getting-started', ...]++ if (pathParts.length >= 2) {+ const section = pathParts[1]; // 'users', 'developers', or 'self-hosting'+ if (ROOT_SECTIONS.some((s) => s.id === section)) {+ return { tree: getFilteredPageTree(section), activeSection: section };+ }+ }++ // Default: show full tree+ return { tree: source.getPageTree(), activeSection: null };+ }, [pathname]);++ return (+ <DocsLayout+ tree={tree}+ {...baseOptions()}+ sidebar={{+ banner: <SectionSwitcher activeSection={activeSection} />,+ }}+ >+ {children}+ </DocsLayout>+ );+}diff --git a/apps/docs/src/app/favicon.ico b/apps/docs/src/app/favicon.iconew file mode 100644index 000000000..b391735c8Binary files /dev/null and b/apps/docs/src/app/favicon.ico differdiff --git a/apps/docs/src/app/global.css b/apps/docs/src/app/global.cssnew file mode 100644index 000000000..c7e4f0540--- /dev/null+++ b/apps/docs/src/app/global.css@@ -0,0 +1,181 @@+@import 'tailwindcss';+@import 'fumadocs-ui/css/shadcn.css';+@import 'fumadocs-ui/css/preset.css';++@theme {+ /* Brand utility colors */+ --color-documenso: hsl(95.08, 71.08%, 67.45%);+ --color-documenso-dark: hsl(95.08, 71.08%, 54%);+ --color-documenso-darker: hsl(95.08, 71.08%, 41%);+}++:root {+ --background: hsl(0 0% 100%);+ --foreground: hsl(222.2222 47.3684% 11.1765%);+ --card: hsl(0 0% 100%);+ --card-foreground: hsl(222.2222 47.3684% 11.1765%);+ --popover: hsl(0 0% 100%);+ --popover-foreground: hsl(222.2222 47.3684% 11.1765%);+ --primary: hsl(95.0847 71.0843% 42.451%);+ --primary-foreground: hsl(95.6757 72.549% 10%);+ --secondary: hsl(210 40% 96.0784%);+ --secondary-foreground: hsl(222.2222 47.3684% 11.1765%);+ --muted: hsl(210 40% 96.0784%);+ --muted-foreground: hsl(215.3846 16.318% 46.8627%);+ --accent: hsl(210 40% 96.0784%);+ --accent-foreground: hsl(222.2222 47.3684% 11.1765%);+ --destructive: hsl(0 100% 50%);+ --destructive-foreground: hsl(210 40% 98.0392%);+ --border: hsl(214.2857 31.8182% 91.3725%);+ --input: hsl(214.2857 31.8182% 91.3725%);+ --ring: hsl(95.0847 71.0843% 67.451%);+ --chart-1: hsl(211.788 101.9718% 78.6759%);+ --chart-2: hsl(217.4076 91.3672% 59.5787%);+ --chart-3: hsl(221.4336 86.3731% 54.0624%);+ --chart-4: hsl(223.6587 78.718% 47.8635%);+ --chart-5: hsl(226.5426 70.0108% 39.9224%);+ --sidebar: hsl(223.8136 0.0004% 98.0256%);+ --sidebar-foreground: hsl(223.8136 0% 3.9388%);+ --sidebar-primary: hsl(223.8136 0% 9.0527%);+ --sidebar-primary-foreground: hsl(223.8136 0.0004% 98.0256%);+ --sidebar-accent: hsl(223.8136 0.0002% 96.0587%);+ --sidebar-accent-foreground: hsl(223.8136 0% 9.0527%);+ --sidebar-border: hsl(223.8136 0.0001% 89.8161%);+ --sidebar-ring: hsl(223.8136 0% 63.0163%);+ --font-sans:+ ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,+ 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',+ 'Segoe UI Symbol', 'Noto Color Emoji';+ --font-serif: ui-serif, Georgia, Cambria, 'Times New Roman', Times, serif;+ --font-mono:+ ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New',+ monospace;+ --radius: 0.5rem;+ --shadow-x: 0;+ --shadow-y: 1px;+ --shadow-blur: 3px;+ --shadow-spread: 0px;+ --shadow-opacity: 0.1;+ --shadow-color: oklch(0 0 0);+ --shadow-2xs: 0 1px 3px 0px hsl(0 0% 0% / 0.05);+ --shadow-xs: 0 1px 3px 0px hsl(0 0% 0% / 0.05);+ --shadow-sm: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 1px 2px -1px hsl(0 0% 0% / 0.1);+ --shadow: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 1px 2px -1px hsl(0 0% 0% / 0.1);+ --shadow-md: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 2px 4px -1px hsl(0 0% 0% / 0.1);+ --shadow-lg: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 4px 6px -1px hsl(0 0% 0% / 0.1);+ --shadow-xl: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 8px 10px -1px hsl(0 0% 0% / 0.1);+ --shadow-2xl: 0 1px 3px 0px hsl(0 0% 0% / 0.25);+ --tracking-normal: 0em;+ --spacing: 0.25rem;+}++.dark {+ --background: hsl(0 0% 14.902%);+ --foreground: hsl(0 0% 96.8627%);+ --card: hsl(0 0% 14.902%);+ --card-foreground: hsl(0 0% 94.902%);+ --popover: hsl(0 0% 14.902%);+ --popover-foreground: hsl(0 0% 90.1961%);+ --primary: hsl(95.0847 71.0843% 67.451%);+ --primary-foreground: hsl(95.6757 72.549% 10%);+ --secondary: hsl(0 0% 23.5294%);+ --secondary-foreground: hsl(95.0847 71.0843% 67.451%);+ --muted: hsl(0 0% 23.5294%);+ --muted-foreground: hsl(0 0% 85.098%);+ --accent: hsl(0 0% 27.8431%);+ --accent-foreground: hsl(95.0847 71.0843% 67.451%);+ --destructive: hsl(0 86.5979% 61.9608%);+ --destructive-foreground: hsl(0 87.6289% 19.0196%);+ --border: hsl(0 0% 27.8431%);+ --input: hsl(0 0% 27.8431%);+ --ring: hsl(95.0847 71.0843% 67.451%);+ --chart-1: hsl(211.788 101.9718% 78.6759%);+ --chart-2: hsl(217.4076 91.3672% 59.5787%);+ --chart-3: hsl(221.4336 86.3731% 54.0624%);+ --chart-4: hsl(223.6587 78.718% 47.8635%);+ --chart-5: hsl(226.5426 70.0108% 39.9224%);+ --sidebar: hsl(223.8136 0% 9.0527%);+ --sidebar-foreground: hsl(223.8136 0.0004% 98.0256%);+ --sidebar-primary: hsl(225.3451 84.0953% 48.9841%);+ --sidebar-primary-foreground: hsl(223.8136 0.0004% 98.0256%);+ --sidebar-accent: hsl(223.8136 0% 14.9382%);+ --sidebar-accent-foreground: hsl(223.8136 0.0004% 98.0256%);+ --sidebar-border: hsl(223.8136 0% 15.5096%);+ --sidebar-ring: hsl(223.8136 0% 32.1993%);+ --font-sans:+ ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,+ 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',+ 'Segoe UI Symbol', 'Noto Color Emoji';+ --font-serif: ui-serif, Georgia, Cambria, 'Times New Roman', Times, serif;+ --font-mono:+ ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New',+ monospace;+ --radius: 0.5rem;+ --shadow-x: 0;+ --shadow-y: 1px;+ --shadow-blur: 3px;+ --shadow-spread: 0px;+ --shadow-opacity: 0.1;+ --shadow-color: oklch(0 0 0);+ --shadow-2xs: 0 1px 3px 0px hsl(0 0% 0% / 0.05);+ --shadow-xs: 0 1px 3px 0px hsl(0 0% 0% / 0.05);+ --shadow-sm: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 1px 2px -1px hsl(0 0% 0% / 0.1);+ --shadow: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 1px 2px -1px hsl(0 0% 0% / 0.1);+ --shadow-md: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 2px 4px -1px hsl(0 0% 0% / 0.1);+ --shadow-lg: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 4px 6px -1px hsl(0 0% 0% / 0.1);+ --shadow-xl: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 8px 10px -1px hsl(0 0% 0% / 0.1);+ --shadow-2xl: 0 1px 3px 0px hsl(0 0% 0% / 0.25);+}++@theme inline {+ --color-background: var(--background);+ --color-foreground: var(--foreground);+ --color-card: var(--card);+ --color-card-foreground: var(--card-foreground);+ --color-popover: var(--popover);+ --color-popover-foreground: var(--popover-foreground);+ --color-primary: var(--primary);+ --color-primary-foreground: var(--primary-foreground);+ --color-secondary: var(--secondary);+ --color-secondary-foreground: var(--secondary-foreground);+ --color-muted: var(--muted);+ --color-muted-foreground: var(--muted-foreground);+ --color-accent: var(--accent);+ --color-accent-foreground: var(--accent-foreground);+ --color-destructive: var(--destructive);+ --color-destructive-foreground: var(--destructive-foreground);+ --color-border: var(--border);+ --color-input: var(--input);+ --color-ring: var(--ring);+ --color-chart-1: var(--chart-1);+ --color-chart-2: var(--chart-2);+ --color-chart-3: var(--chart-3);+ --color-chart-4: var(--chart-4);+ --color-chart-5: var(--chart-5);+ --color-sidebar: var(--sidebar);+ --color-sidebar-foreground: var(--sidebar-foreground);+ --color-sidebar-primary: var(--sidebar-primary);+ --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);+ --color-sidebar-accent: var(--sidebar-accent);+ --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);+ --color-sidebar-border: var(--sidebar-border);+ --color-sidebar-ring: var(--sidebar-ring);++ --font-sans: var(--font-sans);+ --font-mono: var(--font-mono);+ --font-serif: var(--font-serif);++ --radius-sm: calc(var(--radius) - 4px);+ --radius-md: calc(var(--radius) - 2px);+ --radius-lg: var(--radius);+ --radius-xl: calc(var(--radius) + 4px);++ --shadow-2xs: var(--shadow-2xs);+ --shadow-xs: var(--shadow-xs);+ --shadow-sm: var(--shadow-sm);+ --shadow: var(--shadow);+ --shadow-md: var(--shadow-md);+ --shadow-lg: var(--shadow-lg);+ --shadow-xl: var(--shadow-xl);+ --shadow-2xl: var(--shadow-2xl);+}diff --git a/apps/docs/src/app/layout.tsx b/apps/docs/src/app/layout.tsxnew file mode 100644index 000000000..5c52be8ba--- /dev/null+++ b/apps/docs/src/app/layout.tsx@@ -0,0 +1,41 @@+import type { Metadata } from 'next';+import { Inter } from 'next/font/google';++import { RootProvider } from 'fumadocs-ui/provider/next';+import PlausibleProvider from 'next-plausible';++import './global.css';++const inter = Inter({+ subsets: ['latin'],+});++export const metadata: Metadata = {+ metadataBase: new URL('https://docs.documenso.com'),+ title: {+ template: '%s | Documenso Docs',+ default: 'Documenso Docs',+ },+ description:+ 'The official documentation for Documenso, the open-source document signing platform.',+ openGraph: {+ siteName: 'Documenso Docs',+ type: 'website',+ },+ twitter: {+ card: 'summary_large_image',+ site: '@documenso',+ },+};++export default function Layout({ children }: LayoutProps<'/'>) {+ return (+ <html lang="en" className={inter.className} suppressHydrationWarning>+ <body className="flex min-h-screen flex-col">+ <PlausibleProvider domain="documenso.com">+ <RootProvider>{children}</RootProvider>+ </PlausibleProvider>+ </body>+ </html>+ );+}diff --git a/apps/docs/src/app/llms-full.txt/route.ts b/apps/docs/src/app/llms-full.txt/route.tsnew file mode 100644index 000000000..d494d2cbb--- /dev/null+++ b/apps/docs/src/app/llms-full.txt/route.ts@@ -0,0 +1,10 @@+import { getLLMText, source } from '@/lib/source';++export const revalidate = false;++export async function GET() {+ const scan = source.getPages().map(getLLMText);+ const scanned = await Promise.all(scan);++ return new Response(scanned.join('\n\n'));+}diff --git a/apps/docs/src/app/llms.mdx/docs/[[...slug]]/route.ts b/apps/docs/src/app/llms.mdx/docs/[[...slug]]/route.tsnew file mode 100644index 000000000..c94ab7c26--- /dev/null+++ b/apps/docs/src/app/llms.mdx/docs/[[...slug]]/route.ts@@ -0,0 +1,24 @@+import { notFound } from 'next/navigation';++import { getLLMText, source } from '@/lib/source';++export const revalidate = false;++export async function GET(_req: Request, { params }: RouteContext<'/llms.mdx/docs/[[...slug]]'>) {+ const { slug } = await params;+ const page = source.getPage(slug);++ if (!page) {+ notFound();+ }++ return new Response(await getLLMText(page), {+ headers: {+ 'Content-Type': 'text/markdown',+ },+ });+}++export function generateStaticParams() {+ return source.generateParams();+}diff --git a/apps/docs/src/app/llms.txt/route.ts b/apps/docs/src/app/llms.txt/route.tsnew file mode 100644index 000000000..d573eaf6f--- /dev/null+++ b/apps/docs/src/app/llms.txt/route.ts@@ -0,0 +1,16 @@+import { source } from '@/lib/source';++export const revalidate = false;++export function GET() {+ const lines: string[] = [];++ lines.push('# Documentation');+ lines.push('');++ for (const page of source.getPages()) {+ lines.push(`- [${page.data.title}](${page.url}): ${page.data.description}`);+ }++ return new Response(lines.join('\n'));+}diff --git a/apps/docs/src/app/not-found.tsx b/apps/docs/src/app/not-found.tsxnew file mode 100644index 000000000..ed252e4a3--- /dev/null+++ b/apps/docs/src/app/not-found.tsx@@ -0,0 +1,26 @@+import Link from 'next/link';++export default function NotFound() {+ return (+ <main className="mx-auto flex max-w-xl flex-col items-center justify-center px-4 py-32 text-center">+ <h1 className="text-4xl font-bold tracking-tight">Page not found</h1>+ <p className="text-fd-muted-foreground mt-4 text-lg">+ The page you are looking for may have moved. Our documentation was recently restructured.+ </p>+ <div className="mt-8 flex flex-wrap justify-center gap-3">+ <Link+ href="/docs/users"+ className="bg-documenso text-fd-primary-foreground hover:bg-documenso/90 inline-flex items-center rounded-lg px-5 py-2.5 text-sm font-medium transition-colors"+ >+ Browse documentation+ </Link>+ <Link+ href="/"+ className="bg-fd-background hover:bg-fd-accent inline-flex items-center rounded-lg border px-5 py-2.5 text-sm font-medium transition-colors"+ >+ Go to homepage+ </Link>+ </div>+ </main>+ );+}diff --git a/apps/docs/src/app/og/docs/[...slug]/route.tsx b/apps/docs/src/app/og/docs/[...slug]/route.tsxnew file mode 100644index 000000000..1a7153f47--- /dev/null+++ b/apps/docs/src/app/og/docs/[...slug]/route.tsx@@ -0,0 +1,154 @@+import { notFound } from 'next/navigation';+import { ImageResponse } from 'next/og';++import { getPageImage, source } from '@/lib/source';+import { readFile } from 'node:fs/promises';+import { fileURLToPath } from 'node:url';++export const revalidate = false;++const loadAssets = async () => {+ const [logoBuffer, interRegularData, interSemiBoldData, interBoldData] = await Promise.all([+ readFile(fileURLToPath(new URL('../../../../../public/logo.png', import.meta.url))),+ readFile(+ fileURLToPath(new URL('../../../../../public/fonts/inter-regular.ttf', import.meta.url)),+ ),+ readFile(+ fileURLToPath(new URL('../../../../../public/fonts/inter-semibold.ttf', import.meta.url)),+ ),+ readFile(fileURLToPath(new URL('../../../../../public/fonts/inter-bold.ttf', import.meta.url))),+ ]);++ return {+ logoSrc: `data:image/png;base64,${logoBuffer.toString('base64')}`,+ fonts: [+ { name: 'Inter', data: interRegularData, weight: 400 as const, style: 'normal' as const },+ { name: 'Inter', data: interSemiBoldData, weight: 600 as const, style: 'normal' as const },+ { name: 'Inter', data: interBoldData, weight: 700 as const, style: 'normal' as const },+ ],+ };+};++export async function GET(_req: Request, { params }: RouteContext<'/og/docs/[...slug]'>) {+ const { slug } = await params;+ const page = source.getPage(slug.slice(0, -1));++ if (!page) {+ notFound();+ }++ const { logoSrc, fonts } = await loadAssets();++ return new ImageResponse(+ (+ <div+ style={{+ display: 'flex',+ flexDirection: 'column',+ width: '100%',+ height: '100%',+ backgroundColor: 'white',+ padding: '60px 80px',+ fontFamily: 'Inter',+ position: 'relative',+ }}+ >+ {/* Green accent bar */}+ <div+ style={{+ position: 'absolute',+ top: 0,+ left: 0,+ right: 0,+ height: '6px',+ backgroundColor: '#6DC947',+ }}+ />++ {/* Top: Logo */}+ <div+ style={{+ display: 'flex',+ alignItems: 'center',+ gap: '16px',+ }}+ >+ {/* eslint-disable-next-line @next/next/no-img-element */}+ <img src={logoSrc} alt="Documenso" height="28" />+ <span+ style={{+ color: '#D4D4D8',+ fontSize: '28px',+ fontWeight: 400,+ }}+ >+ |+ </span>+ <span style={{ color: '#71717A', fontSize: '20px', fontWeight: 400 }}>Docs</span>+ </div>++ {/* Middle: Title + description */}+ <div+ style={{+ display: 'flex',+ flexDirection: 'column',+ flex: 1,+ justifyContent: 'center',+ gap: '16px',+ }}+ >+ <h1+ style={{+ color: '#18181B',+ fontSize: page.data.title.length > 40 ? '48px' : '56px',+ fontWeight: 700,+ lineHeight: 1.15,+ letterSpacing: '-0.025em',+ margin: 0,+ }}+ >+ {page.data.title}+ </h1>+ {page.data.description && (+ <p+ style={{+ color: '#71717A',+ fontSize: '22px',+ fontWeight: 400,+ lineHeight: 1.4,+ margin: 0,+ maxWidth: '900px',+ overflow: 'hidden',+ textOverflow: 'ellipsis',+ display: '-webkit-box',+ WebkitLineClamp: 2,+ WebkitBoxOrient: 'vertical',+ }}+ >+ {page.data.description}+ </p>+ )}+ </div>++ {/* Bottom: URL */}+ <div style={{ display: 'flex', alignItems: 'center' }}>+ <span style={{ color: '#A1A1AA', fontSize: '16px', fontWeight: 400 }}>+ docs.documenso.com{page.url}+ </span>+ </div>+ </div>+ ),+ {+ width: 1200,+ height: 630,+ fonts,+ },+ );+}++export function generateStaticParams() {+ return source.getPages().map((page) => ({+ lang: page.locale,+ slug: getPageImage(page).segments,+ }));+}diff --git a/apps/docs/src/app/robots.ts b/apps/docs/src/app/robots.tsnew file mode 100644index 000000000..d40f56db2--- /dev/null+++ b/apps/docs/src/app/robots.ts@@ -0,0 +1,12 @@+import type { MetadataRoute } from 'next';++export default function robots(): MetadataRoute.Robots {+ return {+ rules: {+ userAgent: '*',+ allow: '/',+ },+ host: 'https://docs.documenso.com',+ sitemap: 'https://docs.documenso.com/sitemap.xml',+ };+}diff --git a/apps/docs/src/app/sitemap.ts b/apps/docs/src/app/sitemap.tsnew file mode 100644index 000000000..e965b3ae7--- /dev/null+++ b/apps/docs/src/app/sitemap.ts@@ -0,0 +1,20 @@+import type { MetadataRoute } from 'next';++import { source } from '@/lib/source';++const BASE_URL = 'https://docs.documenso.com';++export default function sitemap(): MetadataRoute.Sitemap {+ return [+ {+ url: BASE_URL,+ changeFrequency: 'weekly',+ priority: 1.0,+ },+ ...source.getPages().map((page) => ({+ url: `${BASE_URL}${page.url}`,+ changeFrequency: 'weekly' as const,+ priority: 0.7,+ })),+ ];+}diff --git a/apps/docs/src/components/ai/page-actions.tsx b/apps/docs/src/components/ai/page-actions.tsxnew file mode 100644index 000000000..705eaef89--- /dev/null+++ b/apps/docs/src/components/ai/page-actions.tsx@@ -0,0 +1,168 @@+'use client';++import { useMemo, useState } from 'react';++import { cn } from '@/lib/cn';+import { buttonVariants } from 'fumadocs-ui/components/ui/button';+import { Popover, PopoverContent, PopoverTrigger } from 'fumadocs-ui/components/ui/popover';+import { useCopyButton } from 'fumadocs-ui/utils/use-copy-button';+import { Check, ChevronDown, Copy, ExternalLinkIcon, MessageCircleIcon } from 'lucide-react';++const cache = new Map<string, string>();++export function LLMCopyButton({+ /**+ * A URL to fetch the raw Markdown/MDX content of page+ */+ markdownUrl,+}: {+ markdownUrl: string;+}) {+ const [isLoading, setLoading] = useState(false);+ const [checked, onClick] = useCopyButton(async () => {+ const cached = cache.get(markdownUrl);+ if (cached) return navigator.clipboard.writeText(cached);++ setLoading(true);++ try {+ await navigator.clipboard.write([+ new ClipboardItem({+ 'text/plain': fetch(markdownUrl).then(async (res) => {+ const content = await res.text();+ cache.set(markdownUrl, content);++ return content;+ }),+ }),+ ]);+ } finally {+ setLoading(false);+ }+ });++ return (+ <button+ disabled={isLoading}+ className={cn(+ buttonVariants({+ color: 'secondary',+ size: 'sm',+ className: '[&_svg]:text-fd-muted-foreground gap-2 [&_svg]:size-3.5',+ }),+ )}+ onClick={onClick}+ >+ {checked ? <Check /> : <Copy />}+ Copy Markdown+ </button>+ );+}++export function ViewOptions({+ markdownUrl,+ githubUrl,+}: {+ /**+ * A URL to the raw Markdown/MDX content of page+ */+ markdownUrl: string;++ /**+ * Source file URL on GitHub+ */+ githubUrl: string;+}) {+ const items = useMemo(() => {+ const fullMarkdownUrl =+ typeof window !== 'undefined' ? new URL(markdownUrl, window.location.origin) : 'loading';+ const q = `Read ${fullMarkdownUrl}, I want to ask questions about it.`;++ return [+ {+ title: 'Open in GitHub',+ href: githubUrl,+ icon: (+ <svg fill="currentColor" role="img" viewBox="0 0 24 24">+ <title>GitHub</title>+ <path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12" />+ </svg>+ ),+ },+ {+ title: 'Open in ChatGPT',+ href: `https://chatgpt.com/?${new URLSearchParams({+ hints: 'search',+ q,+ })}`,+ icon: (+ <svg+ role="img"+ viewBox="0 0 24 24"+ fill="currentColor"+ xmlns="http://www.w3.org/2000/svg"+ >+ <title>OpenAI</title>+ <path d="M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z" />+ </svg>+ ),+ },+ {+ title: 'Open in Claude',+ href: `https://claude.ai/new?${new URLSearchParams({+ q,+ })}`,+ icon: (+ <svg+ fill="currentColor"+ role="img"+ viewBox="0 0 24 24"+ xmlns="http://www.w3.org/2000/svg"+ >+ <title>Anthropic</title>+ <path d="M17.3041 3.541h-3.6718l6.696 16.918H24Zm-10.6082 0L0 20.459h3.7442l1.3693-3.5527h7.0052l1.3693 3.5528h3.7442L10.5363 3.5409Zm-.3712 10.2232 2.2914-5.9456 2.2914 5.9456Z" />+ </svg>+ ),+ },+ {+ title: 'Open in T3 Chat',+ href: `https://t3.chat/new?${new URLSearchParams({+ q,+ })}`,+ icon: <MessageCircleIcon />,+ },+ ];+ }, [githubUrl, markdownUrl]);++ return (+ <Popover>+ <PopoverTrigger+ className={cn(+ buttonVariants({+ color: 'secondary',+ size: 'sm',+ className: 'gap-2',+ }),+ )}+ >+ Open+ <ChevronDown className="text-fd-muted-foreground size-3.5" />+ </PopoverTrigger>+ <PopoverContent className="flex flex-col">+ {items.map((item) => (+ <a+ key={item.href}+ href={item.href}+ rel="noreferrer noopener"+ target="_blank"+ className="hover:text-fd-accent-foreground hover:bg-fd-accent inline-flex items-center gap-2 rounded-lg p-2 text-sm [&_svg]:size-4"+ >+ {item.icon}+ {item.title}+ <ExternalLinkIcon className="text-fd-muted-foreground ms-auto size-3.5" />+ </a>+ ))}+ </PopoverContent>+ </Popover>+ );+}diff --git a/apps/docs/src/components/mdx/mermaid.tsx b/apps/docs/src/components/mdx/mermaid.tsxnew file mode 100644index 000000000..70ebbec1b--- /dev/null+++ b/apps/docs/src/components/mdx/mermaid.tsx@@ -0,0 +1,65 @@+'use client';++import { use, useEffect, useId, useState } from 'react';++import { useTheme } from 'next-themes';++export const Mermaid = ({ chart }: { chart: string }) => {+ const [mounted, setMounted] = useState(false);++ useEffect(() => {+ setMounted(true);+ }, []);++ if (!mounted) {+ return null;+ }++ return <MermaidContent chart={chart} />;+};++const cache = new Map<string, Promise<unknown>>();++const cachePromise = async <T,>(key: string, setPromise: () => Promise<T>): Promise<T> => {+ const cached = cache.get(key);++ if (cached) {+ return cached as Promise<T>;+ }++ const promise = setPromise();+ cache.set(key, promise);++ return promise;+};++const MermaidContent = ({ chart }: { chart: string }) => {+ const id = useId();+ const { resolvedTheme } = useTheme();+ const { default: mermaid } = use(cachePromise('mermaid', async () => import('mermaid')));++ mermaid.initialize({+ startOnLoad: false,+ securityLevel: 'loose',+ fontFamily: 'inherit',+ themeCSS: 'margin: 1.5rem auto 0;',+ theme: resolvedTheme === 'dark' ? 'dark' : 'default',+ });++ const { svg, bindFunctions } = use(+ cachePromise(`${chart}-${resolvedTheme}`, async () => {+ return mermaid.render(id, chart.replaceAll('\\n', '\n'));+ }),+ );++ return (+ <div+ ref={(container) => {+ if (container) {+ bindFunctions?.(container);+ }+ }}+ dangerouslySetInnerHTML={{ __html: svg }}+ />+ );+};diff --git a/apps/docs/src/lib/cn.ts b/apps/docs/src/lib/cn.tsnew file mode 100644index 000000000..ba66fd250--- /dev/null+++ b/apps/docs/src/lib/cn.ts@@ -0,0 +1 @@+export { twMerge as cn } from 'tailwind-merge';diff --git a/apps/docs/src/lib/layout.shared.tsx b/apps/docs/src/lib/layout.shared.tsxnew file mode 100644index 000000000..4fa45f37d--- /dev/null+++ b/apps/docs/src/lib/layout.shared.tsx@@ -0,0 +1,23 @@+import type { BaseLayoutProps } from 'fumadocs-ui/layouts/shared';++export function baseOptions(): BaseLayoutProps {+ return {+ nav: {+ title: (+ <span className="flex items-center gap-2 font-semibold">+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 84 84" className="size-6">+ <g fill="currentColor">+ <path d="M35.53 12.152c-.968.879-2.038 1.91-3.261 3.118a4.55 4.55 0 0 1-2.722.97l-4.098.079 1.194-1.194C33.883 7.885 37.502 4.265 42 4.265s8.118 3.62 15.357 10.86l1.192 1.192-3.957-.075a4.55 4.55 0 0 1-3.004-1.209l-2.373-2.194a69 69 0 0 0-.66-.61l-.128-.119h-.002a35 35 0 0 0-2.244-1.892C44.17 8.684 43 8.338 42 8.338s-2.17.346-4.18 1.88a35 35 0 0 0-2.275 1.92zM71.77 35.444a69 69 0 0 0-.608-.658l-2.196-2.374a4.55 4.55 0 0 1-1.208-3.002l-.077-3.961 1.194 1.194c7.24 7.24 10.86 10.859 10.86 15.357s-3.62 8.118-10.86 15.357l-1.194 1.194.077-3.961a4.55 4.55 0 0 1 1.209-3.002l2.195-2.373q.315-.338.609-.66l.119-.128v-.002a35 35 0 0 0 1.892-2.244c1.534-2.01 1.88-3.18 1.88-4.181s-.346-2.17-1.88-4.18a35 35 0 0 0-1.892-2.245v-.002zM48.51 71.813q.362-.33.747-.69l2.331-2.157a4.55 4.55 0 0 1 3.003-1.208l3.959-.076-1.193 1.193c-7.24 7.24-10.859 10.86-15.357 10.86s-8.118-3.62-15.357-10.86l-1.194-1.194 3.97.076a4.55 4.55 0 0 1 2.991 1.2l1.601 1.47c1.461 1.4 2.69 2.502 3.808 3.355 2.01 1.534 3.18 1.88 4.181 1.88s2.17-.346 4.18-1.88a35 35 0 0 0 2.275-1.92zM12.156 48.476q.364.4.763.825l2.115 2.287a4.55 4.55 0 0 1 1.209 3.002l.076 3.961-1.194-1.194C7.885 50.117 4.265 46.498 4.265 42s3.62-8.118 10.86-15.357l1.193-1.193-.075 3.959a4.55 4.55 0 0 1-1.21 3.004l-2.18 2.357q-.325.346-.626.676l-.117.127v.002a35 35 0 0 0-1.892 2.244C8.684 39.83 8.338 41 8.338 42s.346 2.17 1.88 4.18a35 35 0 0 0 1.92 2.275z" />+ <path d="m12.138 35.543 2.896-3.13a4.55 4.55 0 0 0 1.186-2.626c.012-1.61.038-3.013.096-4.254l.003-.17.006-.005c.053-1.072.131-2.021.246-2.875.337-2.506.92-3.578 1.627-4.286s1.78-1.29 4.285-1.626c.87-.117 1.838-.196 2.935-.25l.002-.002h.06c1.285-.062 2.746-.089 4.43-.1a4.55 4.55 0 0 0 2.711-1.257l2.923-2.825h-1.688c-10.238 0-15.357 0-18.538 3.18-3.18 3.181-3.18 8.3-3.18 18.539zM12.138 48.456v1.688c0 10.239 0 15.358 3.18 18.538s8.3 3.18 18.538 3.18h16.289c10.238 0 15.357 0 18.538-3.18 3.18-3.18 3.18-8.3 3.18-18.537v-1.69l-2.897 3.133a4.55 4.55 0 0 0-1.185 2.618c-.012 1.645-.039 3.075-.1 4.335v.04h-.001a35 35 0 0 1-.25 2.936c-.337 2.506-.92 3.578-1.627 4.286s-1.78 1.29-4.285 1.626c-.855.115-1.804.194-2.876.247l-.005.005-.149.003c-1.246.058-2.658.085-4.277.097-.976.1-1.897.515-2.623 1.185l-3.132 2.897H35.573l-3.163-2.906a4.55 4.55 0 0 0-2.61-1.176 110 110 0 0 1-4.324-.1h-.056l-.002-.002a35 35 0 0 1-2.935-.25c-2.505-.336-3.578-.919-4.285-1.626-.708-.708-1.29-1.78-1.627-4.286a35 35 0 0 1-.25-2.935l-.002-.002-.001-.075c-.06-1.251-.086-2.668-.098-4.296a4.55 4.55 0 0 0-1.186-2.621zM67.781 29.794a4.55 4.55 0 0 0 1.185 2.618l2.897 3.132v-1.688c0-10.239 0-15.358-3.18-18.538s-8.3-3.18-18.538-3.18h-1.689l3.132 2.895a4.55 4.55 0 0 0 2.627 1.186c1.6.012 2.997.038 4.232.096l.247.004.008.008a34 34 0 0 1 2.816.244c2.505.337 3.578.919 4.285 1.626.708.708 1.29 1.78 1.627 4.286.117.87.196 1.839.25 2.936l.001.04c.061 1.26.088 2.69.1 4.335M38.91 23.96l-2.747 2.33a2.9 2.9 0 0 1-1.747.689l-4.597.214 2.397-2.397c4.627-4.627 6.94-6.94 9.815-6.94s5.188 2.313 9.815 6.94l2.383 2.382-4.662-.202a2.9 2.9 0 0 1-1.773-.703l-2.074-1.789c-.728-.685-1.345-1.226-1.908-1.656-1.154-.88-1.592-.9-1.78-.9-.19 0-.627.02-1.781.9l-.055.042h-.003l-.027.023c-.387.3-.8.652-1.257 1.067" />+ <path d="M61.023 39.995c-.785-.992-1.911-2.163-3.542-3.803a2.9 2.9 0 0 1-.44-1.426l-.202-4.977 2.369 2.368c4.627 4.627 6.94 6.94 6.94 9.815s-2.313 5.188-6.94 9.815l-2.382 2.381.23-4.757a2.9 2.9 0 0 1 .727-1.787l1.742-1.968a28 28 0 0 0 1.387-1.569l.215-.242v-.03l.049-.062c.88-1.154.9-1.592.9-1.781 0-.19-.02-.627-.9-1.78l-.049-.064v-.024zM22.946 40.124l3.175-3.454c.45-.489.719-1.117.762-1.78l.175-2.71c.027-.86.071-1.584.144-2.216l.012-.192.013-.013.009-.065c.193-1.438.488-1.762.622-1.896s.457-.429 1.896-.622c.461-.062.974-.106 1.555-.138l3.9-.385a2.9 2.9 0 0 0 1.678-.75l3.296-3.017h-3.357c-6.543 0-9.815 0-11.847 2.033-1.732 1.732-1.988 4.363-2.026 9.15q-.009 1.246-.007 2.698v3.356" />+ <path d="M22.946 43.82v3.357c0 .97 0 1.866.006 2.698.038 4.787.295 7.418 2.027 9.15 1.731 1.732 4.362 1.988 9.15 2.026q1.246.009 2.697.007h10.411q1.45.002 2.697-.007c4.788-.038 7.419-.294 9.15-2.026 2.033-2.033 2.033-5.304 2.033-11.848V43.81l-3.384 3.67a2.9 2.9 0 0 0-.69 1.29c-.006 2.38-.038 4.033-.193 5.306l-.002.068-.008.008-.012.098c-.194 1.438-.489 1.762-.623 1.896-.133.133-.457.429-1.895.622l-.099.013-.008.008-.114.007c-.724.086-1.57.133-2.602.159l-2.32.141c-.661.04-1.288.305-1.778.75l-3.538 3.212h-3.697l-3.536-3.306a2.9 2.9 0 0 0-1.69-.769q-.41 0-.79-.004c-1.906-.016-3.288-.063-4.384-.21-1.439-.194-1.762-.49-1.896-.623-.134-.134-.429-.458-.622-1.896l-.009-.065-.012-.013-.002-.027-.004-.108c-.13-1.084-.171-2.442-.185-4.283l-.02-.472a2.9 2.9 0 0 0-.755-1.833zM57.01 32.35l.19 2.586c.049.652.315 1.27.757 1.751l3.16 3.447v-3.367c0-6.544 0-9.815-2.032-11.848s-5.305-2.033-11.848-2.033H43.85l3.391 3.09c.475.432 1.08.696 1.721.748l3.933.322q.562.033 1.045.085l.29.024.013.012.066.01c1.438.192 1.762.488 1.895.621.134.134.43.458.623 1.896.098.733.152 1.595.182 2.655" />+ <path d="m27.226 54.158-.013-.013.002.027.012.013zM29.849 56.78l4.289.199c-1.852-.015-3.208-.06-4.29-.198M27.044 49.476a3 3 0 0 0-.08-.57 3 3 0 0 1 .04.376l.02.472c.014 1.84.056 3.2.185 4.283l.004.108.013.013zM17.915 41.972c0 2.45 1.679 4.491 5.038 7.903q-.009-1.246-.007-2.698v-3.344l-.007-.008v-.005l-.052-.068c-.88-1.153-.9-1.59-.9-1.78s.02-.627.9-1.78l.059-.077v-3.348q-.001-1.452.006-2.698c-3.358 3.412-5.037 5.454-5.037 7.903M40.25 61.116l-.048-.037h-.01l-.022-.021h-3.344q-1.45.002-2.697-.007c3.412 3.358 5.453 5.038 7.902 5.038 2.45 0 4.491-1.68 7.903-5.038q-1.246.009-2.697.007h-3.35l-.075.058c-1.154.88-1.592.9-1.78.9-.19 0-.627-.02-1.781-.9" />+ </g>+ </svg>+ Documenso+ </span>+ ),+ },+ githubUrl: 'https://github.com/documenso/documenso',+ };+}diff --git a/apps/docs/src/lib/merge-refs.ts b/apps/docs/src/lib/merge-refs.tsnew file mode 100644index 000000000..cf019f13b--- /dev/null+++ b/apps/docs/src/lib/merge-refs.ts@@ -0,0 +1,13 @@+import type * as React from 'react';++export function mergeRefs<T>(...refs: (React.Ref<T> | undefined)[]): React.RefCallback<T> {+ return (value) => {+ refs.forEach((ref) => {+ if (typeof ref === 'function') {+ ref(value);+ } else if (ref) {+ ref.current = value;+ }+ });+ };+}diff --git a/apps/docs/src/lib/source.ts b/apps/docs/src/lib/source.tsnew file mode 100644index 000000000..0f995f2e8--- /dev/null+++ b/apps/docs/src/lib/source.ts@@ -0,0 +1,84 @@+import type * as PageTree from 'fumadocs-core/page-tree';+import { type InferPageType, loader } from 'fumadocs-core/source';+import { lucideIconsPlugin } from 'fumadocs-core/source/lucide-icons';+import { docs } from 'fumadocs-mdx:collections/server';++// See https://fumadocs.dev/docs/headless/source-api for more info+export const source = loader({+ baseUrl: '/docs',+ source: docs.toFumadocsSource(),+ plugins: [lucideIconsPlugin()],+});++// Shared sections that should appear in all main section sidebars+const SHARED_SECTIONS = ['concepts', 'compliance', 'policies'];++// Section titles for the sidebar separators+const SECTION_TITLES: Record<string, string> = {+ users: 'User Guide',+ developers: 'Developer Guide',+ 'self-hosting': 'Self-Hosting Guide',+};++/**+ * Get a filtered page tree showing a specific root folder's content+ * plus the shared sections (Concepts, Compliance, Policies)+ */+export function getFilteredPageTree(rootName: string): PageTree.Root {+ const fullTree = source.getPageTree();++ // Find the main section folder+ const rootFolder = fullTree.children.find(+ (child): child is PageTree.Folder =>+ child.type === 'folder' &&+ typeof child.name === 'string' &&+ child.name.toLowerCase() === rootName.toLowerCase(),+ );++ if (!rootFolder) {+ return fullTree;+ }++ // Find shared section folders+ const sharedFolders = fullTree.children.filter(+ (child): child is PageTree.Folder =>+ child.type === 'folder' &&+ typeof child.name === 'string' &&+ SHARED_SECTIONS.includes(child.name.toLowerCase()),+ );++ // Create separator for main section+ const mainSeparator: PageTree.Separator = {+ type: 'separator',+ name: SECTION_TITLES[rootName.toLowerCase()] || rootName,+ };++ // Create separator for shared sections+ const sharedSeparator: PageTree.Separator = {+ type: 'separator',+ name: 'Resources',+ };++ // Return a new tree with separators and content+ return {+ name: fullTree.name,+ children: [mainSeparator, ...rootFolder.children, sharedSeparator, ...sharedFolders],+ };+}++export function getPageImage(page: InferPageType<typeof source>) {+ const segments = [...page.slugs, 'image.png'];++ return {+ segments,+ url: `/og/docs/${segments.join('/')}`,+ };+}++export async function getLLMText(page: InferPageType<typeof source>) {+ const processed = await page.data.getText('processed');++ return `# ${page.data.title}++${processed}`;+}diff --git a/apps/docs/src/mdx-components.tsx b/apps/docs/src/mdx-components.tsxnew file mode 100644index 000000000..008027298--- /dev/null+++ b/apps/docs/src/mdx-components.tsx@@ -0,0 +1,14 @@+import { Mermaid } from '@/components/mdx/mermaid';+import * as TabsComponents from 'fumadocs-ui/components/tabs';+import defaultMdxComponents from 'fumadocs-ui/mdx';+import type { MDXComponents } from 'mdx/types';++// eslint-disable-next-line @typescript-eslint/no-explicit-any+export function getMDXComponents(components?: MDXComponents): any {+ return {+ ...defaultMdxComponents,+ ...TabsComponents,+ Mermaid,+ ...components,+ };+}diff --git a/apps/docs/tsconfig.json b/apps/docs/tsconfig.jsonnew file mode 100644index 000000000..77775fb39--- /dev/null+++ b/apps/docs/tsconfig.json@@ -0,0 +1,46 @@+{+ "compilerOptions": {+ "baseUrl": ".",+ "target": "ESNext",+ "lib": [+ "dom",+ "dom.iterable",+ "esnext"+ ],+ "allowJs": true,+ "skipLibCheck": true,+ "strict": true,+ "forceConsistentCasingInFileNames": true,+ "noEmit": true,+ "esModuleInterop": true,+ "module": "esnext",+ "moduleResolution": "bundler",+ "resolveJsonModule": true,+ "isolatedModules": true,+ "jsx": "react-jsx",+ "incremental": true,+ "paths": {+ "@/*": [+ "./src/*"+ ],+ "fumadocs-mdx:collections/*": [+ ".source/*"+ ]+ },+ "plugins": [+ {+ "name": "next"+ }+ ]+ },+ "include": [+ "next-env.d.ts",+ "**/*.ts",+ "**/*.tsx",+ ".next/types/**/*.ts",+ ".next/dev/types/**/*.ts"+ ],+ "exclude": [+ "node_modules"+ ]+}\ No newline at end of filediff --git a/package-lock.json b/package-lock.jsonindex 8137a0437..33cc95bfb 100644--- a/package-lock.json+++ b/package-lock.json@@ -70,6 +70,546 @@"npm": ">=10.7.0"}},+ "apps/docs": {+ "name": "@documenso/docs",+ "version": "0.0.0",+ "hasInstallScript": true,+ "dependencies": {+ "@radix-ui/react-tabs": "^1.1.13",+ "fumadocs-core": "16.5.0",+ "fumadocs-mdx": "14.2.6",+ "fumadocs-ui": "16.5.0",+ "lucide-react": "^0.563.0",+ "mermaid": "^11.12.2",+ "next": "16.1.6",+ "next-plausible": "^3.12.5",+ "next-themes": "^0.4.6",+ "react": "^19.2.4",+ "react-dom": "^19.2.4",+ "tailwind-merge": "^3.4.0"+ },+ "devDependencies": {+ "@tailwindcss/postcss": "^4.1.18",+ "@types/mdx": "^2.0.13",+ "@types/node": "^25.1.0",+ "@types/react": "^19.2.10",+ "@types/react-dom": "^19.2.3",+ "postcss": "^8.5.6",+ "tailwindcss": "^4.1.18",+ "typescript": "^5.9.3"+ }+ },+ "apps/docs/node_modules/@next/env": {+ "version": "16.1.6",+ "resolved": "https://registry.npmjs.org/@next/env/-/env-16.1.6.tgz",+ "integrity": "sha512-N1ySLuZjnAtN3kFnwhAwPvZah8RJxKasD7x1f8shFqhncnWZn4JMfg37diLNuoHsLAlrDfM3g4mawVdtAG8XLQ==",+ "license": "MIT"+ },+ "apps/docs/node_modules/@next/swc-darwin-arm64": {+ "version": "16.1.6",+ "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-16.1.6.tgz",+ "integrity": "sha512-wTzYulosJr/6nFnqGW7FrG3jfUUlEf8UjGA0/pyypJl42ExdVgC6xJgcXQ+V8QFn6niSG2Pb8+MIG1mZr2vczw==",+ "cpu": [+ "arm64"+ ],+ "license": "MIT",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": ">= 10"+ }+ },+ "apps/docs/node_modules/@next/swc-darwin-x64": {+ "version": "16.1.6",+ "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-16.1.6.tgz",+ "integrity": "sha512-BLFPYPDO+MNJsiDWbeVzqvYd4NyuRrEYVB5k2N3JfWncuHAy2IVwMAOlVQDFjj+krkWzhY2apvmekMkfQR0CUQ==",+ "cpu": [+ "x64"+ ],+ "license": "MIT",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": ">= 10"+ }+ },+ "apps/docs/node_modules/@next/swc-linux-arm64-gnu": {+ "version": "16.1.6",+ "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-16.1.6.tgz",+ "integrity": "sha512-OJYkCd5pj/QloBvoEcJ2XiMnlJkRv9idWA/j0ugSuA34gMT6f5b7vOiCQHVRpvStoZUknhl6/UxOXL4OwtdaBw==",+ "cpu": [+ "arm64"+ ],+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">= 10"+ }+ },+ "apps/docs/node_modules/@next/swc-linux-arm64-musl": {+ "version": "16.1.6",+ "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-16.1.6.tgz",+ "integrity": "sha512-S4J2v+8tT3NIO9u2q+S0G5KdvNDjXfAv06OhfOzNDaBn5rw84DGXWndOEB7d5/x852A20sW1M56vhC/tRVbccQ==",+ "cpu": [+ "arm64"+ ],+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">= 10"+ }+ },+ "apps/docs/node_modules/@next/swc-linux-x64-gnu": {+ "version": "16.1.6",+ "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-16.1.6.tgz",+ "integrity": "sha512-2eEBDkFlMMNQnkTyPBhQOAyn2qMxyG2eE7GPH2WIDGEpEILcBPI/jdSv4t6xupSP+ot/jkfrCShLAa7+ZUPcJQ==",+ "cpu": [+ "x64"+ ],+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">= 10"+ }+ },+ "apps/docs/node_modules/@next/swc-linux-x64-musl": {+ "version": "16.1.6",+ "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-16.1.6.tgz",+ "integrity": "sha512-oicJwRlyOoZXVlxmIMaTq7f8pN9QNbdes0q2FXfRsPhfCi8n8JmOZJm5oo1pwDaFbnnD421rVU409M3evFbIqg==",+ "cpu": [+ "x64"+ ],+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">= 10"+ }+ },+ "apps/docs/node_modules/@next/swc-win32-arm64-msvc": {+ "version": "16.1.6",+ "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-16.1.6.tgz",+ "integrity": "sha512-gQmm8izDTPgs+DCWH22kcDmuUp7NyiJgEl18bcr8irXA5N2m2O+JQIr6f3ct42GOs9c0h8QF3L5SzIxcYAAXXw==",+ "cpu": [+ "arm64"+ ],+ "license": "MIT",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": ">= 10"+ }+ },+ "apps/docs/node_modules/@next/swc-win32-x64-msvc": {+ "version": "16.1.6",+ "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-16.1.6.tgz",+ "integrity": "sha512-NRfO39AIrzBnixKbjuo2YiYhB6o9d8v/ymU9m/Xk8cyVk+k7XylniXkHwjs4s70wedVffc6bQNbufk5v0xEm0A==",+ "cpu": [+ "x64"+ ],+ "license": "MIT",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": ">= 10"+ }+ },+ "apps/docs/node_modules/@types/node": {+ "version": "25.3.2",+ "resolved": "https://registry.npmjs.org/@types/node/-/node-25.3.2.tgz",+ "integrity": "sha512-RpV6r/ij22zRRdyBPcxDeKAzH43phWVKEjL2iksqo1Vz3CuBUrgmPpPhALKiRfU7OMCmeeO9vECBMsV0hMTG8Q==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "undici-types": "~7.18.0"+ }+ },+ "apps/docs/node_modules/@types/react": {+ "version": "19.2.14",+ "resolved": "https://registry.npmjs.org/@types/react/-/react-19.2.14.tgz",+ "integrity": "sha512-ilcTH/UniCkMdtexkoCN0bI7pMcJDvmQFPvuPvmEaYA/NSfFTAgdUSLAoVjaRJm7+6PvcM+q1zYOwS4wTYMF9w==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "csstype": "^3.2.2"+ }+ },+ "apps/docs/node_modules/@types/react-dom": {+ "version": "19.2.3",+ "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-19.2.3.tgz",+ "integrity": "sha512-jp2L/eY6fn+KgVVQAOqYItbF0VY/YApe5Mz2F0aykSO8gx31bYCZyvSeYxCHKvzHG5eZjc+zyaS5BrBWya2+kQ==",+ "dev": true,+ "license": "MIT",+ "peerDependencies": {+ "@types/react": "^19.2.0"+ }+ },+ "apps/docs/node_modules/chokidar": {+ "version": "5.0.0",+ "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-5.0.0.tgz",+ "integrity": "sha512-TQMmc3w+5AxjpL8iIiwebF73dRDF4fBIieAqGn9RGCWaEVwQ6Fb2cGe31Yns0RRIzii5goJ1Y7xbMwo1TxMplw==",+ "license": "MIT",+ "dependencies": {+ "readdirp": "^5.0.0"+ },+ "engines": {+ "node": ">= 20.19.0"+ },+ "funding": {+ "url": "https://paulmillr.com/funding/"+ }+ },+ "apps/docs/node_modules/esbuild": {+ "version": "0.27.3",+ "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.27.3.tgz",+ "integrity": "sha512-8VwMnyGCONIs6cWue2IdpHxHnAjzxnw2Zr7MkVxB2vjmQ2ivqGFb4LEG3SMnv0Gb2F/G/2yA8zUaiL1gywDCCg==",+ "hasInstallScript": true,+ "license": "MIT",+ "bin": {+ "esbuild": "bin/esbuild"+ },+ "engines": {+ "node": ">=18"+ },+ "optionalDependencies": {+ "@esbuild/aix-ppc64": "0.27.3",+ "@esbuild/android-arm": "0.27.3",+ "@esbuild/android-arm64": "0.27.3",+ "@esbuild/android-x64": "0.27.3",+ "@esbuild/darwin-arm64": "0.27.3",+ "@esbuild/darwin-x64": "0.27.3",+ "@esbuild/freebsd-arm64": "0.27.3",+ "@esbuild/freebsd-x64": "0.27.3",+ "@esbuild/linux-arm": "0.27.3",+ "@esbuild/linux-arm64": "0.27.3",+ "@esbuild/linux-ia32": "0.27.3",+ "@esbuild/linux-loong64": "0.27.3",+ "@esbuild/linux-mips64el": "0.27.3",+ "@esbuild/linux-ppc64": "0.27.3",+ "@esbuild/linux-riscv64": "0.27.3",+ "@esbuild/linux-s390x": "0.27.3",+ "@esbuild/linux-x64": "0.27.3",+ "@esbuild/netbsd-arm64": "0.27.3",+ "@esbuild/netbsd-x64": "0.27.3",+ "@esbuild/openbsd-arm64": "0.27.3",+ "@esbuild/openbsd-x64": "0.27.3",+ "@esbuild/openharmony-arm64": "0.27.3",+ "@esbuild/sunos-x64": "0.27.3",+ "@esbuild/win32-arm64": "0.27.3",+ "@esbuild/win32-ia32": "0.27.3",+ "@esbuild/win32-x64": "0.27.3"+ }+ },+ "apps/docs/node_modules/fumadocs-mdx": {+ "version": "14.2.6",+ "resolved": "https://registry.npmjs.org/fumadocs-mdx/-/fumadocs-mdx-14.2.6.tgz",+ "integrity": "sha512-T8i5IllZ6OGaZ3/4Wwjl1zovvypSsr6Cco9ZACvoABLqpqTQ2TDfrW1nBt1o9YUKyfzkwDnjKdrnrq/nDexfcg==",+ "license": "MIT",+ "dependencies": {+ "@mdx-js/mdx": "^3.1.1",+ "@standard-schema/spec": "^1.1.0",+ "chokidar": "^5.0.0",+ "esbuild": "^0.27.2",+ "estree-util-value-to-estree": "^3.5.0",+ "js-yaml": "^4.1.1",+ "mdast-util-to-markdown": "^2.1.2",+ "picocolors": "^1.1.1",+ "picomatch": "^4.0.3",+ "remark-mdx": "^3.1.1",+ "tinyexec": "^1.0.2",+ "tinyglobby": "^0.2.15",+ "unified": "^11.0.5",+ "unist-util-remove-position": "^5.0.0",+ "unist-util-visit": "^5.0.0",+ "vfile": "^6.0.3",+ "zod": "^4.3.5"+ },+ "bin": {+ "fumadocs-mdx": "dist/bin.js"+ },+ "peerDependencies": {+ "@fumadocs/mdx-remote": "^1.4.0",+ "@types/react": "*",+ "fumadocs-core": "^15.0.0 || ^16.0.0",+ "next": "^15.3.0 || ^16.0.0",+ "react": "*",+ "vite": "6.x.x || 7.x.x"+ },+ "peerDependenciesMeta": {+ "@fumadocs/mdx-remote": {+ "optional": true+ },+ "@types/react": {+ "optional": true+ },+ "next": {+ "optional": true+ },+ "react": {+ "optional": true+ },+ "vite": {+ "optional": true+ }+ }+ },+ "apps/docs/node_modules/fumadocs-ui": {+ "version": "16.5.0",+ "resolved": "https://registry.npmjs.org/fumadocs-ui/-/fumadocs-ui-16.5.0.tgz",+ "integrity": "sha512-eKpU3A7HpvGxbXd5ipZcouW/NEqVFWyHIagbbl82c49vqBKSiAJFi51XrpTqmS079PxTXZUpQoTe8zONUWHB/w==",+ "license": "MIT",+ "dependencies": {+ "@fumadocs/ui": "16.5.0",+ "@radix-ui/react-accordion": "^1.2.12",+ "@radix-ui/react-collapsible": "^1.1.12",+ "@radix-ui/react-dialog": "^1.1.15",+ "@radix-ui/react-direction": "^1.1.1",+ "@radix-ui/react-navigation-menu": "^1.2.14",+ "@radix-ui/react-popover": "^1.1.15",+ "@radix-ui/react-presence": "^1.1.5",+ "@radix-ui/react-scroll-area": "^1.2.10",+ "@radix-ui/react-slot": "^1.2.4",+ "@radix-ui/react-tabs": "^1.1.13",+ "class-variance-authority": "^0.7.1",+ "lucide-react": "^0.563.0",+ "next-themes": "^0.4.6",+ "react-medium-image-zoom": "^5.4.0",+ "scroll-into-view-if-needed": "^3.1.0"+ },+ "peerDependencies": {+ "@types/react": "*",+ "fumadocs-core": "16.5.0",+ "next": "16.x.x",+ "react": "^19.2.0",+ "react-dom": "^19.2.0",+ "tailwindcss": "^4.0.0"+ },+ "peerDependenciesMeta": {+ "@types/react": {+ "optional": true+ },+ "next": {+ "optional": true+ },+ "tailwindcss": {+ "optional": true+ }+ }+ },+ "apps/docs/node_modules/lucide-react": {+ "version": "0.563.0",+ "resolved": "https://registry.npmjs.org/lucide-react/-/lucide-react-0.563.0.tgz",+ "integrity": "sha512-8dXPB2GI4dI8jV4MgUDGBeLdGk8ekfqVZ0BdLcrRzocGgG75ltNEmWS+gE7uokKF/0oSUuczNDT+g9hFJ23FkA==",+ "license": "ISC",+ "peerDependencies": {+ "react": "^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0"+ }+ },+ "apps/docs/node_modules/nanoid": {+ "version": "3.3.11",+ "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz",+ "integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==",+ "funding": [+ {+ "type": "github",+ "url": "https://github.com/sponsors/ai"+ }+ ],+ "license": "MIT",+ "bin": {+ "nanoid": "bin/nanoid.cjs"+ },+ "engines": {+ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"+ }+ },+ "apps/docs/node_modules/next": {+ "version": "16.1.6",+ "resolved": "https://registry.npmjs.org/next/-/next-16.1.6.tgz",+ "integrity": "sha512-hkyRkcu5x/41KoqnROkfTm2pZVbKxvbZRuNvKXLRXxs3VfyO0WhY50TQS40EuKO9SW3rBj/sF3WbVwDACeMZyw==",+ "license": "MIT",+ "dependencies": {+ "@next/env": "16.1.6",+ "@swc/helpers": "0.5.15",+ "baseline-browser-mapping": "^2.8.3",+ "caniuse-lite": "^1.0.30001579",+ "postcss": "8.4.31",+ "styled-jsx": "5.1.6"+ },+ "bin": {+ "next": "dist/bin/next"+ },+ "engines": {+ "node": ">=20.9.0"+ },+ "optionalDependencies": {+ "@next/swc-darwin-arm64": "16.1.6",+ "@next/swc-darwin-x64": "16.1.6",+ "@next/swc-linux-arm64-gnu": "16.1.6",+ "@next/swc-linux-arm64-musl": "16.1.6",+ "@next/swc-linux-x64-gnu": "16.1.6",+ "@next/swc-linux-x64-musl": "16.1.6",+ "@next/swc-win32-arm64-msvc": "16.1.6",+ "@next/swc-win32-x64-msvc": "16.1.6",+ "sharp": "^0.34.4"+ },+ "peerDependencies": {+ "@opentelemetry/api": "^1.1.0",+ "@playwright/test": "^1.51.1",+ "babel-plugin-react-compiler": "*",+ "react": "^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0",+ "react-dom": "^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0",+ "sass": "^1.3.0"+ },+ "peerDependenciesMeta": {+ "@opentelemetry/api": {+ "optional": true+ },+ "@playwright/test": {+ "optional": true+ },+ "babel-plugin-react-compiler": {+ "optional": true+ },+ "sass": {+ "optional": true+ }+ }+ },+ "apps/docs/node_modules/next/node_modules/postcss": {+ "version": "8.4.31",+ "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz",+ "integrity": "sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==",+ "funding": [+ {+ "type": "opencollective",+ "url": "https://opencollective.com/postcss/"+ },+ {+ "type": "tidelift",+ "url": "https://tidelift.com/funding/github/npm/postcss"+ },+ {+ "type": "github",+ "url": "https://github.com/sponsors/ai"+ }+ ],+ "license": "MIT",+ "dependencies": {+ "nanoid": "^3.3.6",+ "picocolors": "^1.0.0",+ "source-map-js": "^1.0.2"+ },+ "engines": {+ "node": "^10 || ^12 || >=14"+ }+ },+ "apps/docs/node_modules/react": {+ "version": "19.2.4",+ "resolved": "https://registry.npmjs.org/react/-/react-19.2.4.tgz",+ "integrity": "sha512-9nfp2hYpCwOjAN+8TZFGhtWEwgvWHXqESH8qT89AT/lWklpLON22Lc8pEtnpsZz7VmawabSU0gCjnj8aC0euHQ==",+ "license": "MIT",+ "engines": {+ "node": ">=0.10.0"+ }+ },+ "apps/docs/node_modules/react-dom": {+ "version": "19.2.4",+ "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.4.tgz",+ "integrity": "sha512-AXJdLo8kgMbimY95O2aKQqsz2iWi9jMgKJhRBAxECE4IFxfcazB2LmzloIoibJI3C12IlY20+KFaLv+71bUJeQ==",+ "license": "MIT",+ "dependencies": {+ "scheduler": "^0.27.0"+ },+ "peerDependencies": {+ "react": "^19.2.4"+ }+ },+ "apps/docs/node_modules/readdirp": {+ "version": "5.0.0",+ "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-5.0.0.tgz",+ "integrity": "sha512-9u/XQ1pvrQtYyMpZe7DXKv2p5CNvyVwzUB6uhLAnQwHMSgKMBR62lc7AHljaeteeHXn11XTAaLLUVZYVZyuRBQ==",+ "license": "MIT",+ "engines": {+ "node": ">= 20.19.0"+ },+ "funding": {+ "type": "individual",+ "url": "https://paulmillr.com/funding/"+ }+ },+ "apps/docs/node_modules/scheduler": {+ "version": "0.27.0",+ "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.27.0.tgz",+ "integrity": "sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q==",+ "license": "MIT"+ },+ "apps/docs/node_modules/tailwind-merge": {+ "version": "3.5.0",+ "resolved": "https://registry.npmjs.org/tailwind-merge/-/tailwind-merge-3.5.0.tgz",+ "integrity": "sha512-I8K9wewnVDkL1NTGoqWmVEIlUcB9gFriAEkXkfCjX5ib8ezGxtR3xD7iZIxrfArjEsH7F1CHD4RFUtxefdqV/A==",+ "license": "MIT",+ "funding": {+ "type": "github",+ "url": "https://github.com/sponsors/dcastil"+ }+ },+ "apps/docs/node_modules/tailwindcss": {+ "version": "4.2.1",+ "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.2.1.tgz",+ "integrity": "sha512-/tBrSQ36vCleJkAOsy9kbNTgaxvGbyOamC30PRePTQe/o1MFwEKHQk4Cn7BNGaPtjp+PuUrByJehM1hgxfq4sw==",+ "dev": true,+ "license": "MIT"+ },+ "apps/docs/node_modules/typescript": {+ "version": "5.9.3",+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz",+ "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",+ "dev": true,+ "license": "Apache-2.0",+ "bin": {+ "tsc": "bin/tsc",+ "tsserver": "bin/tsserver"+ },+ "engines": {+ "node": ">=14.17"+ }+ },+ "apps/docs/node_modules/undici-types": {+ "version": "7.18.2",+ "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.18.2.tgz",+ "integrity": "sha512-AsuCzffGHJybSaRrmr5eHr81mwJU3kjw6M+uprWvCXiNeN9SOGwQ3Jn8jb8m3Z6izVgknn1R0FTCEAP2QrLY/w==",+ "dev": true,+ "license": "MIT"+ },+ "apps/docs/node_modules/zod": {+ "version": "4.3.6",+ "resolved": "https://registry.npmjs.org/zod/-/zod-4.3.6.tgz",+ "integrity": "sha512-rftlrkhHZOcjDwkGlnUtZZkvaPHCsDATp4pGpuOOMDaTdDDXF91wuVDJoWoPsKX/3YPQ5fHuF3STjcYyKr+Qhg==",+ "license": "MIT",+ "funding": {+ "url": "https://github.com/sponsors/colinhacks"+ }+ },"apps/documentation": {"name": "@documenso/documentation","version": "0.1.0",@@ -2327,6 +2867,10 @@"resolved": "packages/auth","link": true},+ "node_modules/@documenso/docs": {+ "resolved": "apps/docs",+ "link": true+ },"node_modules/@documenso/documentation": {"resolved": "apps/documentation","link": true@@ -2476,7 +3020,6 @@"cpu": ["ppc64"],- "dev": true,"license": "MIT","optional": true,"os": [@@ -2493,7 +3036,6 @@"cpu": ["arm"],- "dev": true,"license": "MIT","optional": true,"os": [@@ -2510,7 +3052,6 @@"cpu": ["arm64"],- "dev": true,"license": "MIT","optional": true,"os": [@@ -2527,7 +3068,6 @@"cpu": ["x64"],- "dev": true,"license": "MIT","optional": true,"os": [@@ -2544,7 +3084,6 @@"cpu": ["arm64"],- "dev": true,"license": "MIT","optional": true,"os": [@@ -2561,7 +3100,6 @@"cpu": ["x64"],- "dev": true,"license": "MIT","optional": true,"os": [@@ -2578,7 +3116,6 @@"cpu": ["arm64"],- "dev": true,"license": "MIT","optional": true,"os": [@@ -2595,7 +3132,6 @@"cpu": ["x64"],- "dev": true,"license": "MIT","optional": true,"os": [@@ -2612,7 +3148,6 @@"cpu": ["arm"],- "dev": true,"license": "MIT","optional": true,"os": [@@ -2629,7 +3164,6 @@"cpu": ["arm64"],- "dev": true,"license": "MIT","optional": true,"os": [@@ -2646,7 +3180,6 @@"cpu": ["ia32"],- "dev": true,"license": "MIT","optional": true,"os": [@@ -2663,7 +3196,6 @@"cpu": ["loong64"],- "dev": true,"license": "MIT","optional": true,"os": [@@ -2680,7 +3212,6 @@"cpu": ["mips64el"],- "dev": true,"license": "MIT","optional": true,"os": [@@ -2697,7 +3228,6 @@"cpu": ["ppc64"],- "dev": true,"license": "MIT","optional": true,"os": [@@ -2714,7 +3244,6 @@"cpu": ["riscv64"],- "dev": true,"license": "MIT","optional": true,"os": [@@ -2731,7 +3260,6 @@"cpu": ["s390x"],- "dev": true,"license": "MIT","optional": true,"os": [@@ -2748,7 +3276,6 @@"cpu": ["x64"],- "dev": true,"license": "MIT","optional": true,"os": [@@ -2765,7 +3292,6 @@"cpu": ["arm64"],- "dev": true,"license": "MIT","optional": true,"os": [@@ -2782,7 +3308,6 @@"cpu": ["x64"],- "dev": true,"license": "MIT","optional": true,"os": [@@ -2799,7 +3324,6 @@"cpu": ["arm64"],- "dev": true,"license": "MIT","optional": true,"os": [@@ -2816,7 +3340,6 @@"cpu": ["x64"],- "dev": true,"license": "MIT","optional": true,"os": [@@ -2833,7 +3356,6 @@"cpu": ["arm64"],- "dev": true,"license": "MIT","optional": true,"os": [@@ -2850,7 +3372,6 @@"cpu": ["x64"],- "dev": true,"license": "MIT","optional": true,"os": [@@ -2867,7 +3388,6 @@"cpu": ["arm64"],- "dev": true,"license": "MIT","optional": true,"os": [@@ -2884,7 +3404,6 @@"cpu": ["ia32"],- "dev": true,"license": "MIT","optional": true,"os": [@@ -2901,7 +3420,6 @@"cpu": ["x64"],- "dev": true,"license": "MIT","optional": true,"os": [@@ -3061,6 +3579,15 @@"integrity": "sha512-aGTxbpbg8/b5JfU1HXSrbH3wXZuLPJcNEcZQFMxLs3oSzgtVu6nFPkbbGGUvBcUjKV2YyB9Wxxabo+HEH9tcRQ==","license": "MIT"},+ "node_modules/@formatjs/fast-memoize": {+ "version": "3.1.0",+ "resolved": "https://registry.npmjs.org/@formatjs/fast-memoize/-/fast-memoize-3.1.0.tgz",+ "integrity": "sha512-b5mvSWCI+XVKiz5WhnBCY3RJ4ZwfjAidU0yVlKa3d3MSgKmH1hC3tBGEAtYyN5mqL7N0G5x0BOUYyO8CEupWgg==",+ "license": "MIT",+ "dependencies": {+ "tslib": "^2.8.1"+ }+ },"node_modules/@formatjs/intl-localematcher": {"version": "0.5.10","resolved": "https://registry.npmjs.org/@formatjs/intl-localematcher/-/intl-localematcher-0.5.10.tgz",@@ -3070,6 +3597,59 @@"tslib": "2"}},+ "node_modules/@fumadocs/ui": {+ "version": "16.5.0",+ "resolved": "https://registry.npmjs.org/@fumadocs/ui/-/ui-16.5.0.tgz",+ "integrity": "sha512-64P3QqnN5SjjqsKLIoA/6Tgzrs05JthZSa4RxuTCmXMXkjKOV6m6x6hanQrDzX1M27xVIlwuDrxLBzA21t0CgQ==",+ "license": "MIT",+ "dependencies": {+ "next-themes": "^0.4.6",+ "postcss-selector-parser": "^7.1.1",+ "tailwind-merge": "^3.4.0"+ },+ "peerDependencies": {+ "@types/react": "*",+ "fumadocs-core": "16.5.0",+ "next": "16.x.x",+ "react": "^19.2.0",+ "react-dom": "^19.2.0",+ "tailwindcss": "^4.0.0"+ },+ "peerDependenciesMeta": {+ "@types/react": {+ "optional": true+ },+ "next": {+ "optional": true+ },+ "tailwindcss": {+ "optional": true+ }+ }+ },+ "node_modules/@fumadocs/ui/node_modules/postcss-selector-parser": {+ "version": "7.1.1",+ "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.1.1.tgz",+ "integrity": "sha512-orRsuYpJVw8LdAwqqLykBj9ecS5/cRHlI5+nvTo8LcCKmzDmqVORXtOIYEEQuL9D4BxtA1lm5isAqzQZCoQ6Eg==",+ "license": "MIT",+ "dependencies": {+ "cssesc": "^3.0.0",+ "util-deprecate": "^1.0.2"+ },+ "engines": {+ "node": ">=4"+ }+ },+ "node_modules/@fumadocs/ui/node_modules/tailwind-merge": {+ "version": "3.5.0",+ "resolved": "https://registry.npmjs.org/tailwind-merge/-/tailwind-merge-3.5.0.tgz",+ "integrity": "sha512-I8K9wewnVDkL1NTGoqWmVEIlUcB9gFriAEkXkfCjX5ib8ezGxtR3xD7iZIxrfArjEsH7F1CHD4RFUtxefdqV/A==",+ "license": "MIT",+ "funding": {+ "type": "github",+ "url": "https://github.com/sponsors/dcastil"+ }+ },"node_modules/@google-cloud/kms": {"version": "5.2.1","resolved": "https://registry.npmjs.org/@google-cloud/kms/-/kms-5.2.1.tgz",@@ -3297,34 +3877,22 @@}}},- "node_modules/@hono/vite-dev-server/node_modules/balanced-match": {- "version": "4.0.4",- "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz",- "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==",- "license": "MIT",- "engines": {- "node": "18 || 20 || >=22"- }- },"node_modules/@hono/vite-dev-server/node_modules/brace-expansion": {- "version": "5.0.3",- "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.3.tgz",- "integrity": "sha512-fy6KJm2RawA5RcHkLa1z/ScpBeA762UF9KmZQxwIbDtRJrgLzM10depAiEQ+CXYcoiqW1/m96OAAoke2nE9EeA==",+ "version": "2.0.2",+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz",+ "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==","license": "MIT","dependencies": {- "balanced-match": "^4.0.2"- },- "engines": {- "node": "18 || 20 || >=22"+ "balanced-match": "^1.0.0"}},"node_modules/@hono/vite-dev-server/node_modules/minimatch": {- "version": "9.0.8",- "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.8.tgz",- "integrity": "sha512-reYkDYtj/b19TeqbNZCV4q9t+Yxylf/rYBsLb42SXJatTv4/ylq5lEiAmhA/IToxO7NI2UzNMghHoHuaqDkAjw==",+ "version": "9.0.9",+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.9.tgz",+ "integrity": "sha512-OBwBN9AL4dqmETlpS2zasx+vTeWclWzkblfZk7KTA5j3jeOONz/tRCnZomUyvNg83wL5Zv9Ss6HMJXAgL8R2Yg==","license": "ISC","dependencies": {- "brace-expansion": "^5.0.2"+ "brace-expansion": "^2.0.2"},"engines": {"node": ">=16 || 14 >=14.17"@@ -3930,9 +4498,9 @@}},"node_modules/@inngest/ai/node_modules/@types/node": {- "version": "22.19.11",- "resolved": "https://registry.npmjs.org/@types/node/-/node-22.19.11.tgz",- "integrity": "sha512-BH7YwL6rA93ReqeQS1c4bsPpcfOmJasG+Fkr6Y59q83f9M1WcBRHR2vM+P9eOisYRcN3ujQoiZY8uk5W+1WL8w==",+ "version": "22.19.13",+ "resolved": "https://registry.npmjs.org/@types/node/-/node-22.19.13.tgz",+ "integrity": "sha512-akNQMv0wW5uyRpD2v2IEyRSZiR+BeGuoB6L310EgGObO44HSMNT8z1xzio28V8qOrgYaopIDNA18YgdXd+qTiw==","license": "MIT","dependencies": {"undici-types": "~6.21.0"@@ -3968,12 +4536,12 @@}},"node_modules/@isaacs/cliui/node_modules/strip-ansi": {- "version": "7.1.2",- "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz",- "integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==",+ "version": "7.2.0",+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.2.0.tgz",+ "integrity": "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==","license": "MIT","dependencies": {- "ansi-regex": "^6.0.1"+ "ansi-regex": "^6.2.2"},"engines": {"node": ">=12"@@ -5894,9 +6462,9 @@}},"node_modules/@opentelemetry/auto-instrumentations-node/node_modules/@opentelemetry/semantic-conventions": {- "version": "1.39.0",- "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.39.0.tgz",- "integrity": "sha512-R5R9tb2AXs2IRLNKLBJDynhkfmx7mX0vi8NkhZb3gUkPWHn6HXk5J8iQ/dql0U3ApfWym4kXXmBDRGO+oeOfjg==",+ "version": "1.40.0",+ "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.40.0.tgz",+ "integrity": "sha512-cifvXDhcqMwwTlTK04GBNeIe7yyo28Mfby85QXFe1Yk8nmi36Ab/5UQwptOx84SsoGNRg+EVSjwzfSZMy6pmlw==","license": "Apache-2.0","engines": {"node": ">=14"@@ -6111,9 +6679,9 @@}},"node_modules/@opentelemetry/exporter-logs-otlp-grpc/node_modules/@opentelemetry/semantic-conventions": {- "version": "1.39.0",- "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.39.0.tgz",- "integrity": "sha512-R5R9tb2AXs2IRLNKLBJDynhkfmx7mX0vi8NkhZb3gUkPWHn6HXk5J8iQ/dql0U3ApfWym4kXXmBDRGO+oeOfjg==",+ "version": "1.40.0",+ "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.40.0.tgz",+ "integrity": "sha512-cifvXDhcqMwwTlTK04GBNeIe7yyo28Mfby85QXFe1Yk8nmi36Ab/5UQwptOx84SsoGNRg+EVSjwzfSZMy6pmlw==","license": "Apache-2.0","engines": {"node": ">=14"@@ -6269,9 +6837,9 @@}},"node_modules/@opentelemetry/exporter-logs-otlp-http/node_modules/@opentelemetry/semantic-conventions": {- "version": "1.39.0",- "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.39.0.tgz",- "integrity": "sha512-R5R9tb2AXs2IRLNKLBJDynhkfmx7mX0vi8NkhZb3gUkPWHn6HXk5J8iQ/dql0U3ApfWym4kXXmBDRGO+oeOfjg==",+ "version": "1.40.0",+ "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.40.0.tgz",+ "integrity": "sha512-cifvXDhcqMwwTlTK04GBNeIe7yyo28Mfby85QXFe1Yk8nmi36Ab/5UQwptOx84SsoGNRg+EVSjwzfSZMy6pmlw==","license": "Apache-2.0","engines": {"node": ">=14"@@ -6429,9 +6997,9 @@}},"node_modules/@opentelemetry/exporter-logs-otlp-proto/node_modules/@opentelemetry/semantic-conventions": {- "version": "1.39.0",- "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.39.0.tgz",- "integrity": "sha512-R5R9tb2AXs2IRLNKLBJDynhkfmx7mX0vi8NkhZb3gUkPWHn6HXk5J8iQ/dql0U3ApfWym4kXXmBDRGO+oeOfjg==",+ "version": "1.40.0",+ "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.40.0.tgz",+ "integrity": "sha512-cifvXDhcqMwwTlTK04GBNeIe7yyo28Mfby85QXFe1Yk8nmi36Ab/5UQwptOx84SsoGNRg+EVSjwzfSZMy6pmlw==","license": "Apache-2.0","engines": {"node": ">=14"@@ -6590,9 +7158,9 @@}},"node_modules/@opentelemetry/exporter-metrics-otlp-grpc/node_modules/@opentelemetry/semantic-conventions": {- "version": "1.39.0",- "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.39.0.tgz",- "integrity": "sha512-R5R9tb2AXs2IRLNKLBJDynhkfmx7mX0vi8NkhZb3gUkPWHn6HXk5J8iQ/dql0U3ApfWym4kXXmBDRGO+oeOfjg==",+ "version": "1.40.0",+ "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.40.0.tgz",+ "integrity": "sha512-cifvXDhcqMwwTlTK04GBNeIe7yyo28Mfby85QXFe1Yk8nmi36Ab/5UQwptOx84SsoGNRg+EVSjwzfSZMy6pmlw==","license": "Apache-2.0","engines": {"node": ">=14"@@ -6748,9 +7316,9 @@}},"node_modules/@opentelemetry/exporter-metrics-otlp-http/node_modules/@opentelemetry/semantic-conventions": {- "version": "1.39.0",- "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.39.0.tgz",- "integrity": "sha512-R5R9tb2AXs2IRLNKLBJDynhkfmx7mX0vi8NkhZb3gUkPWHn6HXk5J8iQ/dql0U3ApfWym4kXXmBDRGO+oeOfjg==",+ "version": "1.40.0",+ "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.40.0.tgz",+ "integrity": "sha512-cifvXDhcqMwwTlTK04GBNeIe7yyo28Mfby85QXFe1Yk8nmi36Ab/5UQwptOx84SsoGNRg+EVSjwzfSZMy6pmlw==","license": "Apache-2.0","engines": {"node": ">=14"@@ -6907,9 +7475,9 @@}},"node_modules/@opentelemetry/exporter-metrics-otlp-proto/node_modules/@opentelemetry/semantic-conventions": {- "version": "1.39.0",- "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.39.0.tgz",- "integrity": "sha512-R5R9tb2AXs2IRLNKLBJDynhkfmx7mX0vi8NkhZb3gUkPWHn6HXk5J8iQ/dql0U3ApfWym4kXXmBDRGO+oeOfjg==",+ "version": "1.40.0",+ "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.40.0.tgz",+ "integrity": "sha512-cifvXDhcqMwwTlTK04GBNeIe7yyo28Mfby85QXFe1Yk8nmi36Ab/5UQwptOx84SsoGNRg+EVSjwzfSZMy6pmlw==","license": "Apache-2.0","engines": {"node": ">=14"@@ -6980,9 +7548,9 @@}},"node_modules/@opentelemetry/exporter-prometheus/node_modules/@opentelemetry/semantic-conventions": {- "version": "1.39.0",- "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.39.0.tgz",- "integrity": "sha512-R5R9tb2AXs2IRLNKLBJDynhkfmx7mX0vi8NkhZb3gUkPWHn6HXk5J8iQ/dql0U3ApfWym4kXXmBDRGO+oeOfjg==",+ "version": "1.40.0",+ "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.40.0.tgz",+ "integrity": "sha512-cifvXDhcqMwwTlTK04GBNeIe7yyo28Mfby85QXFe1Yk8nmi36Ab/5UQwptOx84SsoGNRg+EVSjwzfSZMy6pmlw==","license": "Apache-2.0","engines": {"node": ">=14"@@ -7140,9 +7708,9 @@}},"node_modules/@opentelemetry/exporter-trace-otlp-grpc/node_modules/@opentelemetry/semantic-conventions": {- "version": "1.39.0",- "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.39.0.tgz",- "integrity": "sha512-R5R9tb2AXs2IRLNKLBJDynhkfmx7mX0vi8NkhZb3gUkPWHn6HXk5J8iQ/dql0U3ApfWym4kXXmBDRGO+oeOfjg==",+ "version": "1.40.0",+ "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.40.0.tgz",+ "integrity": "sha512-cifvXDhcqMwwTlTK04GBNeIe7yyo28Mfby85QXFe1Yk8nmi36Ab/5UQwptOx84SsoGNRg+EVSjwzfSZMy6pmlw==","license": "Apache-2.0","engines": {"node": ">=14"@@ -7317,9 +7885,9 @@}},"node_modules/@opentelemetry/exporter-trace-otlp-proto/node_modules/@opentelemetry/semantic-conventions": {- "version": "1.39.0",- "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.39.0.tgz",- "integrity": "sha512-R5R9tb2AXs2IRLNKLBJDynhkfmx7mX0vi8NkhZb3gUkPWHn6HXk5J8iQ/dql0U3ApfWym4kXXmBDRGO+oeOfjg==",+ "version": "1.40.0",+ "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.40.0.tgz",+ "integrity": "sha512-cifvXDhcqMwwTlTK04GBNeIe7yyo28Mfby85QXFe1Yk8nmi36Ab/5UQwptOx84SsoGNRg+EVSjwzfSZMy6pmlw==","license": "Apache-2.0","engines": {"node": ">=14"@@ -7392,9 +7960,9 @@}},"node_modules/@opentelemetry/exporter-zipkin/node_modules/@opentelemetry/semantic-conventions": {- "version": "1.39.0",- "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.39.0.tgz",- "integrity": "sha512-R5R9tb2AXs2IRLNKLBJDynhkfmx7mX0vi8NkhZb3gUkPWHn6HXk5J8iQ/dql0U3ApfWym4kXXmBDRGO+oeOfjg==",+ "version": "1.40.0",+ "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.40.0.tgz",+ "integrity": "sha512-cifvXDhcqMwwTlTK04GBNeIe7yyo28Mfby85QXFe1Yk8nmi36Ab/5UQwptOx84SsoGNRg+EVSjwzfSZMy6pmlw==","license": "Apache-2.0","engines": {"node": ">=14"@@ -7481,9 +8049,9 @@}},"node_modules/@opentelemetry/instrumentation-amqplib/node_modules/@opentelemetry/semantic-conventions": {- "version": "1.39.0",- "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.39.0.tgz",- "integrity": "sha512-R5R9tb2AXs2IRLNKLBJDynhkfmx7mX0vi8NkhZb3gUkPWHn6HXk5J8iQ/dql0U3ApfWym4kXXmBDRGO+oeOfjg==",+ "version": "1.40.0",+ "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.40.0.tgz",+ "integrity": "sha512-cifvXDhcqMwwTlTK04GBNeIe7yyo28Mfby85QXFe1Yk8nmi36Ab/5UQwptOx84SsoGNRg+EVSjwzfSZMy6pmlw==","license": "Apache-2.0","engines": {"node": ">=14"@@ -7659,9 +8227,9 @@}},"node_modules/@opentelemetry/instrumentation-aws-sdk/node_modules/@opentelemetry/semantic-conventions": {- "version": "1.39.0",- "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.39.0.tgz",- "integrity": "sha512-R5R9tb2AXs2IRLNKLBJDynhkfmx7mX0vi8NkhZb3gUkPWHn6HXk5J8iQ/dql0U3ApfWym4kXXmBDRGO+oeOfjg==",+ "version": "1.40.0",+ "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.40.0.tgz",+ "integrity": "sha512-cifvXDhcqMwwTlTK04GBNeIe7yyo28Mfby85QXFe1Yk8nmi36Ab/5UQwptOx84SsoGNRg+EVSjwzfSZMy6pmlw==","license": "Apache-2.0","engines": {"node": ">=14"@@ -7913,9 +8481,9 @@}},"node_modules/@opentelemetry/instrumentation-connect/node_modules/@opentelemetry/semantic-conventions": {- "version": "1.39.0",- "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.39.0.tgz",- "integrity": "sha512-R5R9tb2AXs2IRLNKLBJDynhkfmx7mX0vi8NkhZb3gUkPWHn6HXk5J8iQ/dql0U3ApfWym4kXXmBDRGO+oeOfjg==",+ "version": "1.40.0",+ "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.40.0.tgz",+ "integrity": "sha512-cifvXDhcqMwwTlTK04GBNeIe7yyo28Mfby85QXFe1Yk8nmi36Ab/5UQwptOx84SsoGNRg+EVSjwzfSZMy6pmlw==","license": "Apache-2.0","engines": {"node": ">=14"@@ -8240,9 +8808,9 @@}},"node_modules/@opentelemetry/instrumentation-express/node_modules/@opentelemetry/semantic-conventions": {- "version": "1.39.0",- "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.39.0.tgz",- "integrity": "sha512-R5R9tb2AXs2IRLNKLBJDynhkfmx7mX0vi8NkhZb3gUkPWHn6HXk5J8iQ/dql0U3ApfWym4kXXmBDRGO+oeOfjg==",+ "version": "1.40.0",+ "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.40.0.tgz",+ "integrity": "sha512-cifvXDhcqMwwTlTK04GBNeIe7yyo28Mfby85QXFe1Yk8nmi36Ab/5UQwptOx84SsoGNRg+EVSjwzfSZMy6pmlw==","license": "Apache-2.0","engines": {"node": ">=14"@@ -8341,9 +8909,9 @@}},"node_modules/@opentelemetry/instrumentation-fastify/node_modules/@opentelemetry/semantic-conventions": {- "version": "1.39.0",- "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.39.0.tgz",- "integrity": "sha512-R5R9tb2AXs2IRLNKLBJDynhkfmx7mX0vi8NkhZb3gUkPWHn6HXk5J8iQ/dql0U3ApfWym4kXXmBDRGO+oeOfjg==",+ "version": "1.40.0",+ "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.40.0.tgz",+ "integrity": "sha512-cifvXDhcqMwwTlTK04GBNeIe7yyo28Mfby85QXFe1Yk8nmi36Ab/5UQwptOx84SsoGNRg+EVSjwzfSZMy6pmlw==","license": "Apache-2.0","engines": {"node": ">=14"@@ -8441,9 +9009,9 @@}},"node_modules/@opentelemetry/instrumentation-fs/node_modules/@opentelemetry/semantic-conventions": {- "version": "1.39.0",- "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.39.0.tgz",- "integrity": "sha512-R5R9tb2AXs2IRLNKLBJDynhkfmx7mX0vi8NkhZb3gUkPWHn6HXk5J8iQ/dql0U3ApfWym4kXXmBDRGO+oeOfjg==",+ "version": "1.40.0",+ "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.40.0.tgz",+ "integrity": "sha512-cifvXDhcqMwwTlTK04GBNeIe7yyo28Mfby85QXFe1Yk8nmi36Ab/5UQwptOx84SsoGNRg+EVSjwzfSZMy6pmlw==","license": "Apache-2.0","engines": {"node": ">=14"@@ -8676,9 +9244,9 @@}},"node_modules/@opentelemetry/instrumentation-grpc/node_modules/@opentelemetry/semantic-conventions": {- "version": "1.39.0",- "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.39.0.tgz",- "integrity": "sha512-R5R9tb2AXs2IRLNKLBJDynhkfmx7mX0vi8NkhZb3gUkPWHn6HXk5J8iQ/dql0U3ApfWym4kXXmBDRGO+oeOfjg==",+ "version": "1.40.0",+ "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.40.0.tgz",+ "integrity": "sha512-cifvXDhcqMwwTlTK04GBNeIe7yyo28Mfby85QXFe1Yk8nmi36Ab/5UQwptOx84SsoGNRg+EVSjwzfSZMy6pmlw==","license": "Apache-2.0","engines": {"node": ">=14"@@ -8777,9 +9345,9 @@}},"node_modules/@opentelemetry/instrumentation-hapi/node_modules/@opentelemetry/semantic-conventions": {- "version": "1.39.0",- "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.39.0.tgz",- "integrity": "sha512-R5R9tb2AXs2IRLNKLBJDynhkfmx7mX0vi8NkhZb3gUkPWHn6HXk5J8iQ/dql0U3ApfWym4kXXmBDRGO+oeOfjg==",+ "version": "1.40.0",+ "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.40.0.tgz",+ "integrity": "sha512-cifvXDhcqMwwTlTK04GBNeIe7yyo28Mfby85QXFe1Yk8nmi36Ab/5UQwptOx84SsoGNRg+EVSjwzfSZMy6pmlw==","license": "Apache-2.0","engines": {"node": ">=14"@@ -8879,9 +9447,9 @@}},"node_modules/@opentelemetry/instrumentation-http/node_modules/@opentelemetry/semantic-conventions": {- "version": "1.39.0",- "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.39.0.tgz",- "integrity": "sha512-R5R9tb2AXs2IRLNKLBJDynhkfmx7mX0vi8NkhZb3gUkPWHn6HXk5J8iQ/dql0U3ApfWym4kXXmBDRGO+oeOfjg==",+ "version": "1.40.0",+ "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.40.0.tgz",+ "integrity": "sha512-cifvXDhcqMwwTlTK04GBNeIe7yyo28Mfby85QXFe1Yk8nmi36Ab/5UQwptOx84SsoGNRg+EVSjwzfSZMy6pmlw==","license": "Apache-2.0","engines": {"node": ">=14"@@ -9040,9 +9608,9 @@}},"node_modules/@opentelemetry/instrumentation-kafkajs/node_modules/@opentelemetry/semantic-conventions": {- "version": "1.39.0",- "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.39.0.tgz",- "integrity": "sha512-R5R9tb2AXs2IRLNKLBJDynhkfmx7mX0vi8NkhZb3gUkPWHn6HXk5J8iQ/dql0U3ApfWym4kXXmBDRGO+oeOfjg==",+ "version": "1.40.0",+ "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.40.0.tgz",+ "integrity": "sha512-cifvXDhcqMwwTlTK04GBNeIe7yyo28Mfby85QXFe1Yk8nmi36Ab/5UQwptOx84SsoGNRg+EVSjwzfSZMy6pmlw==","license": "Apache-2.0","engines": {"node": ">=14"@@ -9125,9 +9693,9 @@}},"node_modules/@opentelemetry/instrumentation-knex/node_modules/@opentelemetry/semantic-conventions": {- "version": "1.39.0",- "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.39.0.tgz",- "integrity": "sha512-R5R9tb2AXs2IRLNKLBJDynhkfmx7mX0vi8NkhZb3gUkPWHn6HXk5J8iQ/dql0U3ApfWym4kXXmBDRGO+oeOfjg==",+ "version": "1.40.0",+ "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.40.0.tgz",+ "integrity": "sha512-cifvXDhcqMwwTlTK04GBNeIe7yyo28Mfby85QXFe1Yk8nmi36Ab/5UQwptOx84SsoGNRg+EVSjwzfSZMy6pmlw==","license": "Apache-2.0","engines": {"node": ">=14"@@ -9226,9 +9794,9 @@}},"node_modules/@opentelemetry/instrumentation-koa/node_modules/@opentelemetry/semantic-conventions": {- "version": "1.39.0",- "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.39.0.tgz",- "integrity": "sha512-R5R9tb2AXs2IRLNKLBJDynhkfmx7mX0vi8NkhZb3gUkPWHn6HXk5J8iQ/dql0U3ApfWym4kXXmBDRGO+oeOfjg==",+ "version": "1.40.0",+ "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.40.0.tgz",+ "integrity": "sha512-cifvXDhcqMwwTlTK04GBNeIe7yyo28Mfby85QXFe1Yk8nmi36Ab/5UQwptOx84SsoGNRg+EVSjwzfSZMy6pmlw==","license": "Apache-2.0","engines": {"node": ">=14"@@ -9552,9 +10120,9 @@}},"node_modules/@opentelemetry/instrumentation-mongoose/node_modules/@opentelemetry/semantic-conventions": {- "version": "1.39.0",- "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.39.0.tgz",- "integrity": "sha512-R5R9tb2AXs2IRLNKLBJDynhkfmx7mX0vi8NkhZb3gUkPWHn6HXk5J8iQ/dql0U3ApfWym4kXXmBDRGO+oeOfjg==",+ "version": "1.40.0",+ "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.40.0.tgz",+ "integrity": "sha512-cifvXDhcqMwwTlTK04GBNeIe7yyo28Mfby85QXFe1Yk8nmi36Ab/5UQwptOx84SsoGNRg+EVSjwzfSZMy6pmlw==","license": "Apache-2.0","engines": {"node": ">=14"@@ -9714,9 +10282,9 @@}},"node_modules/@opentelemetry/instrumentation-mysql2/node_modules/@opentelemetry/semantic-conventions": {- "version": "1.39.0",- "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.39.0.tgz",- "integrity": "sha512-R5R9tb2AXs2IRLNKLBJDynhkfmx7mX0vi8NkhZb3gUkPWHn6HXk5J8iQ/dql0U3ApfWym4kXXmBDRGO+oeOfjg==",+ "version": "1.40.0",+ "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.40.0.tgz",+ "integrity": "sha512-cifvXDhcqMwwTlTK04GBNeIe7yyo28Mfby85QXFe1Yk8nmi36Ab/5UQwptOx84SsoGNRg+EVSjwzfSZMy6pmlw==","license": "Apache-2.0","engines": {"node": ">=14"@@ -9799,9 +10367,9 @@}},"node_modules/@opentelemetry/instrumentation-nestjs-core/node_modules/@opentelemetry/semantic-conventions": {- "version": "1.39.0",- "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.39.0.tgz",- "integrity": "sha512-R5R9tb2AXs2IRLNKLBJDynhkfmx7mX0vi8NkhZb3gUkPWHn6HXk5J8iQ/dql0U3ApfWym4kXXmBDRGO+oeOfjg==",+ "version": "1.40.0",+ "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.40.0.tgz",+ "integrity": "sha512-cifvXDhcqMwwTlTK04GBNeIe7yyo28Mfby85QXFe1Yk8nmi36Ab/5UQwptOx84SsoGNRg+EVSjwzfSZMy6pmlw==","license": "Apache-2.0","engines": {"node": ">=14"@@ -9960,9 +10528,9 @@}},"node_modules/@opentelemetry/instrumentation-openai/node_modules/@opentelemetry/semantic-conventions": {- "version": "1.39.0",- "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.39.0.tgz",- "integrity": "sha512-R5R9tb2AXs2IRLNKLBJDynhkfmx7mX0vi8NkhZb3gUkPWHn6HXk5J8iQ/dql0U3ApfWym4kXXmBDRGO+oeOfjg==",+ "version": "1.40.0",+ "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.40.0.tgz",+ "integrity": "sha512-cifvXDhcqMwwTlTK04GBNeIe7yyo28Mfby85QXFe1Yk8nmi36Ab/5UQwptOx84SsoGNRg+EVSjwzfSZMy6pmlw==","license": "Apache-2.0","engines": {"node": ">=14"@@ -10046,9 +10614,9 @@}},"node_modules/@opentelemetry/instrumentation-oracledb/node_modules/@opentelemetry/semantic-conventions": {- "version": "1.39.0",- "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.39.0.tgz",- "integrity": "sha512-R5R9tb2AXs2IRLNKLBJDynhkfmx7mX0vi8NkhZb3gUkPWHn6HXk5J8iQ/dql0U3ApfWym4kXXmBDRGO+oeOfjg==",+ "version": "1.40.0",+ "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.40.0.tgz",+ "integrity": "sha512-cifvXDhcqMwwTlTK04GBNeIe7yyo28Mfby85QXFe1Yk8nmi36Ab/5UQwptOx84SsoGNRg+EVSjwzfSZMy6pmlw==","license": "Apache-2.0","engines": {"node": ">=14"@@ -10150,9 +10718,9 @@}},"node_modules/@opentelemetry/instrumentation-pg/node_modules/@opentelemetry/semantic-conventions": {- "version": "1.39.0",- "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.39.0.tgz",- "integrity": "sha512-R5R9tb2AXs2IRLNKLBJDynhkfmx7mX0vi8NkhZb3gUkPWHn6HXk5J8iQ/dql0U3ApfWym4kXXmBDRGO+oeOfjg==",+ "version": "1.40.0",+ "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.40.0.tgz",+ "integrity": "sha512-cifvXDhcqMwwTlTK04GBNeIe7yyo28Mfby85QXFe1Yk8nmi36Ab/5UQwptOx84SsoGNRg+EVSjwzfSZMy6pmlw==","license": "Apache-2.0","engines": {"node": ">=14"@@ -10262,9 +10830,9 @@}},"node_modules/@opentelemetry/instrumentation-pino/node_modules/@opentelemetry/semantic-conventions": {- "version": "1.39.0",- "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.39.0.tgz",- "integrity": "sha512-R5R9tb2AXs2IRLNKLBJDynhkfmx7mX0vi8NkhZb3gUkPWHn6HXk5J8iQ/dql0U3ApfWym4kXXmBDRGO+oeOfjg==",+ "version": "1.40.0",+ "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.40.0.tgz",+ "integrity": "sha512-cifvXDhcqMwwTlTK04GBNeIe7yyo28Mfby85QXFe1Yk8nmi36Ab/5UQwptOx84SsoGNRg+EVSjwzfSZMy6pmlw==","license": "Apache-2.0","engines": {"node": ">=14"@@ -10440,9 +11008,9 @@}},"node_modules/@opentelemetry/instrumentation-restify/node_modules/@opentelemetry/semantic-conventions": {- "version": "1.39.0",- "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.39.0.tgz",- "integrity": "sha512-R5R9tb2AXs2IRLNKLBJDynhkfmx7mX0vi8NkhZb3gUkPWHn6HXk5J8iQ/dql0U3ApfWym4kXXmBDRGO+oeOfjg==",+ "version": "1.40.0",+ "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.40.0.tgz",+ "integrity": "sha512-cifvXDhcqMwwTlTK04GBNeIe7yyo28Mfby85QXFe1Yk8nmi36Ab/5UQwptOx84SsoGNRg+EVSjwzfSZMy6pmlw==","license": "Apache-2.0","engines": {"node": ">=14"@@ -10843,9 +11411,9 @@}},"node_modules/@opentelemetry/instrumentation-undici/node_modules/@opentelemetry/semantic-conventions": {- "version": "1.39.0",- "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.39.0.tgz",- "integrity": "sha512-R5R9tb2AXs2IRLNKLBJDynhkfmx7mX0vi8NkhZb3gUkPWHn6HXk5J8iQ/dql0U3ApfWym4kXXmBDRGO+oeOfjg==",+ "version": "1.40.0",+ "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.40.0.tgz",+ "integrity": "sha512-cifvXDhcqMwwTlTK04GBNeIe7yyo28Mfby85QXFe1Yk8nmi36Ab/5UQwptOx84SsoGNRg+EVSjwzfSZMy6pmlw==","license": "Apache-2.0","engines": {"node": ">=14"@@ -11123,9 +11691,9 @@}},"node_modules/@opentelemetry/otlp-grpc-exporter-base/node_modules/@opentelemetry/semantic-conventions": {- "version": "1.39.0",- "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.39.0.tgz",- "integrity": "sha512-R5R9tb2AXs2IRLNKLBJDynhkfmx7mX0vi8NkhZb3gUkPWHn6HXk5J8iQ/dql0U3ApfWym4kXXmBDRGO+oeOfjg==",+ "version": "1.40.0",+ "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.40.0.tgz",+ "integrity": "sha512-cifvXDhcqMwwTlTK04GBNeIe7yyo28Mfby85QXFe1Yk8nmi36Ab/5UQwptOx84SsoGNRg+EVSjwzfSZMy6pmlw==","license": "Apache-2.0","engines": {"node": ">=14"@@ -11183,9 +11751,9 @@}},"node_modules/@opentelemetry/propagator-b3/node_modules/@opentelemetry/semantic-conventions": {- "version": "1.39.0",- "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.39.0.tgz",- "integrity": "sha512-R5R9tb2AXs2IRLNKLBJDynhkfmx7mX0vi8NkhZb3gUkPWHn6HXk5J8iQ/dql0U3ApfWym4kXXmBDRGO+oeOfjg==",+ "version": "1.40.0",+ "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.40.0.tgz",+ "integrity": "sha512-cifvXDhcqMwwTlTK04GBNeIe7yyo28Mfby85QXFe1Yk8nmi36Ab/5UQwptOx84SsoGNRg+EVSjwzfSZMy6pmlw==","license": "Apache-2.0","engines": {"node": ">=14"@@ -11222,9 +11790,9 @@}},"node_modules/@opentelemetry/propagator-jaeger/node_modules/@opentelemetry/semantic-conventions": {- "version": "1.39.0",- "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.39.0.tgz",- "integrity": "sha512-R5R9tb2AXs2IRLNKLBJDynhkfmx7mX0vi8NkhZb3gUkPWHn6HXk5J8iQ/dql0U3ApfWym4kXXmBDRGO+oeOfjg==",+ "version": "1.40.0",+ "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.40.0.tgz",+ "integrity": "sha512-cifvXDhcqMwwTlTK04GBNeIe7yyo28Mfby85QXFe1Yk8nmi36Ab/5UQwptOx84SsoGNRg+EVSjwzfSZMy6pmlw==","license": "Apache-2.0","engines": {"node": ">=14"@@ -11287,9 +11855,9 @@}},"node_modules/@opentelemetry/resource-detector-alibaba-cloud/node_modules/@opentelemetry/semantic-conventions": {- "version": "1.39.0",- "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.39.0.tgz",- "integrity": "sha512-R5R9tb2AXs2IRLNKLBJDynhkfmx7mX0vi8NkhZb3gUkPWHn6HXk5J8iQ/dql0U3ApfWym4kXXmBDRGO+oeOfjg==",+ "version": "1.40.0",+ "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.40.0.tgz",+ "integrity": "sha512-cifvXDhcqMwwTlTK04GBNeIe7yyo28Mfby85QXFe1Yk8nmi36Ab/5UQwptOx84SsoGNRg+EVSjwzfSZMy6pmlw==","license": "Apache-2.0","engines": {"node": ">=14"@@ -11344,9 +11912,9 @@}},"node_modules/@opentelemetry/resource-detector-aws/node_modules/@opentelemetry/semantic-conventions": {- "version": "1.39.0",- "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.39.0.tgz",- "integrity": "sha512-R5R9tb2AXs2IRLNKLBJDynhkfmx7mX0vi8NkhZb3gUkPWHn6HXk5J8iQ/dql0U3ApfWym4kXXmBDRGO+oeOfjg==",+ "version": "1.40.0",+ "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.40.0.tgz",+ "integrity": "sha512-cifvXDhcqMwwTlTK04GBNeIe7yyo28Mfby85QXFe1Yk8nmi36Ab/5UQwptOx84SsoGNRg+EVSjwzfSZMy6pmlw==","license": "Apache-2.0","engines": {"node": ">=14"@@ -11401,9 +11969,9 @@}},"node_modules/@opentelemetry/resource-detector-azure/node_modules/@opentelemetry/semantic-conventions": {- "version": "1.39.0",- "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.39.0.tgz",- "integrity": "sha512-R5R9tb2AXs2IRLNKLBJDynhkfmx7mX0vi8NkhZb3gUkPWHn6HXk5J8iQ/dql0U3ApfWym4kXXmBDRGO+oeOfjg==",+ "version": "1.40.0",+ "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.40.0.tgz",+ "integrity": "sha512-cifvXDhcqMwwTlTK04GBNeIe7yyo28Mfby85QXFe1Yk8nmi36Ab/5UQwptOx84SsoGNRg+EVSjwzfSZMy6pmlw==","license": "Apache-2.0","engines": {"node": ">=14"@@ -11457,9 +12025,9 @@}},"node_modules/@opentelemetry/resource-detector-container/node_modules/@opentelemetry/semantic-conventions": {- "version": "1.39.0",- "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.39.0.tgz",- "integrity": "sha512-R5R9tb2AXs2IRLNKLBJDynhkfmx7mX0vi8NkhZb3gUkPWHn6HXk5J8iQ/dql0U3ApfWym4kXXmBDRGO+oeOfjg==",+ "version": "1.40.0",+ "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.40.0.tgz",+ "integrity": "sha512-cifvXDhcqMwwTlTK04GBNeIe7yyo28Mfby85QXFe1Yk8nmi36Ab/5UQwptOx84SsoGNRg+EVSjwzfSZMy6pmlw==","license": "Apache-2.0","engines": {"node": ">=14"@@ -11514,9 +12082,9 @@}},"node_modules/@opentelemetry/resource-detector-gcp/node_modules/@opentelemetry/semantic-conventions": {- "version": "1.39.0",- "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.39.0.tgz",- "integrity": "sha512-R5R9tb2AXs2IRLNKLBJDynhkfmx7mX0vi8NkhZb3gUkPWHn6HXk5J8iQ/dql0U3ApfWym4kXXmBDRGO+oeOfjg==",+ "version": "1.40.0",+ "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.40.0.tgz",+ "integrity": "sha512-cifvXDhcqMwwTlTK04GBNeIe7yyo28Mfby85QXFe1Yk8nmi36Ab/5UQwptOx84SsoGNRg+EVSjwzfSZMy6pmlw==","license": "Apache-2.0","engines": {"node": ">=14"@@ -11774,9 +12342,9 @@}},"node_modules/@opentelemetry/sdk-node/node_modules/@opentelemetry/semantic-conventions": {- "version": "1.39.0",- "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.39.0.tgz",- "integrity": "sha512-R5R9tb2AXs2IRLNKLBJDynhkfmx7mX0vi8NkhZb3gUkPWHn6HXk5J8iQ/dql0U3ApfWym4kXXmBDRGO+oeOfjg==",+ "version": "1.40.0",+ "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.40.0.tgz",+ "integrity": "sha512-cifvXDhcqMwwTlTK04GBNeIe7yyo28Mfby85QXFe1Yk8nmi36Ab/5UQwptOx84SsoGNRg+EVSjwzfSZMy6pmlw==","license": "Apache-2.0","engines": {"node": ">=14"@@ -11908,9 +12476,9 @@}},"node_modules/@opentelemetry/sdk-trace-node/node_modules/@opentelemetry/semantic-conventions": {- "version": "1.39.0",- "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.39.0.tgz",- "integrity": "sha512-R5R9tb2AXs2IRLNKLBJDynhkfmx7mX0vi8NkhZb3gUkPWHn6HXk5J8iQ/dql0U3ApfWym4kXXmBDRGO+oeOfjg==",+ "version": "1.40.0",+ "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.40.0.tgz",+ "integrity": "sha512-cifvXDhcqMwwTlTK04GBNeIe7yyo28Mfby85QXFe1Yk8nmi36Ab/5UQwptOx84SsoGNRg+EVSjwzfSZMy6pmlw==","license": "Apache-2.0","engines": {"node": ">=14"@@ -11956,14 +12524,23 @@}},"node_modules/@opentelemetry/sql-common/node_modules/@opentelemetry/semantic-conventions": {- "version": "1.39.0",- "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.39.0.tgz",- "integrity": "sha512-R5R9tb2AXs2IRLNKLBJDynhkfmx7mX0vi8NkhZb3gUkPWHn6HXk5J8iQ/dql0U3ApfWym4kXXmBDRGO+oeOfjg==",+ "version": "1.40.0",+ "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.40.0.tgz",+ "integrity": "sha512-cifvXDhcqMwwTlTK04GBNeIe7yyo28Mfby85QXFe1Yk8nmi36Ab/5UQwptOx84SsoGNRg+EVSjwzfSZMy6pmlw==","license": "Apache-2.0","engines": {"node": ">=14"}},+ "node_modules/@orama/orama": {+ "version": "3.1.18",+ "resolved": "https://registry.npmjs.org/@orama/orama/-/orama-3.1.18.tgz",+ "integrity": "sha512-a61ljmRVVyG5MC/698C8/FfFDw5a8LOIvyOLW5fztgUXqUpc1jOfQzOitSCbge657OgXXThmY3Tk8fpiDb4UcA==",+ "license": "Apache-2.0",+ "engines": {+ "node": ">= 20.0.0"+ }+ },"node_modules/@oslojs/asn1": {"version": "1.0.0","resolved": "https://registry.npmjs.org/@oslojs/asn1/-/asn1-1.0.0.tgz",@@ -15434,6 +16011,126 @@"@shikijs/types": "1.29.2"}},+ "node_modules/@shikijs/rehype": {+ "version": "3.22.0",+ "resolved": "https://registry.npmjs.org/@shikijs/rehype/-/rehype-3.22.0.tgz",+ "integrity": "sha512-69b2VPc6XBy/VmAJlpBU5By+bJSBdE2nvgRCZXav7zujbrjXuT0F60DIrjKuutjPqNufuizE+E8tIZr2Yn8Z+g==",+ "license": "MIT",+ "dependencies": {+ "@shikijs/types": "3.22.0",+ "@types/hast": "^3.0.4",+ "hast-util-to-string": "^3.0.1",+ "shiki": "3.22.0",+ "unified": "^11.0.5",+ "unist-util-visit": "^5.1.0"+ }+ },+ "node_modules/@shikijs/rehype/node_modules/@shikijs/core": {+ "version": "3.22.0",+ "resolved": "https://registry.npmjs.org/@shikijs/core/-/core-3.22.0.tgz",+ "integrity": "sha512-iAlTtSDDbJiRpvgL5ugKEATDtHdUVkqgHDm/gbD2ZS9c88mx7G1zSYjjOxp5Qa0eaW0MAQosFRmJSk354PRoQA==",+ "license": "MIT",+ "dependencies": {+ "@shikijs/types": "3.22.0",+ "@shikijs/vscode-textmate": "^10.0.2",+ "@types/hast": "^3.0.4",+ "hast-util-to-html": "^9.0.5"+ }+ },+ "node_modules/@shikijs/rehype/node_modules/@shikijs/engine-javascript": {+ "version": "3.22.0",+ "resolved": "https://registry.npmjs.org/@shikijs/engine-javascript/-/engine-javascript-3.22.0.tgz",+ "integrity": "sha512-jdKhfgW9CRtj3Tor0L7+yPwdG3CgP7W+ZEqSsojrMzCjD1e0IxIbwUMDDpYlVBlC08TACg4puwFGkZfLS+56Tw==",+ "license": "MIT",+ "dependencies": {+ "@shikijs/types": "3.22.0",+ "@shikijs/vscode-textmate": "^10.0.2",+ "oniguruma-to-es": "^4.3.4"+ }+ },+ "node_modules/@shikijs/rehype/node_modules/@shikijs/engine-oniguruma": {+ "version": "3.22.0",+ "resolved": "https://registry.npmjs.org/@shikijs/engine-oniguruma/-/engine-oniguruma-3.22.0.tgz",+ "integrity": "sha512-DyXsOG0vGtNtl7ygvabHd7Mt5EY8gCNqR9Y7Lpbbd/PbJvgWrqaKzH1JW6H6qFkuUa8aCxoiYVv8/YfFljiQxA==",+ "license": "MIT",+ "dependencies": {+ "@shikijs/types": "3.22.0",+ "@shikijs/vscode-textmate": "^10.0.2"+ }+ },+ "node_modules/@shikijs/rehype/node_modules/@shikijs/langs": {+ "version": "3.22.0",+ "resolved": "https://registry.npmjs.org/@shikijs/langs/-/langs-3.22.0.tgz",+ "integrity": "sha512-x/42TfhWmp6H00T6uwVrdTJGKgNdFbrEdhaDwSR5fd5zhQ1Q46bHq9EO61SCEWJR0HY7z2HNDMaBZp8JRmKiIA==",+ "license": "MIT",+ "dependencies": {+ "@shikijs/types": "3.22.0"+ }+ },+ "node_modules/@shikijs/rehype/node_modules/@shikijs/themes": {+ "version": "3.22.0",+ "resolved": "https://registry.npmjs.org/@shikijs/themes/-/themes-3.22.0.tgz",+ "integrity": "sha512-o+tlOKqsr6FE4+mYJG08tfCFDS+3CG20HbldXeVoyP+cYSUxDhrFf3GPjE60U55iOkkjbpY2uC3It/eeja35/g==",+ "license": "MIT",+ "dependencies": {+ "@shikijs/types": "3.22.0"+ }+ },+ "node_modules/@shikijs/rehype/node_modules/@shikijs/types": {+ "version": "3.22.0",+ "resolved": "https://registry.npmjs.org/@shikijs/types/-/types-3.22.0.tgz",+ "integrity": "sha512-491iAekgKDBFE67z70Ok5a8KBMsQ2IJwOWw3us/7ffQkIBCyOQfm/aNwVMBUriP02QshIfgHCBSIYAl3u2eWjg==",+ "license": "MIT",+ "dependencies": {+ "@shikijs/vscode-textmate": "^10.0.2",+ "@types/hast": "^3.0.4"+ }+ },+ "node_modules/@shikijs/rehype/node_modules/oniguruma-to-es": {+ "version": "4.3.4",+ "resolved": "https://registry.npmjs.org/oniguruma-to-es/-/oniguruma-to-es-4.3.4.tgz",+ "integrity": "sha512-3VhUGN3w2eYxnTzHn+ikMI+fp/96KoRSVK9/kMTcFqj1NRDh2IhQCKvYxDnWePKRXY/AqH+Fuiyb7VHSzBjHfA==",+ "license": "MIT",+ "dependencies": {+ "oniguruma-parser": "^0.12.1",+ "regex": "^6.0.1",+ "regex-recursion": "^6.0.2"+ }+ },+ "node_modules/@shikijs/rehype/node_modules/regex": {+ "version": "6.1.0",+ "resolved": "https://registry.npmjs.org/regex/-/regex-6.1.0.tgz",+ "integrity": "sha512-6VwtthbV4o/7+OaAF9I5L5V3llLEsoPyq9P1JVXkedTP33c7MfCG0/5NOPcSJn0TzXcG9YUrR0gQSWioew3LDg==",+ "license": "MIT",+ "dependencies": {+ "regex-utilities": "^2.3.0"+ }+ },+ "node_modules/@shikijs/rehype/node_modules/regex-recursion": {+ "version": "6.0.2",+ "resolved": "https://registry.npmjs.org/regex-recursion/-/regex-recursion-6.0.2.tgz",+ "integrity": "sha512-0YCaSCq2VRIebiaUviZNs0cBz1kg5kVS2UKUfNIx8YVs1cN3AV7NTctO5FOKBA+UT2BPJIWZauYHPqJODG50cg==",+ "license": "MIT",+ "dependencies": {+ "regex-utilities": "^2.3.0"+ }+ },+ "node_modules/@shikijs/rehype/node_modules/shiki": {+ "version": "3.22.0",+ "resolved": "https://registry.npmjs.org/shiki/-/shiki-3.22.0.tgz",+ "integrity": "sha512-LBnhsoYEe0Eou4e1VgJACes+O6S6QC0w71fCSp5Oya79inkwkm15gQ1UF6VtQ8j/taMDh79hAB49WUk8ALQW3g==",+ "license": "MIT",+ "dependencies": {+ "@shikijs/core": "3.22.0",+ "@shikijs/engine-javascript": "3.22.0",+ "@shikijs/engine-oniguruma": "3.22.0",+ "@shikijs/langs": "3.22.0",+ "@shikijs/themes": "3.22.0",+ "@shikijs/types": "3.22.0",+ "@shikijs/vscode-textmate": "^10.0.2",+ "@types/hast": "^3.0.4"+ }+ },"node_modules/@shikijs/themes": {"version": "1.29.2","resolved": "https://registry.npmjs.org/@shikijs/themes/-/themes-1.29.2.tgz",@@ -15443,6 +16140,38 @@"@shikijs/types": "1.29.2"}},+ "node_modules/@shikijs/transformers": {+ "version": "3.22.0",+ "resolved": "https://registry.npmjs.org/@shikijs/transformers/-/transformers-3.22.0.tgz",+ "integrity": "sha512-E7eRV7mwDBjueLF6852n2oYeJYxBq3NSsDk+uyruYAXONv4U8holGmIrT+mPRJQ1J1SNOH6L8G19KRzmBawrFw==",+ "license": "MIT",+ "dependencies": {+ "@shikijs/core": "3.22.0",+ "@shikijs/types": "3.22.0"+ }+ },+ "node_modules/@shikijs/transformers/node_modules/@shikijs/core": {+ "version": "3.22.0",+ "resolved": "https://registry.npmjs.org/@shikijs/core/-/core-3.22.0.tgz",+ "integrity": "sha512-iAlTtSDDbJiRpvgL5ugKEATDtHdUVkqgHDm/gbD2ZS9c88mx7G1zSYjjOxp5Qa0eaW0MAQosFRmJSk354PRoQA==",+ "license": "MIT",+ "dependencies": {+ "@shikijs/types": "3.22.0",+ "@shikijs/vscode-textmate": "^10.0.2",+ "@types/hast": "^3.0.4",+ "hast-util-to-html": "^9.0.5"+ }+ },+ "node_modules/@shikijs/transformers/node_modules/@shikijs/types": {+ "version": "3.22.0",+ "resolved": "https://registry.npmjs.org/@shikijs/types/-/types-3.22.0.tgz",+ "integrity": "sha512-491iAekgKDBFE67z70Ok5a8KBMsQ2IJwOWw3us/7ffQkIBCyOQfm/aNwVMBUriP02QshIfgHCBSIYAl3u2eWjg==",+ "license": "MIT",+ "dependencies": {+ "@shikijs/vscode-textmate": "^10.0.2",+ "@types/hast": "^3.0.4"+ }+ },"node_modules/@shikijs/twoslash": {"version": "1.29.2","resolved": "https://registry.npmjs.org/@shikijs/twoslash/-/twoslash-1.29.2.tgz",@@ -16308,9 +17037,9 @@"license": "MIT"},"node_modules/@standard-schema/spec": {- "version": "1.0.0",- "resolved": "https://registry.npmjs.org/@standard-schema/spec/-/spec-1.0.0.tgz",- "integrity": "sha512-m2bOd0f2RT9k8QJx1JN85cZYyH1RqFBdlwtkSlf4tBDYLCiiZnv1fIIwacK6cqwXavOydf0NPToMQgpKq+dVlA==",+ "version": "1.1.0",+ "resolved": "https://registry.npmjs.org/@standard-schema/spec/-/spec-1.1.0.tgz",+ "integrity": "sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==","license": "MIT"},"node_modules/@swc/helpers": {@@ -16331,6 +17060,291 @@"tailwindcss": ">=3.2.0"}},+ "node_modules/@tailwindcss/node": {+ "version": "4.1.18",+ "resolved": "https://registry.npmjs.org/@tailwindcss/node/-/node-4.1.18.tgz",+ "integrity": "sha512-DoR7U1P7iYhw16qJ49fgXUlry1t4CpXeErJHnQ44JgTSKMaZUdf17cfn5mHchfJ4KRBZRFA/Coo+MUF5+gOaCQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@jridgewell/remapping": "^2.3.4",+ "enhanced-resolve": "^5.18.3",+ "jiti": "^2.6.1",+ "lightningcss": "1.30.2",+ "magic-string": "^0.30.21",+ "source-map-js": "^1.2.1",+ "tailwindcss": "4.1.18"+ }+ },+ "node_modules/@tailwindcss/node/node_modules/tailwindcss": {+ "version": "4.1.18",+ "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.1.18.tgz",+ "integrity": "sha512-4+Z+0yiYyEtUVCScyfHCxOYP06L5Ne+JiHhY2IjR2KWMIWhJOYZKLSGZaP5HkZ8+bY0cxfzwDE5uOmzFXyIwxw==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/@tailwindcss/oxide": {+ "version": "4.1.18",+ "resolved": "https://registry.npmjs.org/@tailwindcss/oxide/-/oxide-4.1.18.tgz",+ "integrity": "sha512-EgCR5tTS5bUSKQgzeMClT6iCY3ToqE1y+ZB0AKldj809QXk1Y+3jB0upOYZrn9aGIzPtUsP7sX4QQ4XtjBB95A==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">= 10"+ },+ "optionalDependencies": {+ "@tailwindcss/oxide-android-arm64": "4.1.18",+ "@tailwindcss/oxide-darwin-arm64": "4.1.18",+ "@tailwindcss/oxide-darwin-x64": "4.1.18",+ "@tailwindcss/oxide-freebsd-x64": "4.1.18",+ "@tailwindcss/oxide-linux-arm-gnueabihf": "4.1.18",+ "@tailwindcss/oxide-linux-arm64-gnu": "4.1.18",+ "@tailwindcss/oxide-linux-arm64-musl": "4.1.18",+ "@tailwindcss/oxide-linux-x64-gnu": "4.1.18",+ "@tailwindcss/oxide-linux-x64-musl": "4.1.18",+ "@tailwindcss/oxide-wasm32-wasi": "4.1.18",+ "@tailwindcss/oxide-win32-arm64-msvc": "4.1.18",+ "@tailwindcss/oxide-win32-x64-msvc": "4.1.18"+ }+ },+ "node_modules/@tailwindcss/oxide-android-arm64": {+ "version": "4.1.18",+ "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-android-arm64/-/oxide-android-arm64-4.1.18.tgz",+ "integrity": "sha512-dJHz7+Ugr9U/diKJA0W6N/6/cjI+ZTAoxPf9Iz9BFRF2GzEX8IvXxFIi/dZBloVJX/MZGvRuFA9rqwdiIEZQ0Q==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "android"+ ],+ "engines": {+ "node": ">= 10"+ }+ },+ "node_modules/@tailwindcss/oxide-darwin-arm64": {+ "version": "4.1.18",+ "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-darwin-arm64/-/oxide-darwin-arm64-4.1.18.tgz",+ "integrity": "sha512-Gc2q4Qhs660bhjyBSKgq6BYvwDz4G+BuyJ5H1xfhmDR3D8HnHCmT/BSkvSL0vQLy/nkMLY20PQ2OoYMO15Jd0A==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": ">= 10"+ }+ },+ "node_modules/@tailwindcss/oxide-darwin-x64": {+ "version": "4.1.18",+ "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-darwin-x64/-/oxide-darwin-x64-4.1.18.tgz",+ "integrity": "sha512-FL5oxr2xQsFrc3X9o1fjHKBYBMD1QZNyc1Xzw/h5Qu4XnEBi3dZn96HcHm41c/euGV+GRiXFfh2hUCyKi/e+yw==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": ">= 10"+ }+ },+ "node_modules/@tailwindcss/oxide-freebsd-x64": {+ "version": "4.1.18",+ "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-freebsd-x64/-/oxide-freebsd-x64-4.1.18.tgz",+ "integrity": "sha512-Fj+RHgu5bDodmV1dM9yAxlfJwkkWvLiRjbhuO2LEtwtlYlBgiAT4x/j5wQr1tC3SANAgD+0YcmWVrj8R9trVMA==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "freebsd"+ ],+ "engines": {+ "node": ">= 10"+ }+ },+ "node_modules/@tailwindcss/oxide-linux-arm-gnueabihf": {+ "version": "4.1.18",+ "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm-gnueabihf/-/oxide-linux-arm-gnueabihf-4.1.18.tgz",+ "integrity": "sha512-Fp+Wzk/Ws4dZn+LV2Nqx3IilnhH51YZoRaYHQsVq3RQvEl+71VGKFpkfHrLM/Li+kt5c0DJe/bHXK1eHgDmdiA==",+ "cpu": [+ "arm"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">= 10"+ }+ },+ "node_modules/@tailwindcss/oxide-linux-arm64-gnu": {+ "version": "4.1.18",+ "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm64-gnu/-/oxide-linux-arm64-gnu-4.1.18.tgz",+ "integrity": "sha512-S0n3jboLysNbh55Vrt7pk9wgpyTTPD0fdQeh7wQfMqLPM/Hrxi+dVsLsPrycQjGKEQk85Kgbx+6+QnYNiHalnw==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">= 10"+ }+ },+ "node_modules/@tailwindcss/oxide-linux-arm64-musl": {+ "version": "4.1.18",+ "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm64-musl/-/oxide-linux-arm64-musl-4.1.18.tgz",+ "integrity": "sha512-1px92582HkPQlaaCkdRcio71p8bc8i/ap5807tPRDK/uw953cauQBT8c5tVGkOwrHMfc2Yh6UuxaH4vtTjGvHg==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">= 10"+ }+ },+ "node_modules/@tailwindcss/oxide-linux-x64-gnu": {+ "version": "4.1.18",+ "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-x64-gnu/-/oxide-linux-x64-gnu-4.1.18.tgz",+ "integrity": "sha512-v3gyT0ivkfBLoZGF9LyHmts0Isc8jHZyVcbzio6Wpzifg/+5ZJpDiRiUhDLkcr7f/r38SWNe7ucxmGW3j3Kb/g==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">= 10"+ }+ },+ "node_modules/@tailwindcss/oxide-linux-x64-musl": {+ "version": "4.1.18",+ "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-x64-musl/-/oxide-linux-x64-musl-4.1.18.tgz",+ "integrity": "sha512-bhJ2y2OQNlcRwwgOAGMY0xTFStt4/wyU6pvI6LSuZpRgKQwxTec0/3Scu91O8ir7qCR3AuepQKLU/kX99FouqQ==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">= 10"+ }+ },+ "node_modules/@tailwindcss/oxide-wasm32-wasi": {+ "version": "4.1.18",+ "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-wasm32-wasi/-/oxide-wasm32-wasi-4.1.18.tgz",+ "integrity": "sha512-LffYTvPjODiP6PT16oNeUQJzNVyJl1cjIebq/rWWBF+3eDst5JGEFSc5cWxyRCJ0Mxl+KyIkqRxk1XPEs9x8TA==",+ "bundleDependencies": [+ "@napi-rs/wasm-runtime",+ "@emnapi/core",+ "@emnapi/runtime",+ "@tybys/wasm-util",+ "@emnapi/wasi-threads",+ "tslib"+ ],+ "cpu": [+ "wasm32"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "dependencies": {+ "@emnapi/core": "^1.7.1",+ "@emnapi/runtime": "^1.7.1",+ "@emnapi/wasi-threads": "^1.1.0",+ "@napi-rs/wasm-runtime": "^1.1.0",+ "@tybys/wasm-util": "^0.10.1",+ "tslib": "^2.4.0"+ },+ "engines": {+ "node": ">=14.0.0"+ }+ },+ "node_modules/@tailwindcss/oxide-win32-arm64-msvc": {+ "version": "4.1.18",+ "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-win32-arm64-msvc/-/oxide-win32-arm64-msvc-4.1.18.tgz",+ "integrity": "sha512-HjSA7mr9HmC8fu6bdsZvZ+dhjyGCLdotjVOgLA2vEqxEBZaQo9YTX4kwgEvPCpRh8o4uWc4J/wEoFzhEmjvPbA==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": ">= 10"+ }+ },+ "node_modules/@tailwindcss/oxide-win32-x64-msvc": {+ "version": "4.1.18",+ "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-win32-x64-msvc/-/oxide-win32-x64-msvc-4.1.18.tgz",+ "integrity": "sha512-bJWbyYpUlqamC8dpR7pfjA0I7vdF6t5VpUGMWRkXVE3AXgIZjYUYAK7II1GNaxR8J1SSrSrppRar8G++JekE3Q==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": ">= 10"+ }+ },+ "node_modules/@tailwindcss/postcss": {+ "version": "4.1.18",+ "resolved": "https://registry.npmjs.org/@tailwindcss/postcss/-/postcss-4.1.18.tgz",+ "integrity": "sha512-Ce0GFnzAOuPyfV5SxjXGn0CubwGcuDB0zcdaPuCSzAa/2vII24JTkH+I6jcbXLb1ctjZMZZI6OjDaLPJQL1S0g==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@alloc/quick-lru": "^5.2.0",+ "@tailwindcss/node": "4.1.18",+ "@tailwindcss/oxide": "4.1.18",+ "postcss": "^8.4.41",+ "tailwindcss": "4.1.18"+ }+ },+ "node_modules/@tailwindcss/postcss/node_modules/tailwindcss": {+ "version": "4.1.18",+ "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.1.18.tgz",+ "integrity": "sha512-4+Z+0yiYyEtUVCScyfHCxOYP06L5Ne+JiHhY2IjR2KWMIWhJOYZKLSGZaP5HkZ8+bY0cxfzwDE5uOmzFXyIwxw==",+ "dev": true,+ "license": "MIT"+ },"node_modules/@tailwindcss/typography": {"version": "0.5.19","resolved": "https://registry.npmjs.org/@tailwindcss/typography/-/typography-0.5.19.tgz",@@ -17573,34 +18587,22 @@}}},- "node_modules/@typescript-eslint/typescript-estree/node_modules/balanced-match": {- "version": "4.0.4",- "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz",- "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==",- "license": "MIT",- "engines": {- "node": "18 || 20 || >=22"- }- },"node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": {- "version": "5.0.3",- "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.3.tgz",- "integrity": "sha512-fy6KJm2RawA5RcHkLa1z/ScpBeA762UF9KmZQxwIbDtRJrgLzM10depAiEQ+CXYcoiqW1/m96OAAoke2nE9EeA==",+ "version": "2.0.2",+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz",+ "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==","license": "MIT","dependencies": {- "balanced-match": "^4.0.2"- },- "engines": {- "node": "18 || 20 || >=22"+ "balanced-match": "^1.0.0"}},"node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": {- "version": "9.0.8",- "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.8.tgz",- "integrity": "sha512-reYkDYtj/b19TeqbNZCV4q9t+Yxylf/rYBsLb42SXJatTv4/ylq5lEiAmhA/IToxO7NI2UzNMghHoHuaqDkAjw==",+ "version": "9.0.9",+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.9.tgz",+ "integrity": "sha512-OBwBN9AL4dqmETlpS2zasx+vTeWclWzkblfZk7KTA5j3jeOONz/tRCnZomUyvNg83wL5Zv9Ss6HMJXAgL8R2Yg==","license": "ISC","dependencies": {- "brace-expansion": "^5.0.2"+ "brace-expansion": "^2.0.2"},"engines": {"node": ">=16 || 14 >=14.17"@@ -19393,13 +20395,13 @@}},"node_modules/cli-truncate/node_modules/strip-ansi": {- "version": "7.1.2",- "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz",- "integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==",+ "version": "7.2.0",+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.2.0.tgz",+ "integrity": "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==","dev": true,"license": "MIT","dependencies": {- "ansi-regex": "^6.0.1"+ "ansi-regex": "^6.2.2"},"engines": {"node": ">=12"@@ -21868,6 +22870,20 @@}}},+ "node_modules/enhanced-resolve": {+ "version": "5.19.0",+ "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.19.0.tgz",+ "integrity": "sha512-phv3E1Xl4tQOShqSte26C7Fl84EwUdZsyOuSSk9qtAGyyQs2s3jJzComh+Abf4g187lUUAvH+H26omrqia2aGg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "graceful-fs": "^4.2.4",+ "tapable": "^2.3.0"+ },+ "engines": {+ "node": ">=10.13.0"+ }+ },"node_modules/entities": {"version": "4.5.0","resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz",@@ -24165,6 +25181,224 @@"node": "^8.16.0 || ^10.6.0 || >=11.0.0"}},+ "node_modules/fumadocs-core": {+ "version": "16.5.0",+ "resolved": "https://registry.npmjs.org/fumadocs-core/-/fumadocs-core-16.5.0.tgz",+ "integrity": "sha512-uK57jRjCyuCBuBg+mCeeuPUxryUrHJc8J7Eefc4Q+XqPbS3SwHaSfkKzeHRSErOqGP7XvS2l/oM7NCD1eJM7ug==",+ "license": "MIT",+ "dependencies": {+ "@formatjs/intl-localematcher": "^0.8.0",+ "@orama/orama": "^3.1.18",+ "@shikijs/rehype": "^3.21.0",+ "@shikijs/transformers": "^3.21.0",+ "estree-util-value-to-estree": "^3.5.0",+ "github-slugger": "^2.0.0",+ "hast-util-to-estree": "^3.1.3",+ "hast-util-to-jsx-runtime": "^2.3.6",+ "image-size": "^2.0.2",+ "negotiator": "^1.0.0",+ "npm-to-yarn": "^3.0.1",+ "path-to-regexp": "^8.3.0",+ "remark": "^15.0.1",+ "remark-gfm": "^4.0.1",+ "remark-rehype": "^11.1.2",+ "scroll-into-view-if-needed": "^3.1.0",+ "shiki": "^3.21.0",+ "tinyglobby": "^0.2.15",+ "unist-util-visit": "^5.1.0"+ },+ "peerDependencies": {+ "@mixedbread/sdk": "^0.46.0",+ "@orama/core": "1.x.x",+ "@oramacloud/client": "2.x.x",+ "@tanstack/react-router": "1.x.x",+ "@types/react": "*",+ "algoliasearch": "5.x.x",+ "lucide-react": "*",+ "next": "16.x.x",+ "react": "^19.2.0",+ "react-dom": "^19.2.0",+ "react-router": "7.x.x",+ "waku": "^0.26.0 || ^0.27.0",+ "zod": "4.x.x"+ },+ "peerDependenciesMeta": {+ "@mixedbread/sdk": {+ "optional": true+ },+ "@orama/core": {+ "optional": true+ },+ "@oramacloud/client": {+ "optional": true+ },+ "@tanstack/react-router": {+ "optional": true+ },+ "@types/react": {+ "optional": true+ },+ "algoliasearch": {+ "optional": true+ },+ "lucide-react": {+ "optional": true+ },+ "next": {+ "optional": true+ },+ "react": {+ "optional": true+ },+ "react-dom": {+ "optional": true+ },+ "react-router": {+ "optional": true+ },+ "waku": {+ "optional": true+ },+ "zod": {+ "optional": true+ }+ }+ },+ "node_modules/fumadocs-core/node_modules/@formatjs/intl-localematcher": {+ "version": "0.8.1",+ "resolved": "https://registry.npmjs.org/@formatjs/intl-localematcher/-/intl-localematcher-0.8.1.tgz",+ "integrity": "sha512-xwEuwQFdtSq1UKtQnyTZWC+eHdv7Uygoa+H2k/9uzBVQjDyp9r20LNDNKedWXll7FssT3GRHvqsdJGYSUWqYFA==",+ "license": "MIT",+ "dependencies": {+ "@formatjs/fast-memoize": "3.1.0",+ "tslib": "^2.8.1"+ }+ },+ "node_modules/fumadocs-core/node_modules/@shikijs/core": {+ "version": "3.23.0",+ "resolved": "https://registry.npmjs.org/@shikijs/core/-/core-3.23.0.tgz",+ "integrity": "sha512-NSWQz0riNb67xthdm5br6lAkvpDJRTgB36fxlo37ZzM2yq0PQFFzbd8psqC2XMPgCzo1fW6cVi18+ArJ44wqgA==",+ "license": "MIT",+ "dependencies": {+ "@shikijs/types": "3.23.0",+ "@shikijs/vscode-textmate": "^10.0.2",+ "@types/hast": "^3.0.4",+ "hast-util-to-html": "^9.0.5"+ }+ },+ "node_modules/fumadocs-core/node_modules/@shikijs/engine-javascript": {+ "version": "3.23.0",+ "resolved": "https://registry.npmjs.org/@shikijs/engine-javascript/-/engine-javascript-3.23.0.tgz",+ "integrity": "sha512-aHt9eiGFobmWR5uqJUViySI1bHMqrAgamWE1TYSUoftkAeCCAiGawPMwM+VCadylQtF4V3VNOZ5LmfItH5f3yA==",+ "license": "MIT",+ "dependencies": {+ "@shikijs/types": "3.23.0",+ "@shikijs/vscode-textmate": "^10.0.2",+ "oniguruma-to-es": "^4.3.4"+ }+ },+ "node_modules/fumadocs-core/node_modules/@shikijs/engine-oniguruma": {+ "version": "3.23.0",+ "resolved": "https://registry.npmjs.org/@shikijs/engine-oniguruma/-/engine-oniguruma-3.23.0.tgz",+ "integrity": "sha512-1nWINwKXxKKLqPibT5f4pAFLej9oZzQTsby8942OTlsJzOBZ0MWKiwzMsd+jhzu8YPCHAswGnnN1YtQfirL35g==",+ "license": "MIT",+ "dependencies": {+ "@shikijs/types": "3.23.0",+ "@shikijs/vscode-textmate": "^10.0.2"+ }+ },+ "node_modules/fumadocs-core/node_modules/@shikijs/langs": {+ "version": "3.23.0",+ "resolved": "https://registry.npmjs.org/@shikijs/langs/-/langs-3.23.0.tgz",+ "integrity": "sha512-2Ep4W3Re5aB1/62RSYQInK9mM3HsLeB91cHqznAJMuylqjzNVAVCMnNWRHFtcNHXsoNRayP9z1qj4Sq3nMqYXg==",+ "license": "MIT",+ "dependencies": {+ "@shikijs/types": "3.23.0"+ }+ },+ "node_modules/fumadocs-core/node_modules/@shikijs/themes": {+ "version": "3.23.0",+ "resolved": "https://registry.npmjs.org/@shikijs/themes/-/themes-3.23.0.tgz",+ "integrity": "sha512-5qySYa1ZgAT18HR/ypENL9cUSGOeI2x+4IvYJu4JgVJdizn6kG4ia5Q1jDEOi7gTbN4RbuYtmHh0W3eccOrjMA==",+ "license": "MIT",+ "dependencies": {+ "@shikijs/types": "3.23.0"+ }+ },+ "node_modules/fumadocs-core/node_modules/@shikijs/types": {+ "version": "3.23.0",+ "resolved": "https://registry.npmjs.org/@shikijs/types/-/types-3.23.0.tgz",+ "integrity": "sha512-3JZ5HXOZfYjsYSk0yPwBrkupyYSLpAE26Qc0HLghhZNGTZg/SKxXIIgoxOpmmeQP0RRSDJTk1/vPfw9tbw+jSQ==",+ "license": "MIT",+ "dependencies": {+ "@shikijs/vscode-textmate": "^10.0.2",+ "@types/hast": "^3.0.4"+ }+ },+ "node_modules/fumadocs-core/node_modules/negotiator": {+ "version": "1.0.0",+ "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-1.0.0.tgz",+ "integrity": "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==",+ "license": "MIT",+ "engines": {+ "node": ">= 0.6"+ }+ },+ "node_modules/fumadocs-core/node_modules/oniguruma-to-es": {+ "version": "4.3.4",+ "resolved": "https://registry.npmjs.org/oniguruma-to-es/-/oniguruma-to-es-4.3.4.tgz",+ "integrity": "sha512-3VhUGN3w2eYxnTzHn+ikMI+fp/96KoRSVK9/kMTcFqj1NRDh2IhQCKvYxDnWePKRXY/AqH+Fuiyb7VHSzBjHfA==",+ "license": "MIT",+ "dependencies": {+ "oniguruma-parser": "^0.12.1",+ "regex": "^6.0.1",+ "regex-recursion": "^6.0.2"+ }+ },+ "node_modules/fumadocs-core/node_modules/path-to-regexp": {+ "version": "8.3.0",+ "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.3.0.tgz",+ "integrity": "sha512-7jdwVIRtsP8MYpdXSwOS0YdD0Du+qOoF/AEPIt88PcCFrZCzx41oxku1jD88hZBwbNUIEfpqvuhjFaMAqMTWnA==",+ "license": "MIT",+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/express"+ }+ },+ "node_modules/fumadocs-core/node_modules/regex": {+ "version": "6.1.0",+ "resolved": "https://registry.npmjs.org/regex/-/regex-6.1.0.tgz",+ "integrity": "sha512-6VwtthbV4o/7+OaAF9I5L5V3llLEsoPyq9P1JVXkedTP33c7MfCG0/5NOPcSJn0TzXcG9YUrR0gQSWioew3LDg==",+ "license": "MIT",+ "dependencies": {+ "regex-utilities": "^2.3.0"+ }+ },+ "node_modules/fumadocs-core/node_modules/regex-recursion": {+ "version": "6.0.2",+ "resolved": "https://registry.npmjs.org/regex-recursion/-/regex-recursion-6.0.2.tgz",+ "integrity": "sha512-0YCaSCq2VRIebiaUviZNs0cBz1kg5kVS2UKUfNIx8YVs1cN3AV7NTctO5FOKBA+UT2BPJIWZauYHPqJODG50cg==",+ "license": "MIT",+ "dependencies": {+ "regex-utilities": "^2.3.0"+ }+ },+ "node_modules/fumadocs-core/node_modules/shiki": {+ "version": "3.23.0",+ "resolved": "https://registry.npmjs.org/shiki/-/shiki-3.23.0.tgz",+ "integrity": "sha512-55Dj73uq9ZXL5zyeRPzHQsK7Nbyt6Y10k5s7OjuFZGMhpp4r/rsLBH0o/0fstIzX1Lep9VxefWljK/SKCzygIA==",+ "license": "MIT",+ "dependencies": {+ "@shikijs/core": "3.23.0",+ "@shikijs/engine-javascript": "3.23.0",+ "@shikijs/engine-oniguruma": "3.23.0",+ "@shikijs/langs": "3.23.0",+ "@shikijs/themes": "3.23.0",+ "@shikijs/types": "3.23.0",+ "@shikijs/vscode-textmate": "^10.0.2",+ "@types/hast": "^3.0.4"+ }+ },"node_modules/function-bind": {"version": "1.1.2","resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",@@ -24473,9 +25707,9 @@}},"node_modules/glob/node_modules/brace-expansion": {- "version": "5.0.3",- "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.3.tgz",- "integrity": "sha512-fy6KJm2RawA5RcHkLa1z/ScpBeA762UF9KmZQxwIbDtRJrgLzM10depAiEQ+CXYcoiqW1/m96OAAoke2nE9EeA==",+ "version": "5.0.4",+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.4.tgz",+ "integrity": "sha512-h+DEnpVvxmfVefa4jFbCf5HdH5YMDXRsmKflpf1pILZWRFlTbJpxeU55nJl4Smt5HQaGzg1o6RHFPJaOqnmBDg==","license": "MIT","dependencies": {"balanced-match": "^4.0.2"@@ -24612,25 +25846,13 @@"node": ">=18"}},- "node_modules/google-gax/node_modules/balanced-match": {- "version": "4.0.4",- "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz",- "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==",- "license": "MIT",- "engines": {- "node": "18 || 20 || >=22"- }- },"node_modules/google-gax/node_modules/brace-expansion": {- "version": "5.0.3",- "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.3.tgz",- "integrity": "sha512-fy6KJm2RawA5RcHkLa1z/ScpBeA762UF9KmZQxwIbDtRJrgLzM10depAiEQ+CXYcoiqW1/m96OAAoke2nE9EeA==",+ "version": "2.0.2",+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz",+ "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==","license": "MIT","dependencies": {- "balanced-match": "^4.0.2"- },- "engines": {- "node": "18 || 20 || >=22"+ "balanced-match": "^1.0.0"}},"node_modules/google-gax/node_modules/duplexify": {@@ -24742,12 +25964,12 @@"license": "ISC"},"node_modules/google-gax/node_modules/minimatch": {- "version": "9.0.8",- "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.8.tgz",- "integrity": "sha512-reYkDYtj/b19TeqbNZCV4q9t+Yxylf/rYBsLb42SXJatTv4/ylq5lEiAmhA/IToxO7NI2UzNMghHoHuaqDkAjw==",+ "version": "9.0.9",+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.9.tgz",+ "integrity": "sha512-OBwBN9AL4dqmETlpS2zasx+vTeWclWzkblfZk7KTA5j3jeOONz/tRCnZomUyvNg83wL5Zv9Ss6HMJXAgL8R2Yg==","license": "ISC","dependencies": {- "brace-expansion": "^5.0.2"+ "brace-expansion": "^2.0.2"},"engines": {"node": ">=16 || 14 >=14.17"@@ -25553,6 +26775,18 @@"node": ">= 4"}},+ "node_modules/image-size": {+ "version": "2.0.2",+ "resolved": "https://registry.npmjs.org/image-size/-/image-size-2.0.2.tgz",+ "integrity": "sha512-IRqXKlaXwgSMAMtpNzZa1ZAe8m+Sa1770Dhk8VkSsP9LS+iHD62Zd8FQKs8fbPiagBE7BzoFX23cxFnwshpV6w==",+ "license": "MIT",+ "bin": {+ "image-size": "bin/image-size.js"+ },+ "engines": {+ "node": ">=16.x"+ }+ },"node_modules/import-fresh": {"version": "3.3.1","resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz",@@ -27117,6 +28351,267 @@"node": ">= 0.8.0"}},+ "node_modules/lightningcss": {+ "version": "1.30.2",+ "resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.30.2.tgz",+ "integrity": "sha512-utfs7Pr5uJyyvDETitgsaqSyjCb2qNRAtuqUeWIAKztsOYdcACf2KtARYXg2pSvhkt+9NfoaNY7fxjl6nuMjIQ==",+ "dev": true,+ "license": "MPL-2.0",+ "dependencies": {+ "detect-libc": "^2.0.3"+ },+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ },+ "optionalDependencies": {+ "lightningcss-android-arm64": "1.30.2",+ "lightningcss-darwin-arm64": "1.30.2",+ "lightningcss-darwin-x64": "1.30.2",+ "lightningcss-freebsd-x64": "1.30.2",+ "lightningcss-linux-arm-gnueabihf": "1.30.2",+ "lightningcss-linux-arm64-gnu": "1.30.2",+ "lightningcss-linux-arm64-musl": "1.30.2",+ "lightningcss-linux-x64-gnu": "1.30.2",+ "lightningcss-linux-x64-musl": "1.30.2",+ "lightningcss-win32-arm64-msvc": "1.30.2",+ "lightningcss-win32-x64-msvc": "1.30.2"+ }+ },+ "node_modules/lightningcss-android-arm64": {+ "version": "1.30.2",+ "resolved": "https://registry.npmjs.org/lightningcss-android-arm64/-/lightningcss-android-arm64-1.30.2.tgz",+ "integrity": "sha512-BH9sEdOCahSgmkVhBLeU7Hc9DWeZ1Eb6wNS6Da8igvUwAe0sqROHddIlvU06q3WyXVEOYDZ6ykBZQnjTbmo4+A==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "android"+ ],+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/lightningcss-darwin-arm64": {+ "version": "1.30.2",+ "resolved": "https://registry.npmjs.org/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.30.2.tgz",+ "integrity": "sha512-ylTcDJBN3Hp21TdhRT5zBOIi73P6/W0qwvlFEk22fkdXchtNTOU4Qc37SkzV+EKYxLouZ6M4LG9NfZ1qkhhBWA==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/lightningcss-darwin-x64": {+ "version": "1.30.2",+ "resolved": "https://registry.npmjs.org/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.30.2.tgz",+ "integrity": "sha512-oBZgKchomuDYxr7ilwLcyms6BCyLn0z8J0+ZZmfpjwg9fRVZIR5/GMXd7r9RH94iDhld3UmSjBM6nXWM2TfZTQ==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/lightningcss-freebsd-x64": {+ "version": "1.30.2",+ "resolved": "https://registry.npmjs.org/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.30.2.tgz",+ "integrity": "sha512-c2bH6xTrf4BDpK8MoGG4Bd6zAMZDAXS569UxCAGcA7IKbHNMlhGQ89eRmvpIUGfKWNVdbhSbkQaWhEoMGmGslA==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "freebsd"+ ],+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/lightningcss-linux-arm-gnueabihf": {+ "version": "1.30.2",+ "resolved": "https://registry.npmjs.org/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.30.2.tgz",+ "integrity": "sha512-eVdpxh4wYcm0PofJIZVuYuLiqBIakQ9uFZmipf6LF/HRj5Bgm0eb3qL/mr1smyXIS1twwOxNWndd8z0E374hiA==",+ "cpu": [+ "arm"+ ],+ "dev": true,+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/lightningcss-linux-arm64-gnu": {+ "version": "1.30.2",+ "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.30.2.tgz",+ "integrity": "sha512-UK65WJAbwIJbiBFXpxrbTNArtfuznvxAJw4Q2ZGlU8kPeDIWEX1dg3rn2veBVUylA2Ezg89ktszWbaQnxD/e3A==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/lightningcss-linux-arm64-musl": {+ "version": "1.30.2",+ "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.30.2.tgz",+ "integrity": "sha512-5Vh9dGeblpTxWHpOx8iauV02popZDsCYMPIgiuw97OJ5uaDsL86cnqSFs5LZkG3ghHoX5isLgWzMs+eD1YzrnA==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/lightningcss-linux-x64-gnu": {+ "version": "1.30.2",+ "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.30.2.tgz",+ "integrity": "sha512-Cfd46gdmj1vQ+lR6VRTTadNHu6ALuw2pKR9lYq4FnhvgBc4zWY1EtZcAc6EffShbb1MFrIPfLDXD6Xprbnni4w==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/lightningcss-linux-x64-musl": {+ "version": "1.30.2",+ "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.30.2.tgz",+ "integrity": "sha512-XJaLUUFXb6/QG2lGIW6aIk6jKdtjtcffUT0NKvIqhSBY3hh9Ch+1LCeH80dR9q9LBjG3ewbDjnumefsLsP6aiA==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/lightningcss-win32-arm64-msvc": {+ "version": "1.30.2",+ "resolved": "https://registry.npmjs.org/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.30.2.tgz",+ "integrity": "sha512-FZn+vaj7zLv//D/192WFFVA0RgHawIcHqLX9xuWiQt7P0PtdFEVaxgF9rjM/IRYHQXNnk61/H/gb2Ei+kUQ4xQ==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/lightningcss-win32-x64-msvc": {+ "version": "1.30.2",+ "resolved": "https://registry.npmjs.org/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.30.2.tgz",+ "integrity": "sha512-5g1yc73p+iAkid5phb4oVFMB45417DkRevRbt/El/gKXJk4jid+vPFF/AXbxn05Aky8PapwzZrdJShv5C0avjw==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },"node_modules/lilconfig": {"version": "2.1.0","resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.1.0.tgz",@@ -27256,13 +28751,13 @@}},"node_modules/listr2/node_modules/strip-ansi": {- "version": "7.1.2",- "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz",- "integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==",+ "version": "7.2.0",+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.2.0.tgz",+ "integrity": "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==","dev": true,"license": "MIT","dependencies": {- "ansi-regex": "^6.0.1"+ "ansi-regex": "^6.2.2"},"engines": {"node": ">=12"@@ -27531,13 +29026,13 @@}},"node_modules/log-update/node_modules/strip-ansi": {- "version": "7.1.2",- "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz",- "integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==",+ "version": "7.2.0",+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.2.0.tgz",+ "integrity": "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==","dev": true,"license": "MIT","dependencies": {- "ansi-regex": "^6.0.1"+ "ansi-regex": "^6.2.2"},"engines": {"node": ">=12"@@ -30019,6 +31514,12 @@"url": "https://github.com/sponsors/sindresorhus"}},+ "node_modules/oniguruma-parser": {+ "version": "0.12.1",+ "resolved": "https://registry.npmjs.org/oniguruma-parser/-/oniguruma-parser-0.12.1.tgz",+ "integrity": "sha512-8Unqkvk1RYc6yq2WBYRj4hdnsAxVze8i7iPfQr8e4uSP3tRv0rpZcbGUDvxfQQcdwHt/e9PrMvGCsa8OqG9X3w==",+ "license": "MIT"+ },"node_modules/oniguruma-to-es": {"version": "2.3.0","resolved": "https://registry.npmjs.org/oniguruma-to-es/-/oniguruma-to-es-2.3.0.tgz",@@ -30379,12 +31880,12 @@}},"node_modules/package-json-validator/node_modules/strip-ansi": {- "version": "7.1.2",- "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz",- "integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==",+ "version": "7.2.0",+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.2.0.tgz",+ "integrity": "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==","license": "MIT","dependencies": {- "ansi-regex": "^6.0.1"+ "ansi-regex": "^6.2.2"},"engines": {"node": ">=12"@@ -32833,6 +34334,22 @@"integrity": "sha512-QIRet3SYrGp0HUHO88jVskiG6seqUGC5iAG7AwI/BV4ypGcuqk9Du6YQBUOUqm9c8pw1eyLoIaONifRua1lsEQ==","license": "MIT"},+ "node_modules/remark": {+ "version": "15.0.1",+ "resolved": "https://registry.npmjs.org/remark/-/remark-15.0.1.tgz",+ "integrity": "sha512-Eht5w30ruCXgFmxVUSlNWQ9iiimq07URKeFS3hNc8cUWy1llX4KDWfyEDZRycMc+znsN9Ux5/tJ/BFdgdOwA3A==",+ "license": "MIT",+ "dependencies": {+ "@types/mdast": "^4.0.0",+ "remark-parse": "^11.0.0",+ "remark-stringify": "^11.0.0",+ "unified": "^11.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/unified"+ }+ },"node_modules/remark-frontmatter": {"version": "5.0.0","resolved": "https://registry.npmjs.org/remark-frontmatter/-/remark-frontmatter-5.0.0.tgz",@@ -33079,9 +34596,9 @@}},"node_modules/remix-flat-routes/node_modules/brace-expansion": {- "version": "5.0.3",- "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.3.tgz",- "integrity": "sha512-fy6KJm2RawA5RcHkLa1z/ScpBeA762UF9KmZQxwIbDtRJrgLzM10depAiEQ+CXYcoiqW1/m96OAAoke2nE9EeA==",+ "version": "5.0.4",+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.4.tgz",+ "integrity": "sha512-h+DEnpVvxmfVefa4jFbCf5HdH5YMDXRsmKflpf1pILZWRFlTbJpxeU55nJl4Smt5HQaGzg1o6RHFPJaOqnmBDg==","dev": true,"license": "MIT","dependencies": {@@ -33354,9 +34871,9 @@}},"node_modules/rimraf/node_modules/brace-expansion": {- "version": "5.0.3",- "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.3.tgz",- "integrity": "sha512-fy6KJm2RawA5RcHkLa1z/ScpBeA762UF9KmZQxwIbDtRJrgLzM10depAiEQ+CXYcoiqW1/m96OAAoke2nE9EeA==",+ "version": "5.0.4",+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.4.tgz",+ "integrity": "sha512-h+DEnpVvxmfVefa4jFbCf5HdH5YMDXRsmKflpf1pILZWRFlTbJpxeU55nJl4Smt5HQaGzg1o6RHFPJaOqnmBDg==","dev": true,"license": "MIT","dependencies": {@@ -34556,12 +36073,12 @@}},"node_modules/string-width/node_modules/strip-ansi": {- "version": "7.1.2",- "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz",- "integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==",+ "version": "7.2.0",+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.2.0.tgz",+ "integrity": "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==","license": "MIT","dependencies": {- "ansi-regex": "^6.0.1"+ "ansi-regex": "^6.2.2"},"engines": {"node": ">=12"@@ -34936,9 +36453,9 @@}},"node_modules/svix/node_modules/@types/node": {- "version": "22.19.11",- "resolved": "https://registry.npmjs.org/@types/node/-/node-22.19.11.tgz",- "integrity": "sha512-BH7YwL6rA93ReqeQS1c4bsPpcfOmJasG+Fkr6Y59q83f9M1WcBRHR2vM+P9eOisYRcN3ujQoiZY8uk5W+1WL8w==",+ "version": "22.19.13",+ "resolved": "https://registry.npmjs.org/@types/node/-/node-22.19.13.tgz",+ "integrity": "sha512-akNQMv0wW5uyRpD2v2IEyRSZiR+BeGuoB6L310EgGObO44HSMNT8z1xzio28V8qOrgYaopIDNA18YgdXd+qTiw==","license": "MIT","dependencies": {"undici-types": "~6.21.0"@@ -35265,6 +36782,20 @@"node": ">=8.10.0"}},+ "node_modules/tapable": {+ "version": "2.3.0",+ "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.3.0.tgz",+ "integrity": "sha512-g9ljZiwki/LfxmQADO3dEY1CbpmXT5Hm2fJ+QaGKwSXUylMybePR7/67YW7jOrrvjEgL1Fmz5kzyAjWVWLlucg==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=6"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/webpack"+ }+ },"node_modules/tar": {"version": "7.5.9","resolved": "https://registry.npmjs.org/tar/-/tar-7.5.9.tgz",@@ -37137,12 +38668,12 @@}},"node_modules/wrap-ansi/node_modules/strip-ansi": {- "version": "7.1.2",- "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz",- "integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==",+ "version": "7.2.0",+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.2.0.tgz",+ "integrity": "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==","license": "MIT","dependencies": {- "ansi-regex": "^6.0.1"+ "ansi-regex": "^6.2.2"},"engines": {"node": ">=12"@@ -37730,12 +39261,12 @@}},"packages/email/node_modules/strip-ansi": {- "version": "7.1.2",- "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz",- "integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==",+ "version": "7.2.0",+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.2.0.tgz",+ "integrity": "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==","license": "MIT","dependencies": {- "ansi-regex": "^6.0.1"+ "ansi-regex": "^6.2.2"},"engines": {"node": ">=12"diff --git a/package.json b/package.jsonindex f208ee694..a730123d3 100644--- a/package.json+++ b/package.json@@ -103,6 +103,9 @@"lodash": "4.17.23","pdfjs-dist": "5.4.296","typescript": "5.6.2",- "zod": "^3.25.76"+ "zod": "$zod",+ "fumadocs-mdx": {+ "zod": "^4.3.5"+ }}}