The embed package editor feature allows you to integrate our package editor directly into your web application.
This provides a seamless experience for users, enabling them to modify and template packages before they are sent without leaving your platform.
By creating the package in an add state the package editor will guide the user through the package properties and templating the documents just like the native add package experience.
If you plan on updating an existing package and displaying the embedded package editor again you should set the state to add in your call to packages/update.
If you do not set the state to add during the update, the package will automatically transition into a draft state.
If the package has already been sent the state can no longer be transitioned back to add.
If you are adding all the signers and documents or disabling the editing of the package properties,
then creating the package in a draft state with focusTemplating embed option is the preferred approach.
User will not be allowed to modify package properties, verification properties, signers, or documents. They will still be allowed to template each document.
Will be included in a state query string parameter appended to the returnUrl.
2
Embed edtior
To embed the package edtior in an iframe, you need to use the editLink.link provided in the add package response or by calling the Packages link API endpoint directly.
If you are embedding existing packages consider generating a new edit link before embedding as they expire after 60 minutes.
3
Process embed messages
When embedding the package editor, you may want to handle certain events such as when the package is sent by the user.
You can achieve this by listening for messages from the iframe.
Copy
Ask AI
window.addEventListener("message", (event) => { // Validate origin if (event.origin !== "https://sign.syngrafii.com" || !event.data) return; // Handle action switch (event.data.action) { case "package_close": // User has closed the package editor. You should continue with your workflow. break; case "package_send": // User has sent the package and closed the package editor. You should continue with your workflow. break; case "session_expired": // User session has expired. The package editor will show an Expired Session message break; }}, false);
If your workflow does not allow for embedding via iframe you can optionally redirect your users to the package edit link
and have it redirect back to your site by setting the options.embed.returnUrl to a valid URL during the call to add package.