/ SDKs / JavaScript
SDKs
Chat SDKs JavaScript v4
Chat SDKs JavaScript
Chat SDKs
JavaScript
Version 4

Delete a channel

Copy link

Only the operators of the channel are allowed to delete a channel. To delete a channel, follow the code below.

Open channel

Copy link
JavaScriptTypeScript
// const sb = SendbirdChat.init(...); // For Sendbird Chat SDK initialization details, refer to:
// https://sendbird.com/docs/chat/sdk/v4/javascript/getting-started/send-first-message#2-get-started-3-step-2-initialize-sendbird-chat-sdk

const channel = sb.openChannel.getChannel(CHANNEL_URL);
await channel.delete();

Group channel

Copy link
JavaScriptTypeScript
// const sb = SendbirdChat.init(...); // For Sendbird Chat SDK initialization details, refer to:
// https://sendbird.com/docs/chat/sdk/v4/javascript/getting-started/send-first-message#2-get-started-3-step-2-initialize-sendbird-chat-sdk

const channel = sb.groupChannel.getChannel(CHANNEL_URL);
await channel.delete();