How to Embed Document Signing

Embed PandaDoc document signing directly in your website or application so end users sign without being redirected to PandaDoc.

Problem

You want your end users (clients, candidates, employees) to view and sign PandaDoc documents directly inside your application, without being redirected to the PandaDoc website.

Prerequisites

Solution

Step 1: Create a document and send it

Create a document using any creation method, wait for it to reach document.draft status, then send it with silent: true to skip email notifications:

POST https://api.pandadoc.com/public/v1/documents/{document_id}/send

{ "silent": true }

See Understanding Asynchronous Document Creation for details on waiting for draft status.

Optimal Flow

Step 2: Create a document session

Generate a signing session for a recipient:

POST https://api.pandadoc.com/public/v1/documents/{document_id}/session

{
  "recipient": "[email protected]",
  "lifetime": 90000
}

The response returns a session id that you use to embed the document.

Step 3: Embed the signing experience

Use the pandadoc-signing library for a type-safe integration with region support:

import { Signing } from "pandadoc-signing";

const signing = new Signing(
  "signing-container",
  {
    sessionId: "your-session-id-here",
    width: 800,
    height: 600,
  },
  {
    region: "com", // Optional: 'com' or 'eu'
  }
);

await signing.open();
📘

Legacy Manual Approach

If you have an existing integration using HTML iframes and JavaScript event listeners, see the Legacy Manual Approach documentation.

Step 4: Track signing events (optional)

Use the signing instance's event methods to respond to viewer activity. The library provides events such as document.loaded, document.completed, and document.exception.

For the complete event API, payload structures, and all available methods, see Signing Session Embed.

Important considerations

Signer identity

It is your responsibility to verify the identity of any user who views a document within the signing session. Some use cases legally require Identity Verification to be enabled.

Redirect configuration

Recipient redirect settings do not apply to embedded signing sessions. Use the document.completed event to handle redirection in your application.

Related