Skip to main content
Embedding v2 is in beta. Embed sessions and SDK 1.0 can change in ways that break your integration before the first stable release, estimated for November 2026. Embedding v1, described in Embedded signing, is stable.
In this guide, you embed the sajn signing page in a Vue app with the SigningEmbed component from @sajn/embed-vue. The component wraps createSigningEmbed from @sajn/embed-js.

Before you begin

  • Turn on embedding for your organization and add your domain to the embed domains. For more information, see Add your embed domains.
  • Create and send the document, and note the party’s id. For the steps, see Embed the signing page.
  • Vue 3.3 or later.

Install the package

Create a session on your server

Your Vue code never calls the sajn API. Add a server endpoint that creates an embed session and returns its clientSecret. In Nuxt, use a server route:
The component calls this endpoint again each time a session ends, so create a new session on every call. For every field of the request, see Create session request.

Show the signing page

Render SigningEmbed with a fetch-client-secret function:
The component renders a div that holds the frame. A class or style attribute applies to that div, so give it a height there. The component creates the frame when it mounts in the browser, so server rendering in Nuxt outputs only the empty div.

Props

Events

For when each event fires, see Events. EmbedIds is { documentId: string; partyId: string; externalId: string | null }.

Update the frame

The component watches appearance and locale, and a change updates the open frame without reloading it:
The component reads host, title, and fallback-height only when it mounts. To apply a change to one of them, change the component’s key, which mounts a new frame with a new session. Features can’t change from the browser. To change them, create a new session.

TypeScript types

The package exports its types:

Troubleshooting

  • @error gets bootstrap_timeout, and the frame is blank: the browser most likely refused the frame. Check the session’s origins against the page’s exact origin, and your page’s own frame-src policy. For every cause, see Fix a blank frame.
  • @error gets client_secret_failed: the fetch-client-secret function threw an error, or returned something other than the clientSecret string.
  • The frame is 600px high and doesn’t fill the container: the container has no height. Set one with class or style.
For the other error codes, see Error codes.

Next steps

Embedded signing

See the session request, the appearance, the events, and the error codes.

Embed signing in your app

Run the whole flow from server to frame.