Now that we have the embedded_signing_url
, we can display the document for signing. We'll do this with using the SignWell JavaScript library.
<script type="text/javascript" src="https://static.signwell.com/assets/embedded.js"></script>
Once you've added the SignWell JavaScript library to your website or web application, you'll use the following code to display the iFrame.
var signWellEmbed = new SignWellEmbed({
url: '[embedded_signing_url here]',
events: {
completed: e => {
console.log('completed event: ', e)
//document successfully signed/completed
},
closed: e => {
console.log('closed event: ', e)
//SignWell iFrame closed
}
}
})
signWellEmbed.open()
There are multiple options and events you can use when creating the SignWellEmbed
object.
Name | Description |
---|---|
| This is your embedded signing URL. It's the only required option. |
| The default behavior will open a modal with the iFrame. Instead, using this option, you can pass an ID of a DOM object on your website where the iFrame will be embedded. |
| Whether to display the decline document option to signers. Defaults to |
| Whether the document can be closed before a document has been signed/completed. Defaults to |
| A URL where signers will be redirect to if they decline the document. |
| A URL where signers will be redirected to after signing the document. |
| Whether to use redirect after signing settings if they exist. Defaults to |
| Whether to show the header on the document view page. Defaults to |
| Whether the document redirect happens at the iFrame level or the iFrame's parent. Setting this to |
| Hides the download and PDF buttons/actions when set to |
| Defaults the person's name on typed signatures when set to |
| Callback triggered when the document is successfully signed. Data: |
| Callback triggered when the iFrame is loaded. Data: |
| Callback triggered when the document is loaded. Data: |
| Callback triggered when the document is declined. Data: |
| Callback triggered when the iFrame is closed. Data: |
| Callback triggered if there is an error. |