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

# Listen

> Subscribe to DOM events in the browser window and relay event details via push callbacks

The Listen command (Command Type: 13) subscribes to specific DOM events in the browser window context and relays event details via the `onPush` callback.

## Command Type

**Command Type ID:** 13

## Parameters

| Parameter   | Type   | Description                                                                                                        | Required |
| ----------- | ------ | ------------------------------------------------------------------------------------------------------------------ | -------- |
| **event**   | string | The DOM event name to listen to (from `WindowEventMap`). Examples: `"click"`, `"keydown"`, `"resize"`, `"message"` | Yes      |
| **name**    | string | A unique identifier for this listener                                                                              | Yes      |
| **timeout** | number | Timeout in milliseconds                                                                                            | Yes      |

### Common Event Values

| Event        | Description                 |
| ------------ | --------------------------- |
| `"message"`  | Window `postMessage` events |
| `"click"`    | Mouse click events          |
| `"keydown"`  | Keyboard key press events   |
| `"resize"`   | Window resize events        |
| `"storage"`  | localStorage change events  |
| `"popstate"` | History navigation events   |

## Usage Examples

### Listen for postMessage Events

```json theme={null}
{
  "command": "listen",
  "params": {
    "event": "message",
    "name": "messageListener",
    "timeout": 30000
  }
}
```

### Listen for Click Events

```json theme={null}
{
  "command": "listen",
  "params": {
    "event": "click",
    "name": "clickListener",
    "timeout": 15000
  }
}
```

## Related Commands

* [Subscribe WebSocket Event](/stream/commands/browser/subscribe-websocket-event) - Monitor WebSocket messages
* [Observe Property](/stream/commands/browser/observe-property) - Monitor window object property changes
