> ## Documentation Index
> Fetch the complete documentation index at: https://tools.lunchpaillabs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Liveblocks Presence

> Use this element  to enable real-time presence tracking in your Bubble app.

export const feature_1 = "action"

export const feature_0 = "event"

### 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.

| **State**           | **Type**    | **Description**                                                                                                                                      |
| ------------------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| **others**          | Text (list) | Other users in the room. Empty when no room is currently synced.                                                                                     |
| **Room ID**         | Text        | The room where this element is currently monitoring presence.                                                                                        |
| **Everyone**        | Text (list) | All users currently in the room, including the local user.                                                                                           |
| **User ID**         | Text        | The Liveblocks user ID for the current user.                                                                                                         |
| **Lost Connection** | Text        | A special event that triggers when a previously connected Liveblocks client loses connection. The possible statuses are: lost, restored, and failed. |
| **Error**           | Yes/No      | Displays the error message if the room is currently experiencing an error.                                                                           |
| **Error Message**   | Text        | Displays the error message if an error occurs in the room.                                                                                           |
| **Error Code**      | Number      | Displays 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.

| **Event**           | **Description**                                      |
| ------------------- | ---------------------------------------------------- |
| **Lost Connection** | Triggers when a lost connection event occurs.        |
| **error**           | Triggers when an error occurs in the element.        |
| **New Room ID**     | Triggers when the room ID changes while in the room. |

<Warning>
  🔐 Plus Plugin Only: This {feature_0} is only available in the Plus version of
  the plugin. Get the Plus plugin [here](mailto:help@lunchpaillabs.com).
</Warning>

| **Event**           | **Description**                             |
| ------------------- | ------------------------------------------- |
| **Broadcast event** | Triggers 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](https://liveblocks.io/docs/api-reference/liveblocks-client#createClient).

| **Parameter**               | **Type** | **Description**                                                                                                                                                                                          |
| --------------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **ID Token**                | Text     | The user's ID token. Ensure the user is authorized first using the 'Liveblocks - Authorize User' action.                                                                                                 |
| **Throttle**                | Number   | A number between 16 and 1000 milliseconds that determines how frequently presence updates are sent.                                                                                                      |
| **Lost Connection Timeout** | Number   | After a user disconnects, the time in milliseconds before a "lost-connection" event is fired. [Learn more](https://liveblocks.io/docs/api-reference/liveblocks-client#createClientLostConnectionTimeout) |

#### **Enter Room**

**Description:** Use this action to join a Liveblocks room. Ensure you’ve created a client with the [Create Client action](#create-client) before proceeding.

| **Parameter**         | **Type** | **Description**                                                                                               |
| --------------------- | -------- | ------------------------------------------------------------------------------------------------------------- |
| **roomId**            | Text     | The ID of the room to be joined.                                                                              |
| **userId**            | Text     | The unique ID of the local user joining the room.                                                             |
| **Enable position**   | Yes/No   | An optional advanced parameter.Enable this parameter to allow live movement tracking of the user on the page. |
| **HTML ID prefix**    | Text     | An optional advanced parameter. Add an HTML ID prefix so the plugin knows which elements to track.            |
| **hideDefaultCursor** | Yes/NO   | Enable 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.

<Warning>
  🔐 Plus Plugin Only: This {feature_1} is only available in the Plus version of
  the plugin. Get the Plus plugin [here](mailto:help@lunchpaillabs.com).
</Warning>

| **Field**   | **Type** | **Description**                                 |
| ----------- | -------- | ----------------------------------------------- |
| **Type**    | Text     | The type of event being broadcasted.            |
| **Message** | Text     | The message payload that accompanies the event. |

***

<CardGroup cols={2}>
  <Card title="Need Help?" icon="envelope" href="/support/plans">
    View our options for free community and priority support.
  </Card>

  <Card title="Have a feature request?" icon="lightbulb" href="https://lunchpaillabs.canny.io/feature-requests?selectedCategory=liveblocks-plugin-for-bubble">
    Post your feature request on our

    <a href="https://lunchpaillabs.canny.io/feature-requests?selectedCategory=liveblocks-plugin-for-bubble">
      idea board.
    </a>
  </Card>
</CardGroup>
