Public channels
A Realtime channel is public unless its name starts with private- or presence-. A client needs only the public app key to subscribe, so treat the channel as readable by anyone with that key.
const orders = bird.subscribe("orders");
orders.bind("order-updated", (data) => {
console.log(data);
});let orders = bird.subscribe("orders")
orders.bind("order-updated") { data in
print(data ?? "")
}val orders = bird.subscribe("orders")
orders.bind("order-updated") { data ->
println(data)
}Public channels require no registration or authorization endpoint. A channel exists while at least one connection is subscribed and disappears when the last connection leaves.
When to use a public channel
Use public channels for data that every visitor may read, such as build results, live scores, flight information, viewer counts, or status-page incidents.
Use a private channel for data scoped to a user, account, or tenant. Public channel subscriptions require no authorization, so a client can try any channel name it can guess or construct.
Public channel limitations
- Member identity: Public channels do not track members or expose a member list. The bird:member_added and bird:member_removed events belong to presence channels.
- Client events: Public channels reject events whose names begin with client-. Use an authorized private or presence channel for client-originated events.
Connection counts
Connection counting works on every channel type. Enable Connection counting and Connection count events to receive bird:connection_count with the number of subscribed connections.
Naming
Channel names are case-sensitive and can contain up to 164 letters, digits, and these characters: _ - = @ , . ;. For example, Orders and orders identify different channels.
Keep sensitive or customer-identifying data out of public channel names. orders reveals no customer information. orders-user-4821 exposes the existence of user 4821 to anyone who can access the application.
Next steps
- Private channels restrict subscriptions to clients approved by your backend.
- Publishing events explains how to publish from your server and broadcast to multiple channels.
- Realtime overview defines channels, members, and connections.