This guide shows how to embed the signing ceremony directly in your web application so users can sign documents without leaving your app.
The process requires two sides: a server that creates the envelope and ceremony using your API key, and a client that displays the ceremony inside an iframe.
In this example, we will:
- Create an envelope with custom authentication,
embeddable_inset to your domain, anddelivery_typeset to"none". - Get the ceremony URL from the response and pass it to your client.
- Embed the ceremony URL in an iframe with the required query parameters.
- Listen for JavaScript message events to detect when signing is complete.
Create the Envelope
Create an envelope on your server with two important settings on the recipient:- Set
delivery_typeto"none"so SignatureAPI does not send an invitation email. Your app controls when and how the ceremony is presented. - Set
ceremony.embeddable_into the origin where your app is hosted so the signing interface is allowed to load inside your iframe.
custom authentication so the recipient does not need to go through an email flow. Your app handles authentication before presenting the ceremony.
recipients[].ceremony.url. Because authentication is custom, the URL is available directly in the response. Pass this URL to your client so it can embed the ceremony.
Embed the Ceremony
On the client, take the ceremony URL returned by your server and append two query parameters before using it as the iframesrc:
embedded=true- Configures the signing UI for embedding and sets the correct Content Security Policy headers.event_delivery=message- Delivers ceremony events as JavaScriptMessageEvents to your page.
Both query parameters are required. If you omit
embedded=true, the browser will block the iframe due to Content Security Policy restrictions. If you omit event_delivery=message, your page will not receive ceremony events.Listen for Events
The embedded ceremony sends JavaScript MessageEvents when the signing session reaches a terminal state. Add an event listener on thewindow object to handle these events and update your UI accordingly, for example by closing or hiding the iframe once signing is complete.
There are three event types:
| Event | Description |
|---|---|
ceremony.completed | The recipient completed signing. |
ceremony.canceled | The recipient canceled the ceremony. |
ceremony.failed | An error prevented the ceremony from completing. |
event.data.type. For ceremony.failed events, event.data also includes error_type and error_message.
Testing
Before integrating the iframe into your application, use the Embedder tool to preview how the ceremony will appear:- Go to the Embedder Tool.
- Enter your ceremony URL. The
embedded=trueandevent_delivery=messagequery parameters are added automatically. - Optionally adjust the width and height in pixels.
- The tool displays your ceremony in an iframe and shows the events received from it.
Try It
Try this example in Postman using your test API key to create a free, non-binding test envelope. Test envelopes won’t send emails, but you can review them in your dashboard and use the ceremony URL with the Embedder tool to verify your setup.Keep Learning
- Learn about ceremony authentication options to control how recipients verify their identity before signing.
- Read the full Embedded Signing introduction for an overview of embedding in web and mobile apps.
- Learn how to embed signing in a mobile app using WebView.
- Explore ceremony events to understand all event types and the redirect-based delivery method for mobile apps.