Follow the following steps to start configure your authentication endpoint and start building your own security logic.
liveblocks/node
packageUsers can only interact with rooms they have access to. You can
configure permission access in an api/liveblocks-auth
endpoint by
creating the src/routes/api/liveblocks-auth/+server.ts
file with the
following code. 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.
If you need to pass custom headers or data to your endpoint, you can use authEndpoint as a callback instead.
Both userId
and userInfo
can then be used in your Svelte application as
such: