Exposed States

These states hold real-time data from the Liveblocks-Presence element in the Bubble Editor. They help track users in a room, manage errors, and more.

StateTypeDescription
othersText (list)Other users in the room. Empty when no room is currently synced.
Room IDTextThe room where this element is currently monitoring presence.
EveryoneText (list)All users currently in the room, including the local user.
User IDTextThe Liveblocks user ID for the current user.
Lost ConnectionTextA special event that triggers when a previously connected Liveblocks client loses connection. The possible statuses are: lost, restored, and failed.
ErrorYes/NoDisplays the error message if the room is currently experiencing an error.
Error MessageTextDisplays the error message if an error occurs in the room.
Error CodeNumberDisplays the error status code if the room is currently experiencing an error.

Events

The following events are triggered by changes in connection status, room updates, or errors in the Liveblocks Presence element. These events can initiate workflows in your app.

EventDescription
Lost ConnectionTriggers when a lost connection event occurs.
errorTriggers when an error occurs in the element.
New Room IDTriggers when the room ID changes while in the room.

🔐 Plus Plugin Only: This is only available in the Plus version of the plugin. Get the Plus plugin here.

EventDescription
Broadcast eventTriggers when a new broadcast event occurs.

Actions

Here are the actions available for the Liveblocks Presence plugin element. These actions allow you to control user presence and leave and join a room.

Create client

Description: Create the Liveblocks client.

ParameterTypeDescription
ID TokenTextThe user’s ID token. Ensure the user is authorized first using the ‘Liveblocks - Authorize User’ action.
ThrottleNumberA number between 16 and 1000 milliseconds that determines how frequently presence updates are sent.
Lost Connection TimeoutNumberAfter a user disconnects, the time in milliseconds before a “lost-connection” event is fired. Learn more

Enter Room

Description: Use this action to join a Liveblocks room. Ensure you’ve created a client with the Create Client action before proceeding.

ParameterTypeDescription
roomIdTextThe ID of the room to be joined.
userIdTextThe unique ID of the local user joining the room.
Enable positionYes/NoAn optional advanced parameter.Enable this parameter to allow live movement tracking of the user on the page.
HTML ID prefixTextAn optional advanced parameter. Add an HTML ID prefix so the plugin knows which elements to track.
hideDefaultCursorYes/NOEnable this option to hide the default browser cursor

Log Out

Description: Clears any authentication tokens from the client’s memory. Forces reauthorization of connected rooms. Use this action if you need to log out and reauthenticate the user.

Leave

Description: leave a room and unsubscribe from events

Broadcast Event

Description: Broadcast an event client-side, which requires being in an active room.

🔐 Plus Plugin Only: This is only available in the Plus version of the plugin. Get the Plus plugin here.

FieldTypeDescription
TypeTextThe type of event being broadcasted.
MessageTextThe message payload that accompanies the event.