---
source_url: https://www.pubnub.com/docs/chat/chat-sdk/learn/chat-entities/event
title: Event object
updated_at: 2026-06-15T12:11:17.485Z
---

> Documentation Index
> For a curated overview of PubNub documentation, see: https://www.pubnub.com/docs/llms.txt
> For the full list of all documentation pages, see: https://www.pubnub.com/docs/llms-full.txt


# 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.

:::note Deprecated event types
Many `EventPayloads` types (`TypingEventPayload`, `ReportEventPayload`, `ReceiptEventPayload`, `MentionEventPayload`, `InviteEventPayload`, `ModerationEventPayload`, `CustomEventPayload`) are deprecated. Use entity-level methods instead (for example, `channel.onTypingChanged()`, `user.onMentioned()`, `channel.onMessageReported()`). See [Custom events](https://www.pubnub.com/docs/chat/chat-sdk/build/features/custom-events) for the full mapping.
:::

## Properties

`Event` has the following properties:

```ts
class Event<T extends EventType> {
    timetoken: string
    type: T
    payload: EventPayloads[T]
    channelId: string
    userId: string
}
```

| Parameter | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| timetoken | string | Optional |  | Timetoken of the message that triggered an event. |
| type | T | Optional |  | Type of action that emits an event: `typing`, `report`, `receipt`, `mention`, `invite`, `moderation`, or `custom`. |
| payload | EventPayloads[T] | Optional |  | Data passed in an event that differ depending on the event type. |
| channelId | string | Optional |  | Target channel where this event is delivered. |
| userId | string | Optional |  | [Unique ID](https://www.pubnub.com/docs/general/setup/users-and-devices) of the user that triggered the event. |

##### Event structure

`EventType` and `EventPayloads` take the following parameters:

```ts
export type EventType =
  | "typing"
  | "report"
  | "receipt"
  | "mention"
  | "invite"
  | "custom"
  | "moderation"

...

export type EventPayloads = {
  typing: TypingEventPayload
  report: ReportEventPayload
  receipt: ReceiptEventPayload
  mention: MentionEventPayload
  invite: InviteEventPayload
  moderation: ModerationEventPayload
  custom: CustomEventPayload
}

...

type TypingEventPayload = {
  value: boolean
}
type ReportEventPayload = {
  text?: string
  reason: string
  reportedMessageTimetoken?: string
  reportedMessageChannelId?: string
  reportedUserId?: string
}
type ReceiptEventPayload = {
  messageTimetoken: string
}
type MentionEventPayload = {
  messageTimetoken: string
  channel: string
}
type InviteEventPayload = {
  channelType: ChannelType | "unknown"
  channelId: string
}
type ModerationEventPayload = {
  channelId: string
  restriction: "muted" | "banned" | "lifted"
  reason?: string
}
type CustomEventPayload = any

export type EventPayloads = {
  typing: TypingEventPayload
  report: ReportEventPayload
  receipt: ReceiptEventPayload
  mention: MentionEventPayload
  invite: InviteEventPayload
  moderation: ModerationEventPayload
  custom: CustomEventPayload
}
```

For details, refer to the [chat events documentation](https://www.pubnub.com/docs/chat/chat-sdk/build/features/custom-events).

## Use case

Events enable:

* Collecting historical chat events
* Creating [custom events](https://www.pubnub.com/docs/chat/chat-sdk/build/features/custom-events)
* Building moderation dashboards for flagged messages
* Triggering business logic with [Functions](https://www.pubnub.com/docs/serverless/functions/overview)