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 { PageHeader } from '@/components/shared/page-header'; import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; // 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 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
RECIPIENT_VIEWED,{' '}
RECIPIENT_SIGNED, DOCUMENT_RECIPIENT_COMPLETED,{' '}
DOCUMENT_DECLINED, DOCUMENT_REMINDER_SENT - all routed
through the same dedup + audit pipeline as v1 events.
GET, DELETE,
POST /envelope/create (multipart),{' '}
POST /envelope/distribute, POST /envelope/redistribute,{' '}
GET /envelope/{'{id}'}/download - all routed through{' '}
/api/v2/envelope/... when v2 is selected. The template-generate path
is intentionally still v1 (relies on Documenso 2.x's backward-compat window -
see the deferred-roadmap below).
/envelope/distribute{' '}
returns per-recipient signingUrl in the same response - v1 requires a
separate GET to fetch them. Faster send flow on the rep side.
v2 capabilities deferred (would need new code paths)
/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.
/envelope/update)
{' '}
- change title / subject / redirectUrl on a doc already in DRAFT/PENDING without
re-generating.
Sequential signing and post-signing redirect URL are now wired - see the new "v2 signing behaviour" card below to configure them.