Hi Team,
I’ m integrating docusign Embedded Signing in React js Application.
I create below component :
import React, {useEffect} from 'react';
import PropTypes from 'prop-types';
function DocumentSignUI({integrationKey, docUrl}) {
useEffect(() => {
const loadDocuSign = async () => {
const docusign = await window.DocuSign.loadDocuSign(integrationKey);
const url = `${docUrl}&output=embed`;
const signing = docusign.signing({
url,
displayFormat: 'focused',
style: {
/** High-level variables that mirror our existing branding APIs. Reusing the branding name here for familiarity. */
branding: {
primaryButton: {
/** Background color of primary button */
backgroundColor: '#333',
/** Text color of primary button */
color: '#fff',
}
},
/** High-level components we allow specific overrides for */
signingNavigationButton: {
finishText: 'Custom Button Text',
/** 'bottom-left'|'bottom-center'|'bottom-right', default: bottom-right */
position: 'bottom-left'
}
}
});
signing.on('ready', (event) => {
console.log('ready event', event);
});
signing.on('sessionEnd', (event) => {
console.log('sessionend event', event);
if (event.sessionEndType === 'signing_complete') {
console.log('signing_complete', event);
}
});
signing.mount('#agreement');
};
console.log('DOCUSIGN RENDER');
loadDocuSign();
}, ]);
return (
<div className="docusign-agreement" id="agreement"/>
);
}
DocumentSignUI.propTypes = {
integrationKey: PropTypes.string.isRequired,
docUrl: PropTypes.string.isRequired,
};
export default DocumentSignUI;
It’s working fine if url is not expired.
But if url is expired then I’m not getting event in sessionEnd.
I also tried with try catch block but it’s not working.
If any type of error occured then I want to show error message try again.
Any body have idea, how to handle it ?