Skip to main content
The Broadcasts module lets you send fire-and-forget custom events to other participants in the room. Use it for emoji reactions, pings, notifications, cursor clicks, or any ephemeral communication. Access it via client.notifications.
Broadcasts are fire-and-forget. They are not persisted and cannot be replayed. If a user is offline when an event is sent, they won’t receive it.
Only editors can send broadcasts. Viewers can receive broadcasts, but broadcast(...) is blocked for viewer sessions.

Methods

Send Event

broadcast(event, data, userIds?) Send a custom event to other users in the room:

Listen for Events

on(event, callback) Listen for a specific event type:

Listen Once

once(event, callback) Listen for an event, but only fire the callback once:

Remove Listener

off(event, callback) Remove a specific listener:

Examples

Emoji Reactions

User Notifications