Chat / JavaScript
Chat JavaScript v4
Chat JavaScript
Chat
JavaScript
Home
/
Chat
/
JavaScript
/
Channel
This is the new Docs for Chat SDK v4 for JavaScript. To see the previous Docs, click here.

Join and leave a group channel

Any users can join public group channels as a member without invitations and chat with other members in the channel. Users can join up to 2,000 group channels and when the number of group channels the user joined reaches the maximum number, the user won't be able to join a new public group channel.

if (channel.isPublic) {
    await channel.join();
}

User can leave public group channels as shown below. When a user leaves, they can't receive messages from the channel anymore.

await channel.leave();