Event shape
Events emitted by Omni use thepostMessage protocol and will have the following shape:
type EmbedEvent<Payload> = {
payload: Payload
description: string
name: EmbedEventName
}
Listening for events
Subscribe to events in the parent frame with the following:const setFrameHeight = (height) => {
// do the work to set the iframe element's height here
// eg. `iframeElement.height = height`
}
const listener = (event) => {
// Only accept messages from a known origin
if (event.origin !== "https://example.embed-omniapp.co") return
switch (event.data.name) {
case 'size': {
const { height } = event.data.payload
height && setFrameHeight(height)
break
}
case 'page:changed': {
// Do something with the page:changed event, etc
}
}
}
// Must attach the event listener for messages.
window.addEventListener('message', listener)
Supported events
Omni currently emits the following events:| Event | Description |
|---|---|
ai:chat-start | Emitted by Omni when an AI chat session begins. |
app:event | Emitted by an embedded app when its code calls omni.emit. |
app:filter-changed | Emitted by Omni when an embedded app changes the filters on one of its queries. |
dashboard:download | Emitted by Omni when a user downloads an embedded dashboard. |
dashboard:filter-changed | Emitted by Omni when a user adds, removes, or updates a filter on an embedded document. |
dashboard:filters | Emitted by Omni when a user applies a filter to an embedded document. |
dashboard:ready | Emitted by Omni when an embedded dashboard loads and can receive filter updates. |
dashboard:tile-download | Emitted by Omni when a user downloads a given tile on a dashboard. |
dashboard:tile-drill | Emitted by Omni when a user performs a drill action on a dashboard tile. |
error | Emitted by Omni when a detectable error occurs on an embedded page. |
fullscreen:changed | Emitted by Omni when the fullscreen state of an embedded dashboard or app changes. |
navigation:home | Emitted by Omni when a user clicks the logo or home link in the navigation header. |
page:changed | Emitted by Omni when the URL of a page changes. |
page:ready | Emitted by Omni when an embedded page starts to listen for events from the parent frame. |
sidebar:open | Emitted by Omni when a user clicks the mobile menu button. |
size | Emitted by Omni to give the size of embedded content, allowing you to dynamically size the iframe. |
status | Emitted by Omni to indicate the status of the dashboard to the parent frame. |

