- FAQ
- Introduction
- Comparisons
- Quick Start
- Features
- Disclaimer
- Requirements
- Event Handler
- Command Handler
- Messages
- Chats
- Groups
- Contacts
- Polls
- Channels
- Orders
- Payments
- Multi Device
- Presence and Profile
What Is WWebJS
Setup
Your Application
Components
Business Features
Advanced Topics
Contributing
WhatsApp Channels are one-way broadcast feeds. Admins post updates and followers receive them without being able to reply.
Get All Channels
const channels = await client.getChannels()
channels.forEach(ch => console.log(ch.name, ch.id._serialized))Create a Channel
const channel = await client.createChannel('My app Updates')
console.log('Channel created:', channel.id._serialized)Create a Channel with a Description
const channel = await client.createChannel('My app Updates', {
description: 'Official updates from my app.',
})Get a Channel by ID
const channel = await client.getChatById('channel-id@newsletter')Subscribe to a Channel
Follow a channel so the app receives its posts:
await client.subscribeToChannel('channel-id@newsletter')Unsubscribe from a Channel
await client.unsubscribeFromChannel('channel-id@newsletter')Send a Message to a Channel
Once you have the channel chat object, send to it like any other chat:
const channel = await client.getChatById('channel-id@newsletter')
await channel.sendMessage('Hello, followers!')Channel publishing workflow
Use a simple publishing pipeline for reliability:
- validate target channel ID,
- build content payload,
- publish,
- log success or failure with channel context.
async function publishUpdate(client, channelId, text) {
const channel = await client.getChatById(channelId)
await channel.sendMessage(text)
console.log('Published update to', channelId)
}Delete a Channel
const channel = await client.getChatById('channel-id@newsletter')
await client.deleteChannel(channel.id._serialized)