import { CheckCircle2, Info } from 'lucide-react'; import { RegistryDrivenForm } from '@/components/admin/shared/registry-driven-form'; import { DocumensoTestButton } from '@/components/admin/documenso/documenso-test-button'; import { EmbeddedSigningCard } from '@/components/admin/documenso/embedded-signing-card'; import { TemplateSyncButton } from '@/components/admin/documenso/template-sync-button'; import { WebhookHealthCard } from '@/components/admin/documenso/webhook-health-card'; import { PageHeader } from '@/components/shared/page-header'; import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; import { WarningCallout } from '@/components/ui/warning-callout'; // All field arrays removed - every Documenso setting now flows through // `RegistryDrivenForm`, which surfaces the env-fallback / port / global // source badge on each field. The settings themselves live in // `src/lib/settings/registry.ts` under sections `documenso.api` / // `.signers` / `.templates` / `.behavior`. export default function DocumensoSettingsPage() { return (

The CRM's signing features are built for Documenso 2.x (v2). Set the API version below to v1 only if this port still points at a Documenso 1.13.x server. Be aware these CRM functions do not work (or run degraded) on v1:

  • Editing an envelope after it is created (title, subject, redirect URL): hard-fails, because v1 has no /envelope/update endpoint.
  • Upload-and-send contracts / reservations fall back to v1's per-field placement: page size is assumed to be A4, and rich field metadata (required flags, NUMBER min/max, CHECKBOX / DROPDOWN / RADIO option lists) is dropped.
  • One-call send with per-recipient signing links,{' '} sequential signing enforcement, and the{' '} v2 webhook events (recipient viewed / signed, declined, reminder sent) are unavailable or ignored on v1.

Recommended: upgrade the Documenso server to 2.x, then set the API version to v2 and run the test-connection button to confirm.

The CRM supports both Documenso 1.13.x (v1) and 2.x (v2). v1 is the default for backwards compatibility. v2 is recommended for new ports and unlocks the features below. Switching versions does not require any code changes - version-aware client methods pick the right endpoint per port. Switch, save, then run the test-connection button to confirm the chosen instance is actually on the matching Documenso version.

v2-only capabilities the CRM already uses when you pick v2

v2 capabilities deferred (would need new code paths)

  • Single-shot /template/use {' '} with v2 prefillFields by ID - current EOI flow uses{' '} /api/v1/templates/{'{id}'}/generate-document with{' '} formValues keyed by name. v2 instances accept both during their backward-compat window; full migration requires per-template field-ID capture in admin settings.
  • Update envelope metadata after creation (/envelope/update) {' '} - change title / subject / redirectUrl on a doc already in DRAFT/PENDING without re-generating.
  • Non-SIGNER recipient roles (CC / VIEWER) - APPROVER role is already used by the EOI template; CC + VIEWER not yet exposed in the recipient builder. Useful for sales managers who want a copy without a signature slot.

Sequential signing and post-signing redirect URL are now wired - see the new "v2 signing behaviour" card below to configure them.

} /> } />
); }