@sajn/embed-js package, through its function API or its Web Component. The @sajn/embed-js package provides two ways to embed the signing experience: a function API and a Web Component.
Before you begin
- Turn on embedding for your organization and add your domain to the allowlist. For more information, see Embedded signing.
- On your server, create the document and read the party’s token from the
signingUrlthatGET /api/v1/documents/DOCUMENT_ID/parties/PARTY_IDreturns. For the steps, see Embed the signing page. Never call the sajn API from the browser, because the request needs your API key.
Installation
npm
CDN
For projects without a build step, use the UMD bundle:sajn global object with all exports.
Use the function API
TheembedSignDocument function creates an iframe and handles all communication with the embedded signing interface.
Import
Options
Return value
Example
Use the Web Component
The package also exports a custom element<sajn-sign-document> that auto-registers when imported.
Import
Attributes
Events
The Web Component dispatches standardCustomEvents that you can listen to:
Example
Use the CDN bundle
Complete HTML page using the UMD bundle:TypeScript types
The package exports all types for TypeScript users:View a signed document
The package also includesembedViewDocument for displaying signed documents in read-only mode.
Use the function API
Options
Example
Use the Web Component
The package also exports a custom element<sajn-view-document>:
Next steps
Embedded signing
See the shared options, events, and security model.
Embed signing in your app
Run the whole flow from server to iframe.

