Documenso

V2 Authoring

Embed envelope creation and editing directly in your application.

V2 authoring components allow your users to create and edit envelopes without leaving your application. Envelopes are the unified model for documents and templates in the V2 API.

Embedded authoring is included with Enterprise plans. It is also available as a paid add-on for the Platform Plan. Contact sales for access.

Components

The SDK provides two V2 authoring components:

ComponentPurpose
EmbedCreateEnvelopeCreate new envelopes
EmbedUpdateEnvelopeEdit existing envelopes

Presign Tokens

All authoring components require a presign token for authentication. See the Authoring overview for details on obtaining presign tokens.

A presigned token is NOT an API token


Creating Envelopes

Use EmbedCreateEnvelope to embed envelope creation. The type prop determines whether the envelope is created as a document or template.

import { EmbedCreateEnvelope } from '@documenso/embed-react';

const EnvelopeCreator = ({ presignToken }) => {
  return (
    <div style={{ height: '800px', width: '100%' }}>
      <EmbedCreateEnvelope
        presignToken={presignToken}
        type="DOCUMENT"
        externalId="order-12345"
        onEnvelopeCreated={(data) => {
          console.log('Envelope created:', data.envelopeId);
          console.log('External ID:', data.externalId);
        }}
      />
    </div>
  );
};

To create a template instead of a document, set type to "TEMPLATE":

<EmbedCreateEnvelope
  presignToken={presignToken}
  type="TEMPLATE"
  externalId="template-12345"
  onEnvelopeCreated={(data) => {
    console.log('Template envelope created:', data.envelopeId);
  }}
/>

Editing Envelopes

Use EmbedUpdateEnvelope to embed envelope editing:

import { EmbedUpdateEnvelope } from '@documenso/embed-react';

const EnvelopeEditor = ({ presignToken, envelopeId }) => {
  return (
    <div style={{ height: '800px', width: '100%' }}>
      <EmbedUpdateEnvelope
        presignToken={presignToken}
        envelopeId={envelopeId}
        externalId="order-12345"
        onEnvelopeUpdated={(data) => {
          console.log('Envelope updated:', data.envelopeId);
        }}
      />
    </div>
  );
};

Props

All V2 Authoring Components

PropTypeRequiredDescription
presignTokenstringYesAuthentication token from your backend
externalIdstringNoYour reference ID to link with the envelope
hoststringNoCustom host URL. Defaults to https://app.documenso.com
cssstringNoCustom CSS string (Platform Plan)
cssVarsobjectNoCSS variable overrides (Platform Plan)
darkModeDisabledbooleanNoDisable dark mode (Platform Plan)
classNamestringNoCSS class for the iframe
featuresobjectNoFeature toggles for the authoring experience

Create Component Only

PropTypeRequiredDescription
type"DOCUMENT" | "TEMPLATE"YesWhether to create a document or template envelope

Update Component Only

PropTypeRequiredDescription
envelopeIdstringYesThe envelope ID to edit

Feature Toggles

V2 authoring provides rich, structured feature toggles organized into sections. Pass a partial configuration to customize the authoring experience — any omitted fields will use their defaults.

<EmbedCreateEnvelope
  presignToken={presignToken}
  type="DOCUMENT"
  features={{
    general: {
      allowConfigureEnvelopeTitle: false,
      allowUploadAndRecipientStep: false,
      allowAddFieldsStep: false,
      allowPreviewStep: false,
    },
    settings: {
      allowConfigureSignatureTypes: false,
      allowConfigureLanguage: false,
      allowConfigureDateFormat: false,
    },
    recipients: {
      allowApproverRole: false,
      allowViewerRole: false,
    },
  }}
/>

General

Controls the overall authoring flow and UI:

PropertyTypeDefaultDescription
allowConfigureEnvelopeTitlebooleantrueAllow editing the envelope title
allowUploadAndRecipientStepbooleantrueShow the upload and recipient configuration step
allowAddFieldsStepbooleantrueShow the add fields step
allowPreviewStepbooleantrueShow the preview step
minimizeLeftSidebarbooleantrueMinimize the left sidebar by default

Settings

Controls envelope configuration options. Set to null to hide envelope settings entirely.

PropertyTypeDefaultDescription
allowConfigureSignatureTypesbooleantrueAllow configuring signature types
allowConfigureLanguagebooleantrueAllow configuring the language
allowConfigureDateFormatbooleantrueAllow configuring the date format
allowConfigureTimezonebooleantrueAllow configuring the timezone
allowConfigureRedirectUrlbooleantrueAllow configuring a redirect URL
allowConfigureDistributionbooleantrueAllow configuring distribution settings
allowConfigureExpirationPeriodbooleantrueAllow configuring the expiration period
allowConfigureEmailSenderbooleantrueAllow configuring the email sender
allowConfigureEmailReplyTobooleantrueAllow configuring the email reply-to

Actions

Controls available actions during authoring:

PropertyTypeDefaultDescription
allowAttachmentsbooleantrueAllow adding attachments

Envelope Items

Controls how envelope items (individual files within the envelope) can be managed. Set to null to prevent any item modifications.

PropertyTypeDefaultDescription
allowConfigureTitlebooleantrueAllow editing item titles
allowConfigureOrderbooleantrueAllow reordering items
allowUploadbooleantrueAllow uploading new items
allowDeletebooleantrueAllow deleting items

Recipients

Controls recipient configuration options. Set to null to prevent any recipient modifications.

PropertyTypeDefaultDescription
allowConfigureSigningOrderbooleantrueAllow configuring the signing order
allowConfigureDictateNextSignerbooleantrueAllow configuring dictate next signer
allowApproverRolebooleantrueAllow the approver recipient role
allowViewerRolebooleantrueAllow the viewer recipient role
allowCCerRolebooleantrueAllow the CC recipient role
allowAssistantRolebooleantrueAllow the assistant recipient role

Disabling Steps

You can also disable entire steps of the authoring flow. This allows you to skip steps that are not relevant to your use case:

<EmbedCreateEnvelope
  presignToken={presignToken}
  type="DOCUMENT"
  features={{
    general: {
      allowUploadAndRecipientStep: false, // Skip the upload and recipient step
      allowAddFieldsStep: false,          // Skip the add fields step
      allowPreviewStep: false,            // Skip the preview step
    },
    settings: null,       // Hide all envelope settings
    envelopeItems: null,  // Prevent item modifications
    recipients: null,     // Prevent recipient modifications
  }}
/>

Event Callbacks

onEnvelopeCreated

Fired when an envelope is successfully created:

FieldTypeDescription
envelopeIdstringThe ID of the created envelope
externalIdstring | nullYour external reference ID, if provided

onEnvelopeUpdated

Fired when an envelope is successfully updated:

FieldTypeDescription
envelopeIdstringThe ID of the updated envelope
externalIdstring | nullYour external reference ID, if provided

Complete Integration Example

This example shows a full workflow where users create an envelope and then edit it:

import { useState } from 'react';

import { EmbedCreateEnvelope, EmbedUpdateEnvelope } from '@documenso/embed-react';

const EnvelopeManager = ({ presignToken }) => {
  const [envelopeId, setEnvelopeId] = useState(null);
  const [mode, setMode] = useState('create');

  if (mode === 'success') {
    return (
      <div>
        <h2>Envelope updated successfully</h2>
        <button
          onClick={() => {
            setEnvelopeId(null);
            setMode('create');
          }}
        >
          Create Another Envelope
        </button>
      </div>
    );
  }

  if (mode === 'edit' && envelopeId) {
    return (
      <div style={{ height: '800px', width: '100%' }}>
        <button onClick={() => setMode('create')}>Back to Create</button>
        <EmbedUpdateEnvelope
          presignToken={presignToken}
          envelopeId={envelopeId}
          onEnvelopeUpdated={(data) => {
            console.log('Envelope updated:', data.envelopeId);
            setMode('success');
          }}
        />
      </div>
    );
  }

  return (
    <div style={{ height: '800px', width: '100%' }}>
      <EmbedCreateEnvelope
        presignToken={presignToken}
        type="DOCUMENT"
        features={{
          general: {
            allowConfigureEnvelopeTitle: false,
          },
          settings: {
            allowConfigureSignatureTypes: false,
            allowConfigureLanguage: false,
          },
        }}
        onEnvelopeCreated={(data) => {
          console.log('Envelope created:', data.envelopeId);
          setEnvelopeId(data.envelopeId);
          setMode('edit');
        }}
      />
    </div>
  );
};

See Also

On this page