iFrame
Version 1.6.0
Load the script below in your page to use our SDK.
Property name
Type
Description
field_id
string
Field ID.
field_type
text
|
checkbox
|
radio_group
The field type, see
signer fields
for more information about fields).
Property name
Type
Description
checked
boolean
Determines if the checkbox field on the signature was checked.
optional
boolean
Determines if the checkbox field on the signature was optional.
Property name
Type
Description
question
string
The question in the text field on the signature.
answer
string
The answer of the question text field on the signature.
Property name
Type
Description
optional
boolean
Determines if the radio group field on the signature was optional.
radios
radio[]
List of the radio button attached to the radio group.
Property name
Type
Description
id
string
The radio button ID.
checked
boolean
Determines if the radio button field on the signature was checked.
name
string
Name of the radio button
x
number
X coordinate position of the radio button field
y
number
Y coordinate position of the radio button field
Name
Description
InvalidSignatureLink
The signature link is not an URL or not valid.
IframeContainerNotFound
The iframe container is not found.
InvalidCallbackFunction
Callback on event is not a function.
{
"type":"yousign",
"event":"success",
"signer_id":"18be1ef3-9d0c-4ed2-8ba3-273a9138d743",
"signature_request_id":"60620011-8b1a-4957-8733-67969f855877",
"answers":[
"field_id":"00f22ce7-cdb2-45e3-becd-6face7ca8c39",
"field_type":"checkbox",
"checked":true,
"optional":false
"field_id":"dd55cceb-4ce1-4fcb-936e-8f17c7d960c5",
"field_type":"text",
"question":"How are you ?",
"answer":"Very Good"
"field_id":"050b5425-5a7a-496b-ab92-b9c9c2ce46b2",
"field_type":"radio_group",
"optional":false,
"radios":[
"radio_id":"9d084514-9b3a-4504-b3dd-52736da112b4",
"checked":false,
"name": "radio 1 name",
"x": 130,
"y": 135
"radio_id":"eaf1b8e9-5ab0-4870-9733-8746559ed98d",
"checked":true,
"name": "radio 2 name",
"x": 160,
"y": 165
Remove the
window.message
event listener on the case you want to instantiate a new Yousign object.
Usage
let ys = null;
if (ys) {
ys.removeMessageListener();
else {
ys = new Yousign({
signatureLink: signature_link,
iframeContainerId: 'iframe-container',
isSandbox: false,
If you can't use the SDK, you can embed the signature flow without it.
You will use the
signature_link
of the activate signature request response for each signer as a source of an iframe.
HTML
<iframe src="{{signature_link}}"></iframe>
You need to send the referrer when fetching the iframe, set the
referrerpolicy
attribute to strict-origin-when-cross-origin
.Or, you can set your
Referrer-Policy
headers to origin-when-cross-origin
Then, you can catch the messages sent by Yousign to trigger a following action depending the event.
JavaScript
window.addEventListener('message', function(e) {
// Check if the origin of the message is really come from Yousign
if(e.origin === 'https://yousign.app' && e.data.type === 'yousign'){
if(e.data.event === 'started'){
console.log("Signer has opened the signature");
if(e.data.event === 'success'){
console.log('Signer has successfully signed the document');
if(e.data.event === 'error'){
console.log("Signer encountered an error when signing");
//Healthcheck, for debug only
if(e.data.event === 'ping'){
console.log("Ping - Signature request is loaded");
if(e.data.event === 'declined'){
console.log("Declined - The signer declined the signature");
if(e.data.event === 'signature.done'){
console.log("Signature Done - The signature request is completed");
Don't set the
redirectUrls
when adding a signer or on the custom experience, it disabled the events sent by the iframe.
For security reasons, iFrame is available only in production on whitelisted domains. To add your domains, please get in touch with our support.
Please note that it is also possible to whitelist a subdomain (https://subdomain.domain.com) or all subdomains of a domain by using a wildcard, for example https://*.domain.com. In this case all subdomains of domain.com will be authorized.
During your integration in sandbox environment, you can bypass the domain verification by adding the query parameter disable_domain_validation=true to the
signature_link
used as a source of the iframe. This parameter will be ignored in production.
Updated
1 day ago