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

# Events

> All events emitted by a Session.

## Score events

### `score`

Fires every time the attention score changes.

```ts theme={null}
session.on('score', ({ score, delta, signals }) => {
  console.log(`Score: ${score}, change: ${delta}`)
})
```

| Field     | Type       | Description                       |
| --------- | ---------- | --------------------------------- |
| `score`   | `number`   | New score (0–100)                 |
| `delta`   | `number`   | Change from previous score        |
| `signals` | `string[]` | Signals that triggered the change |

### `drop`

Fires when the score falls below the configured threshold.

```ts theme={null}
session.on('drop', ({ score, threshold }) => {
  triggerIntervention()
})
```

### `recover`

Fires when the score rises back above the threshold after a drop.

```ts theme={null}
session.on('recover', ({ score }) => {
  dismissIntervention()
})
```

## Lifecycle events

### `stopped`

Fires when `session.stop()` is called.

### `paused` / `resumed`

Fires when `session.pause()` or `session.resume()` is called.

## Signal events

Subscribe to raw signal events for custom handling.

```ts theme={null}
session.on('signal', ({ type, value }) => {
  // type: 'FACE_DETECTED' | 'IDLE' | 'TAB_HIDDEN' | ...
})
```
