Get started - Get started with Liveblocks and Redux
Liveblocks is a realtime collaboration infrastructure for building performant
collaborative experiences. Follow the following steps to start making your Redux
state multiplayer by using the
store enhancer
from the @liveblocks/redux
package.
Quickstart
Install Liveblocks
Every package should use the same version.
Initialize the
liveblocks.config.ts
fileWe can use this file later to define types for our application.
Connect your Redux store to Liveblocks
Create the Liveblocks client and use the
liveblocksEnhancer
in your Redux store setup. This will add a new state calledliveblocks
to your store, enabling you to interact with our Presence and Storage APIs.store.tsJoin a Liveblocks room
Liveblocks uses the concept of rooms, separate virtual spaces where people collaborate. To create a realtime experience, multiple users must be connected to the same room.
App.tsxUse the Liveblocks data from the store
Now that we’re connected to a room, we can start using the Liveblocks data from the Redux store.
Room.tsxNext: set up authentication
By default, Liveblocks is configured to work without an authentication endpoint where everyone automatically has access to rooms. This approach is great for prototyping and marketing pages where setting up your own security isn’t always required. If you want to limit access to a room for certain users, you’ll need to set up an authentication endpoint to enable permissions.
Set up authentication
What to read next
Congratulations! You now have set up the foundation to start building collaborative experiences for your Redux store.
- @liveblocks/redux API Reference
- Redux guides
- How to create a collaborative online whiteboard with Redux
- How to create a collaborative to-do list with Redux