Documentation Index
Fetch the complete documentation index at: https://docs.spitshake.io/llms.txt
Use this file to discover all available pages before exploring further.
Embedding Overview
DocuTrust provides three approaches to embed document signing and template building directly into your application. Choose the one that best fits your architecture and level of control.Approaches
1. Web Components
Drop-in HTML custom elements that work in any web page or framework.<docuseal-form>renders a signing form for a specific submission.<docuseal-builder>renders the template editor for building and configuring document templates.
data-* attributes.
Signing Form
Embed a signing form with pre-fill, events, and redirect support.
Template Builder
Embed the template editor with field configuration and save hooks.
2. JavaScript SDK
A globalwindow.DocuTrust API for programmatic control. Use the SDK when you need imperative mounting, event handling, or dynamic configuration that goes beyond static HTML attributes.
JavaScript SDK
Full SDK reference with mount, configure, and event APIs.
3. Direct iframe
For maximum control, build your own iframe pointing to the signing URL with theembed=true query parameter. This approach gives you full control over iframe sizing, sandboxing, and cross-origin communication.
- Resizing the iframe to match content height (listen for
docutrust:resizemessages) - Listening to
postMessageevents from the iframe for completion and field changes - Passing configuration via query parameters instead of
data-*attributes
| Parameter | Example | Description |
|---|---|---|
embed | true | Enable embed mode (required) |
email | jane@example.com | Pre-fill signer email |
name | Jane Doe | Pre-fill signer name |
language | es | UI language code |
with_title | false | Hide the form title |
completed_redirect_url | https://your-app.com/done | Redirect after completion |
Decision Matrix
Use this table to choose the right approach for your integration.| Criteria | Web Components | JavaScript SDK | Direct iframe |
|---|---|---|---|
| Ease of use | Easiest — HTML attributes only | Moderate — requires JS | Manual — you handle everything |
| Setup time | Minutes | Minutes | Hours |
| Flexibility | High — 18 attributes, 6 events | Highest — full programmatic control | Full control, but more work |
| Framework support | Any (HTML, React, Vue, Angular, Svelte) | Any with JS access | Any that supports iframes |
| Event handling | addEventListener on the element | DocuTrust.on() chaining API | Raw window.postMessage |
| Auto-resize | Built-in | Built-in | Manual (listen for docutrust:resize) |
| Configuration | Declarative data-* attributes | Imperative options object | Query parameters |
| Pre-fill support | JSON via data-values attribute | Object via values option | Limited to query parameters |
| TypeScript support | N/A | Full type definitions | N/A |
| Bundle size | ~8 KB (embed script) | ~8 KB (same script) | 0 KB (no script needed) |
| Best for | Most integrations | SPAs needing dynamic control | Existing iframe infrastructure |
For most integrations, Web Components are the recommended approach. They provide the best balance of simplicity and flexibility with zero framework dependencies.
Authentication for Embedding
Both the signing form and the template builder support token-based authentication via JWT. Tokens are generated server-side through the/api/embed/token endpoint and scoped to a single submission or template.
- Signing forms can use either a submitter slug (public link) or a JWT token for authenticated access.
- Template builders always require a JWT token generated server-side.
form or builder).
JWT Tokens
Server-side token generation, claim structure, and security best practices.