---
source_url: https://www.pubnub.com/docs/chat/chat-sdk/build/features/channels/updates
title: Manage channel updates
updated_at: 2026-05-25T11:25:00.633Z
---

> 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


# Manage channel updates

Update channel metadata and receive real-time change events.

:::note Requires App Context
Enable [App Context](https://youtu.be/9UEoSlngpYI) for your keyset in the [Admin Portal](https://admin.pubnub.com/).
:::

## Update channel details

Edit channel metadata with `update()` or `updateChannel()`.

Both methods produce the same result. Call `update()` on a `Channel` object or `updateChannel()` on the `Chat` object with the channel ID.

### Method signature

##### Under the hood

`update()` and `updateChannel()` call PubNub App Context API and the JavaScript SDK [setChannelMetadata()](https://www.pubnub.com/docs/sdks/javascript/api-reference/objects#set-channel-metadata) method.

These methods take the following parameters:

* update() 1channel.update(2 {3 name?: string,4 custom?: ObjectCustom,5 description?: string,6 status?: string,7 type?: string8 }9): Promise<Channel>
* updateChannel() 1chat.updateChannel(2 id: string,3 {4 name?: string,5 custom?: ObjectCustom,6 description?: string,7 status?: string,8 type?: string9 }10): Promise<Channel>

#### Input

| Parameter | Required in update() | Required in updateChannel() | Description |
| --- | --- | --- | --- |
| id | string | Optional |  | No | Yes | Unique channel identifier. |
| name | string | Optional |  | No | No | Display name for the channel. |
| custom | ObjectCustom | Optional |  | No | No | JSON providing custom data about the channel. Values must be scalar only; arrays or objects are not supported. [App Context filtering language](https://www.pubnub.com/docs/general/metadata/filtering) doesn’t support filtering by custom properties. |
| description | string | Optional |  | No | No | Additional details about the channel. |
| status | string | Optional |  | No | No | Tag that categorizes a channel by its state, like `archived`. |
| type | string | Optional |  | No | No | Tag that categorizes a channel by its function, like `offtopic`. |

:::tip API limits
To learn about the maximum length of parameters used to set channel metadata, refer to [REST API docs](https://www.pubnub.com/docs/sdks/rest-api/set-channel-metadata).
:::

#### Output

| Type | Description |
| --- | --- |
| `Promise<Channel>` | Object returning the updated channel metadata. |

#### Errors

Whenever the channel ID is required, and you try to edit a channel without providing its ID, you will receive the `ID is required` error. If the channel you're trying to edit doesn't exist, you'll receive the `Channel with this ID does not exist` error.

### Sample code

Update the description of the `support` channel.

* update() 1// reference the "channel" object2const channel = await chat.getChannel("support")3// invoke the "update()" method on the "channel" object4await channel.update(5 {6 description: "Channel for CRM tickets"7 }8)
* updateChannel() 1// reference the "chat" object and invoke the "updateChannel()" method2const channel = await chat.updateChannel(3 "support",4 {5 description: "Channel for CRM tickets"6 }7)

## Get channel updates

Receive real-time updates when a [Channel object](https://www.pubnub.com/docs/chat/chat-sdk/learn/chat-entities/channel) is edited or deleted using the event-driven methods introduced in chat-1-0-0:

* `onUpdated()` - fires when a channel's metadata changes
* `onDeleted()` - fires when a channel is deleted

Both methods accept a callback and return an unsubscribe function.

### Method signature

These methods take the following parameters:

* onUpdated() 1channel.onUpdated(2 callback: (channel: Channel) => void3): () => void
* onDeleted() 1channel.onDeleted(2 callback: () => void3): () => void

#### Input

| Parameter | Description |
| --- | --- |
| `callback` *Type: n/aDefault: n/a | Callback function invoked when the channel event occurs. |
| → `channel`Type: `Channel`Default: n/a | The updated [Channel object](https://www.pubnub.com/docs/chat/chat-sdk/learn/chat-entities/channel). Only passed to `onUpdated()`. |

#### Output

| Type | Description |
| --- | --- |
| `() => void` | Function you can call to stop listening to channel events. |

### Sample code

Listen for updates and deletions on the `support` channel.

```ts
const channel = await chat.getChannel("support")

const stopUpdated = channel.onUpdated((updated) => {
    console.log("Channel updated:", updated)
})

const stopDeleted = channel.onDeleted(() => {
    console.log("Channel was deleted")
})

// after some time...
stopUpdated()
stopDeleted()
```

## Get channel updates (deprecated)

:::warning Deprecated
`streamUpdates()` is deprecated as of chat-1-0-0. Use [onUpdated()](#get-channel-updates) and [onDeleted()](#get-channel-updates) instead. `streamUpdatesOn()` remains supported.
:::

Receive updates when [Channel objects](https://www.pubnub.com/docs/chat/chat-sdk/learn/chat-entities/channel) are edited or removed:

* `streamUpdates()` - monitors a single channel
* `streamUpdatesOn()` - monitors multiple channels

Both methods accept a callback invoked when channel metadata changes. They subscribe to a channel and add an [objects event listener](https://www.pubnub.com/docs/sdks/javascript/api-reference/configuration#event-listeners) for `channel` events, returning an `unsubscribe` function.

:::note Stream update behavior
* `streamUpdates()` returns the updated `Channel` object on each change (`null` if deleted)
* `streamUpdatesOn()` returns the complete list of monitored channels on any change
:::

### Method signature

##### Under the hood

`streamUpdates()` and `streamUpdatesOn()` call Pub/Sub API and the JavaScript SDK [subscribe()](https://www.pubnub.com/docs/sdks/javascript/api-reference/publish-and-subscribe#subscribe) and [unsubscribe()](https://www.pubnub.com/docs/sdks/javascript/api-reference/publish-and-subscribe#unsubscribe) methods.

These methods take the following parameters:

* streamUpdates() 1channel.streamUpdates(2 callback: (channel: Channel) => unknown3): () => void
* streamUpdatesOn() 1static Channel.streamUpdatesOn(2 channels: Channel[],3 callback: (channels: Channel[]) => unknown4): () => void

#### Input

| Parameter | Required in `streamUpdates()` | Required in `streamUpdatesOn()` | Description |
| --- | --- | --- | --- |
| `channels`Type: `Channel[]`Default: n/a | No | Yes | Array of [Channel objects](https://www.pubnub.com/docs/chat/chat-sdk/learn/chat-entities/channel) for which you want to get updates. |
| `callback`Type: n/aDefault: n/a | Yes | Yes | Callback function passed as a parameter to both methods. It defines the custom behavior to be executed when detecting channel metadata changes. |
| → `channel`Type: `Channel`Default: n/a | Yes | No | Returned `Channel` object with the updated data. |
| → `channels`Type: `Channel[]`Default: n/a | No | Yes | Returned array of `Channel` objects with the updated data. |

#### Output

| Type | Description |
| --- | --- |
| `() => void` | Function you can call to disconnect (unsubscribe) from the channel and stop receiving `objects` events. |

#### Errors

Whenever a list of `Channel` objects is required as a parameter, and you try to get updates on channels without specifying their list, you will receive the `Cannot stream channel updates on an empty list` error.

### Sample code

* streamUpdates() Get updates on the support channel. 1const channel = await chat.getChannel("support")2channel.streamUpdates((channel) => {3 // The callback receives the entire updated Channel object each time a change occurs.4 if (channel) {5 console.log("Updated channel: ", channel)6 } else {7 console.log("Channel was deleted")8 }9})
* streamUpdatesOn() Get updates on the support and incident-management channels. 1const supportChannel = await chat.getChannel("support")2const incidentChannel = await chat.getChannel("incident-management")3Channel.streamUpdatesOn([supportChannel, incidentChannel], (channels) => {4 // The callback receives the complete list of all channels you're monitoring5 // each time any change occurs.6 console.log("Updated channels: ", channels)7})

### Other examples

* streamUpdates() Stop listening to updates on the support channel. 1const channel = await chat.getChannel("support")2const stopUpdates = channel.streamUpdates(/* handle update callback */)3// after some time...4stopUpdates()
* streamUpdatesOn() Stop listening to updates on the support and incident-management channels. 1const supportChannel = await chat.getChannel("support")2const incidentChannel = await chat.getChannel("incident-management")3const stopUpdates = Channel.streamUpdatesOn([supportChannel, incidentChannel], /* handle update callback */)4// after some time...5stopUpdates()