> ## Documentation Index
> Fetch the complete documentation index at: https://docs.omni.co/llms.txt
> Use this file to discover all available pages before exploring further.

# app:event embed event

> Emitted by an embedded Omni app when its code calls omni.emit, so your page can react to what happens inside the app.

An [app](/visualize-present/apps) can send its own events to the page embedding Omni by calling `omni.emit(name, payload)` in the app's code. Each call arrives on your page as an `app:event` event.

Use this to react to something that happens inside the app — a row selection, a click on a call-to-action, or a state change your own product needs to know about.

The app author chooses the `name` and `payload`. Omni validates the size and rate of these events, but does not inspect or generate their content.

<Note>
  Embedded apps are in beta. Contact Omni support to enable them.
</Note>

## Payload

```json theme={null}
{
  "name": "app:event",
  "payload": {
    "name": "string",
    "payload": "unknown"
  }
}
```

## Properties

<ParamField path="name" type="string">
  The event name the app passed to `omni.emit`. At most 128 characters.
</ParamField>

<ParamField path="payload" type="unknown">
  The value the app passed to `omni.emit`. Must be JSON-serializable and at most 16,384 characters once serialized (about 16 KB). Optional — an app can emit a name with no payload.
</ParamField>

## Example

An app calls:

```javascript theme={null}
omni.emit('account-selected', { accountId: '8812', name: 'Blobs R Us' });
```

Your page receives:

```json theme={null}
{
  "name": "app:event",
  "payload": {
    "name": "account-selected",
    "payload": {
      "accountId": "8812",
      "name": "Blobs R Us"
    }
  }
}
```

Listening for it:

```javascript theme={null}
window.addEventListener('message', (event) => {
  if (event.data.name !== 'app:event') return;

  const { name, payload } = event.data.payload;
  if (name === 'account-selected') {
    showAccountDetail(payload.accountId);
  }
});
```

Refer to [Consuming events](/embed/events/consume) for the full listener setup, including origin checks.

## Limits

Omni drops an event without delivering it when:

* The event name is longer than 128 characters
* The serialized payload is longer than 16,384 characters
* The payload isn't JSON-serializable
* The app emits more than 20 events in 2 seconds

Because oversized events are dropped rather than truncated, send IDs and small summaries instead of whole result sets.

Outside of an embed, `omni.emit` does nothing, so an app that emits events is still safe to open directly in Omni.
