# Event streams

TypeScript inputs, results, permissions and executable examples for event streams.

Use this reference with the [complete developer tour](https://beepgrid.com/docs/sdks/typescript/tour.md) and [TypeScript types](https://beepgrid.com/docs/sdks/typescript/types.md). The example at the end runs after the tour setup.

## events

Consume authorized canonical events with reconnect and a sequence checkpoint.

```text
events(options?: EventOptions): AsyncGenerator<BeepgridEvent, any, any>
```

| Parameter | Type and default | Usage |
| --- | --- | --- |
| `options` | `EventOptions` (default {}) | Optional fields supported by this operation, listed in the linked HTTP input. Unknown fields are not a supported extension mechanism. |

**Returns:** Python iterator or TypeScript async iterator of events; Go callback with error return.

**Permissions, lifecycle and errors:** Persist a checkpoint after applying each event. Go options add conversation filtering; Python supports conversation_id; TypeScript EventOptions exposes after, summary and signal. Summary streams omit full bodies. A denial stops reconnecting.

Declared return type: `AsyncGenerator<BeepgridEvent, any, any>`.

[Working TypeScript example](https://beepgrid.com/docs/sdks/typescript/events/#example). Input/output fields are in the [types reference](https://beepgrid.com/docs/sdks/typescript/types.md).

## Example

Run this region after [the shared setup](https://beepgrid.com/docs/sdks/typescript/tour.md). Assertions check the returned data; the full tour is a runnable program.



```typescript
for await (const event of billing.events({ signal: AbortSignal.timeout(5000) })) {
  if (event.kind === 'message.created' && event.conversation_id === sent.conversation_id) {
    const checkpoint = event.sequence; // Persist after applying the event in your application.
    assert.ok(checkpoint > 0);
    break;
  }
}
```
