> Documentation index: https://www.gooddata.ai/docs/gooddata-ui/llms.txt lists every page of these docs as Markdown.

# ChatEventHandler

- Package: [@gooddata/sdk-ui-gen-ai](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-gen-ai/index.md)
- Kind: type-alias
- Source: https://github.com/gooddata/gooddata-ui-sdk/blob/rel/11.64/libs/sdk-ui-gen-ai/src/store/events.ts
- Guides: [Track user interactions](https://www.gooddata.ai/docs/gooddata-ui/latest/integrations/interactivity/track-user-interactions/index.md)

An event handler for the Chat component.

**Signature:**

```typescript
export type ChatEventHandler<TEvent extends ChatEvent = any> = {
    eval: (event: ChatEvent) => event is TEvent;
    handler: (event: TEvent) => void;
};
```
**References:** [ChatEvent](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-gen-ai/sdk-ui-gen-ai.chatevent/index.md)
