Sync engine - Liveblocks Storage
Liveblocks Storage is a realtime sync engine designed for multiplayer creative
tools such as Figma, Pitch, and Spline. LiveList, LiveMap, and LiveObject
conflict-free data types can be used to build all sorts of multiplayer tools.
Liveblocks permanently stores Storage data in each
room, handling scaling and
maintenance for you.
Our interactive React tutorial guides you through using each of the concepts listed on this page.
Presence
Easily create online presence indicators such as online avatar stacks and live
cursors, with hooks like
useOthers, which returns an
array of currently connected users in the room, and
useSelf which returns your own
data.
User info is set when authenticating with a secret key.
Conflict-free data structures
Create realtime document state such as shapes on a canvas, notes on a
whiteboard, or cells in a spreadsheet, with our
permanent CRDT-like data structures.
useStorage returns data
structures as simple JSON, and
useMutation allows you to
modify the data structures themselves.
Conflict-free data structures use
LiveObject,
LiveList, and
LiveMap under the hood, and
will automatically resolve conflicts when multiple users modify the same data at
the same time. Additionally, they can be
nested to create complex data structures
and are
automatically typed
throughout your app.
Manage document history
Multiplayer undo and redo is
notoriously tough to implement
which is why we provide simple hooks like
useUndo and
useCanUndo to handle it for
you.
We also provide useRedo and
useCanRedo to handle redo.
Broadcast
Broadcast realtime events to other clients, helpful for triggering live actions
such as playing a video, or for revalidating your database’s data after a
change.
useBroadcastEvent
sends events, and
useEventListener
listens for them.
Handle connection status
We’ve designed a number of hooks to help you handle different network
conditions, such as
useLostConnectionListener
which helps you render UI when user’s have connection loss.
Sync status
useSyncStatus is a
related hook which allows you to render the current sync state in your app,
before a change has been saved.
Other hooks
A number of other hooks are available to help you with different aspects of multiplayer development, check our API reference for more information.
Server-side modifications
Storage’s presence and conflict-free data structures can be modified through our Node.js package or via REST API.
Presence
Presence can be modified with
liveblocks.setPresence,
allowing you set an ephemeral value that will expire after a certain amount of
time.
The same operation can be performed in other languages with the Set ephemeral presence REST API.\
Conflict-free data structures
Conflict-free data structures can be modified with
liveblocks.mutateStorage,
allowing you to modify the data structures similarly to on the client-side.
The same operation can be performed using the Apply JSON Patch to Storage REST API. We have a guide on Modifying Storage via REST API with JSON Patch that covers this in more detail.
Broadcast
Broadcast can be performed with
liveblocks.broadcastEvent,
allowing you to send events to all connected clients.
The same operation can be performed using the Broadcast event to a room REST API.
API Reference
Presence
Broadcast
Storage
JavaScript
@liveblocks/client
React
@liveblocks/react
Redux
@liveblocks/redux

Zustand
@liveblocks/zustand
Node.js
@liveblocks/node
REST API
HTTP endpoints