Skip to main content

Overview

When embedding the package editor or package signing, the embedded frame will send messages to the parent window that can be used to control your workflow and help with debugging during your integration.

Handling embed messages

To handle messages sent from the embedded frame, you need to listen for the message event on the window object. The event object contains information about the message, including the action being performed.
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);
You should always validate the origin of the message before processing it to ensure it comes from a trusted source.

Embed message

source
string
The source of the message, which can be used to customize your workflow.
SourceDescription
syngrafii-appMessage was sent from the Package Editor or Video Signing Room app.
syngrafii-sign-appMessage was sent from the Sign app. The Sign app is also embedded in the Video Signing Room app, so you can receive messages from both sources.
syngrafii-embedThis source is used to send embed_position messages to Video Signing Room embedded signings.
action
string
The action being performed.
ActionDescription
package_addUser has added a new package.
package_cancelUser has cancelled any changes to the package. They are still in the package editor.
package_closeUser has closed the package editor. You should continue with your workflow.
package_openThe package has been opened by the package editor.
package_saveUser has saved any changes to the package. They are still in the package editor.
package_sendUser has sent the package and closed the package editor. You should continue with your workflow.
meeting_endHost has ended VSR meeting session.
meeting_joiningUser is joining VSR meeting session.
meeting_joinUser has joined VSR meeting session.
meeting_startHost has started VSR meeting session.
signing_changedUser has modified signing; you can use this to track dirty state of signing and prevent navigation.
signing_closeUser has closed signing and was redirected to /notsent page.
signing_finalizeUser has finalized current document.
signing_ignoreUser has ignored save changes warning dialog.
signing_nextUser has opened next document for signing.
signing_openUser has opened document for signing.
signing_returnUser has completed or closed signing and was redirected back to packages list.
signing_return_urlUser has completed or closed signing and was redirected back to returnUrl.
signing_saveUser has saved signing progress; you can use this to track dirty state of signing and allow navigation.
signing_sentUser has completed signing all documents and was redirected to /sent page.
session_expiredUser session has expired. The package editor will show an Expired Session message.
session_expiringUser session is about to expire due to inactivity. They will be presented with a dialog to extend their session.
session_extendedUser session was extended by user.
data
object
Additional data related to the action being performed. The structure of this object may vary depending on the action.
failed
boolean
Indicates whether the action failed.
error
string
The error code if the action failed. This field is only present when failed is true.See the Errors guide for more information.