iFrame Workflow Collect
Learn how to embed Workflow Collect in your own application.
In order to iFrame a Workflow Collect in your application you first need to generate a Workflow Session Link. To learn how to integrate a Workflow Session Link follow the detailed guide here : How to guide - Generate your first Workflow Session Link
While Workflow Collect iFraming is not yet supported by our SDK yet, you can still integrate it in a iFrame following the guide below.
The
workflow_session_link_urlis sensitive information and should be treated like a user credential (password for example). Its validity is limited to 48 hours to ensure its security. For more details read the full guide.
Embed manually the Signature Flow in an iFrame
Use the workflow_session_link_url from Generate Workflow Session Link response as for each Applicant as a source of an iFrame.
<iframe src="{{workflow_session_link_url}}" />You need to send the referrer when fetching the iframe, set the
referrerpolicyattribute tostrict-origin-when-cross-origin.Or, you can set your
Referrer-Policyheaders toorigin-when-cross-origin
Then, you can catch the messages sent by Yousign to trigger a following action depending the event :
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("Applicant has opened the Workflow Session Link");
}
if(e.data.event === 'blocked'){
console.log('Applicant has reached maximum number of attempts and cannot submit new documents');
}
if(e.data.event === 'processed'){
console.log("Applicant actions have all been completed succesfully, no addditional action needed.");
}
//Healthcheck, for debug only
if(e.data.event === 'ping'){
console.log("Ping - Workflow Sesion Link is loaded");
}
}
});For security reasons, iFrame in production is only available on authorized domains. To authorize your domains, please follow this guide.
During your integration in
sandboxenvironment, you can bypass the domain verification by adding the query parameterdisable_domain_validation=trueto theworkflow_session_link_urlused as a source of the iframe. This parameter will be ignored in production.
Updated about 16 hours ago