Event object
Event represents a single piece of information emitted during chat operations: typing indicators, message receipts, mentions, or reports.
Unlike other Chat SDK entities, Event provides no methods - it only passes payloads emitted during chat operations.
Properties
Event has the following properties:
1class Event<T extends EventType> {
2 timetoken: string
3 type: T
4 payload: EventPayloads[T]
5 channelId: string
6 userId: string
7}
| Parameter | Description |
|---|---|
timetokenType: string | Timetoken of the message that triggered an event. |
typeType: T | Type of action that emits an event: typing, report, receipt, mention, invite, moderation, or custom. |
payloadType: EventPayloads[T] | Data passed in an event that differ depending on the event type. |
channelIdType: string | Target channel where this event is delivered. |
userIdType: string | Unique ID of the user that triggered the event. |
Use case
Events enable:
- Collecting historical chat events
- Creating custom events
- Building moderation dashboards for flagged messages
- Triggering business logic with Functions