Channels allow you to scope events to specific people or rooms. For example:
- Chat rooms
- Emitting events to a specific user
Default Channel#
By default, events are sent to the default channel. If we emit an event without specifying a channel like so:
it can automatically be read using the default channel:
Custom Channels#
Emit events to a specific channel:
Subscribe to one or more channels:
Channel Patterns#
User-Specific Channels
Send notifications to individual users:
Room-Based Channels
Broadcast to all users in a room:
Team Workspaces
Scope events to team workspaces:
Dynamic Channels#
Subscribe to multiple channels at the same time:
Broadcasting to Multiple Channels#
Emit to multiple channels at the same time:
Channel Security#
Combine channels with middleware for secure access control:
See the middleware documentation for authentication examples