Follow the following steps to start configure your authentication endpoint and start building your own security logic.
liveblocks/node
packageLet’s first install the @liveblocks/node
package in your
Firebase functions project.
Create a new Firebase callable function as shown below. This is where you will implement your security and define if the current user has access to a specific room.
On the front end, you can now replace the publicApiKey
option with authEndpoint
pointing to the endpoint you
just created.
A room can have defaultAccesses
, usersAccesses
, and groupsAccesses
defined.
Permissions are then checked when users try to connect to a room. For security purposes,
the room permissions can only be set on the back-end through a REST API.
For instance, you can use the create room API
to create a new room with read
public access levels while giving write
access to specific users and groups.
Both userId
and userInfo
can then be used in your JavaScript application as
such: