# SessionLifecycleEvent
Source: https://docs.maelstrom-ai.co/0.2/reference/realtime/type-aliases/sessionlifecycleevent/
Documentation revision: 89a8f5e9d10cedcf0b30376d7846113f06f26120
SDK manifests in this build: @maelstrom-co/react@0.2.1, @maelstrom-co/client@0.2.1, @maelstrom-co/connectors@0.2.1, @maelstrom-co/protocol@0.2.1, @maelstrom-co/engine@0.2.1
These docs follow this source revision. Manifest versions do not prove release compatibility; verify the installed package exports before using an API.

> **SessionLifecycleEvent** = [`SessionStartedEvent`](https://docs.maelstrom-ai.co/0.2/reference/realtime/interfaces/sessionstartedevent/) | { `generation`: `number`; `type`: `"session.connected"`; } | { `generation`: `number`; `type`: `"session.disconnecting"`; } | { `generation`: `number`; `type`: `"session.disconnected"`; } | { `generation`: `number`; `type`: `"session.error"`; }

Defined in: packages/realtime/src/lib/realtime-session/session-event-bus.ts:31

Connection lifecycle facts. Only the session knows them.

## Union Members

[`SessionStartedEvent`](https://docs.maelstrom-ai.co/0.2/reference/realtime/interfaces/sessionstartedevent/)

* * *

### Type Literal

{ `generation`: `number`; `type`: `"session.connected"`; }

#### generation

> `readonly` **generation**: `number`

Connection generation the fact belongs to.

#### type

> `readonly` **type**: `"session.connected"`

The provider connection of this generation is established.

* * *

### Type Literal

{ `generation`: `number`; `type`: `"session.disconnecting"`; }

#### generation

> `readonly` **generation**: `number`

Connection generation the fact belongs to.

#### type

> `readonly` **type**: `"session.disconnecting"`

Local teardown of this generation began.

* * *

### Type Literal

{ `generation`: `number`; `type`: `"session.disconnected"`; }

#### generation

> `readonly` **generation**: `number`

Connection generation the fact belongs to.

#### type

> `readonly` **type**: `"session.disconnected"`

The session is dormant after teardown.

* * *

### Type Literal

{ `generation`: `number`; `type`: `"session.error"`; }

#### generation

> `readonly` **generation**: `number`

Connection generation the fact belongs to.

#### type

> `readonly` **type**: `"session.error"`

The connection of this generation failed.
