Skip to main content
When you embed the OpnForm form editor in an iframe (for example inside a headless CMS), the editor sends postMessage events to the parent window so you can react to save, delete, and back-navigation actions.
Editor embedding is available only to approved OpnForm partners with a signed agreement. If OpnForm has not enabled this option for your organization, embedding the editor on your site will not work. To discuss partner access, contact julien@opnform.com.
These events are separate from the JavaScript SDK events used for public form embeds (submit, pageChange, etc.).

Message format

All editor events use this structure:

Events

View identifiers

The view field in navigateBack payloads uses stable, human-readable IDs:

Parent listener example

Origin targeting

By default, messages are sent to the parent with target origin *. For stricter security, pass your CMS origin as a query parameter on the iframe URL:
The editor will then post messages only to that origin.

Embedding the editor

Embed authenticated editor pages directly in an iframe:
Your users must be authenticated with OpnForm (session cookie) for editor pages to load.