基于 WebSocket 的托管发布/订阅服务。订阅、发布、扩展。
Live chat, presence, in-app notifications, real-time dashboards, without running the WebSocket infrastructure yourself. Built on the same technology that ran Pusher Channels for a decade. Same auth, same idempotency, same webhook contract as every other Bird channel.
import { BirdClient } from "@messagebird/sdk";
const bird = new BirdClient({ apiKey: process.env.BIRD_API_KEY! });
// On your server: publish an event to a channel.
const { data, error } = await bird.realtime.publish({
channel: "orders:BRD-49217",
event: "order.shipped",
data: { status: "shipped", eta: "Thursday, May 22" },
}).safe();
// In your client: subscribe and receive it live.
const channel = bird.realtime.subscribe("orders:BRD-49217");
channel.on("order.shipped", (event) => render(event.data));
if (error) throw error;
console.log(data.id);
// → "evt_2nQ81oP3..."
从 npm install 到首个事件仅需 5 分钟
用您已经在使用的语言发布您的第一个事件。
支持所有主流运行时的 SDK。首次发布会投递到指定的测试通道(bird-test:realtime),让您在配置生产通道之前即可在 CI 中完成验证。
import { BirdClient } from "@messagebird/sdk";
const bird = new BirdClient({ apiKey: process.env.BIRD_API_KEY! });
const { data, error } = await bird.realtime.publish({
channel: "bird-test:realtime",
event: "ping",
data: { hello: "world" },
}).safe();从您的服务器发布到客户端接收事件之间的十个环节。
托管的发布/订阅原语,具名且可审计。无需自行运维 WebSocket 基础设施。
- 01
订阅命名通道
客户端建立连接,订阅一个或多个通道,在事件发布时实时接收。
- 02
从任何地方发布
From your backend, your CLI, your CI, or an MCP-aware agent: same bird.realtime.publish call.
- 03
在线状态通道
了解谁在通道中、谁加入、谁离开。每次变更均触发 Webhook 事件。
- 04
带身份验证的私有通道
客户端侧完成身份验证握手;由您的后端签署订阅请求。
- 05
加密通道
为承载敏感数据的通道提供端到端加密。
- 06
连接状态恢复
客户端重新连接后可重放断连期间错过的事件,回溯窗口可配置。
- 07
通道级速率限制
可配置每个通道的发布上限。仪表盘实时展示限制值和当前速率。
- 08
跨区域路由
连接自动路由到最近的边缘节点。任何区域都能保持低延迟。
- 09
通道状态 Webhook
realtime.channel.occupied、realtime.channel.vacated、realtime.member.added、realtime.member.removed。与所有其他 Bird 通道使用相同的 HMAC 信封。
- 10
统一的身份验证和错误信封
一个 API 密钥即可访问 Realtime、SMS、Email、WhatsApp、Voice。所有服务共享同一套错误类型注册表。
我们为什么构建 Realtime
实时用户体验是规模化后最先出问题的部分。我们已经运营了十年。
Bird Realtime is the WebSocket infrastructure that powered Pusher Channels, the service many of you have shipped against for years. We're folding it into the new Bird API so it shares auth, observability, and billing with everything else you do on Bird. If you're already on Pusher today, your service keeps running on the same wires; the new SDK is the developer-facing change.
import { BirdClient } from "@messagebird/sdk";
const bird = new BirdClient({ apiKey: process.env.BIRD_API_KEY! });
// On your server: publish an event to a channel.
const { data, error } = await bird.realtime.publish({
channel: "orders:BRD-49217",
event: "order.shipped",
data: { status: "shipped", eta: "Thursday, May 22" },
}).safe();
// In your client: subscribe and receive it live.
const channel = bird.realtime.subscribe("orders:BRD-49217");
channel.on("order.shipped", (event) => render(event.data));
if (error) throw error;
console.log(data.id);
// → "evt_2nQ81oP3..."
每一次状态变更都是一个 Webhook。
HMAC-signed payloads, replay-protected, idempotent. The same envelope on every Bird channel: learn one, you've learned them all.
{
"type": "realtime.member.added",
"id": "evt_3pX1g7t...",
"created_at": "2026-05-19T15:42:01.221Z",
"data": {
"channel": "presence:room-42",
"member_id": "usr_4hQ2m",
"members": 18,
"region": "us-east"
}
}
重试计划:5s、30s、5m、30m、2h、6h、12h。最终尝试失败后进入死信队列;所有死信事件均可通过仪表板或 API 重放。
realtime.channel.occupied首个订阅者加入了一个此前为空的通道。realtime.channel.vacated最后一个订阅者已离开;通道现在为空。realtime.member.added一个成员加入了在线状态通道。realtime.member.removed一个成员离开了在线状态通道。realtime.message.published一个事件已发布到通道。
集成了邮件,就等于集成了 Realtime。
Same auth, same idempotency contract, same error envelope, same webhook shape. The difference is the transport: a long-lived WebSocket connection instead of a one-shot REST send.
Realtime。
const channel = bird.realtime.subscribe("orders:BRD-49217");
channel.on("order.shipped", (event) => {
render(event.data);
});
打开连接,订阅频道,实时接收事件。认证方式与事务性发送完全一致。
SMS。
await bird.sms.send({
from: "Bird",
to: "+15005550006",
text: `Your order has shipped.`,
category: "transactional",
});
相同的封装,相同的幂等性。适用于事件需要到达手机而非已连接客户端的场景。
定价即将公布。
Realtime 定价正在最终确定中。如果您是现有的 Pusher Channels 客户,您的服务将继续沿用当前方案。如需了解全新 Bird Realtime SDK 的报价,请与我们联系。