Webhook events
Liveblocks events
An event occurs when a change is made to Liveblocks data. Each endpoint you provide in the webhooks dashboard listens to all events by default but can be easily configured to only listen to a subset by updating the Message Filtering section.
To configure an endpoint, verify requests, and test locally, read the Webhooks platform guide.
The Event Catalog in the webhooks dashboard provides a list of events available for subscription, along with their schema.
Events available for use include:
StorageUpdatedUserEntered/UserLeftRoomCreated/RoomDeletedYDocUpdatedCommentCreated/CommentEdited/CommentDeleted/CommentMetadataUpdatedCommentReactionAdded/CommentReactionRemovedThreadCreated/ThreadDeleted/ThreadMetadataUpdatedNotification
More events will come later, such as:
MaxConnectionsReached
UserEnteredEvent
When a user connects to a room, an event is triggered, indicating that the user
has entered. The numActiveUsers field shows the number of users in the room
after the user has joined. This event is not throttled.
UserLeftEvent
A user leaves a room when they disconnect from a room, which is when this event
is triggered. The numActiveUsers field represents the number of users in the
room after the user has left. This event, like UserEntered, is not throttled.
StorageUpdatedEvent
Storage is updated when a user writes to Storage. This event is throttled at 60 seconds and, as such, may not be triggered for every write.
For example, if a user writes to Storage at 1:00 pm sharp, the
StorageUpdatedEvent event will be triggered shortly after. If the user writes
to Storage again at 1:00 pm and 2 seconds, the StorageUpdatedEvent event will
be triggered 60 seconds after the first event was sent, around 1:01 pm.
On Enterprise plans we can increase the throttle rate.
RoomCreatedEvent
An event is triggered when a room is created. This event is not throttled. There are two ways for rooms to be created:
- By calling the create room API
- When a user connects to a room that does not exist
RoomDeletedEvent
An event is triggered when a room is deleted. This event is not throttled.
YDocUpdatedEvent
Yjs document is updated when a user makes a change to a Yjs doc connected to a room. This event is throttled at sixty seconds and, as such, may not be triggered for every write.
For example, if a user updates a Yjs document at 1:00 pm sharp, the
YDocUpdatedEvent event will be triggered shortly after. If the user writes to
the Yjs document again at 1:00 pm and 2 seconds, the YDocUpdatedEvent event
will be triggered 60 seconds after the first event was sent, around 1:01 pm
On Enterprise plans we can increase the throttle rate.
CommentCreatedEvent
An event is triggered when a comment is created. This event is not throttled.
CommentEditedEvent
An event is triggered when a comment is edited. This event is not throttled.
CommentDeletedEvent
An event is triggered when a comment is deleted. This event is not throttled.
CommentReactionAddedEvent
An event is triggered when a reaction is added to a comment. This event is not throttled.
CommentReactionRemovedEvent
An event is triggered when a reaction is removed from a comment. This event is not throttled.
ThreadCreatedEvent
An event is triggered when a thread is created. This event is not throttled.
ThreadDeletedEvent
An event is triggered when a thread is deleted. This event is not throttled. A thread is deleted when all comments in the thread are deleted or when the thread is manually deleted.
ThreadMetadataUpdatedEvent
An event is triggered when a thread metadata is updated. This event is not throttled.
CommentMetadataUpdatedEvent
An event is triggered when a comment’s metadata is updated. This event is not throttled.
ThreadMarkedAsResolvedEvent
An event is triggered when a thread is marked as resolved. This event is not throttled.
ThreadMarkedAsUnresolvedEvent
An event is triggered when a thread is marked as unresolved. This event is not throttled.
NotificationEvent
Notification events are designed to help you create notification emails for your users. By default, they’re triggered 30 minutes after an activity occurs, but this number can be modified in your dashboard inside a project’s settings.
This webhook event is triggered by both Liveblocks and custom notification
kinds, as detailed below.
Thread notification
When using Comments, an event is triggered 30 minutes
after a user has been mentioned or replied to in a thread, and has not seen the
thread. It will also be triggered if the user has subscribed to the thread and
has not seen the thread. The event won’t be triggered if the user has seen the
thread or unsubscribed from the room’s thread notifications. This is the
Liveblocks thread notification kind.
If you want to easily identify this event in your code then you can use the type
guard
isThreadNotificationEvent.
TextMention notification
When using Text editor, an event is triggered 30
minutes after a user has been mentioned in a text and has not seen the text
mention. This is the Liveblocks textMention notification kind.
If you want to easily identify this event in your code then you can use the type
guard
isTextMentionNotificationEvent.
Custom notification
An event is triggered 30 minutes after the user has been notified of a custom
event and has not seen the notification. All custom notification kinds are
prefixed with $ and are manually by you on the server. Learn more about
triggering custom notifications.
If you want to easily identify this event in your code then you can use the type
guard
isCustomNotificationEvent.