liveblocks-best-practices

Implement and debug Liveblocks realtime collaboration features in React applications.

Updated Jul 9, 2026
One-click install
npx skills add https://github.com/DimonikRV/ghost-pilot-project --skill liveblocks-best-practices-dimonikrv
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: liveblocks-best-practices
Source: https://github.com/DimonikRV/ghost-pilot-project/tree/main/.agents/skills/liveblocks-best-practices
Command: npx skills add https://github.com/DimonikRV/ghost-pilot-project --skill liveblocks-best-practices-dimonikrv

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Building realtime collaboration features like multiplayer cursors, comments, notifications, and collaborative text editors involves many pitfalls: authentication misconfiguration, room permission errors, excessive re-renders, and connection failures. This Skill provides curated best practices and troubleshooting guidance for the entire Liveblocks ecosystem. ## Core Features & Use Cases - Authentication & Permissions: Set up ID token or access token authentication, create rooms manually with correct permissions, and compartmentalize resources with organizations. - Realtime Features: Implement presence, avatar stacks, multiplayer React Flow diagrams, custom Storage-based sync, and collaborative Tiptap, BlockNote, or Lexical text editors. - Performance & Reliability: Optimize renders with useStorage selectors and shallow comparison, handle connection errors and full rooms, and structure apps with Suspense and ErrorBoundary. - Use Case: When adding commenting to a Next.js app, load the relevant references to configure resolveUsers, customize Thread components, and send notification emails via webhooks. ## Quick Start Ask the AI to help you add Liveblocks realtime collaboration, comments, or a collaborative text editor to your React application.

Frequently Asked Questions about liveblocks-best-practices

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I authenticate users with Liveblocks in Next.js?▼

Use ID token authentication by calling liveblocks.identifyUser from @liveblocks/node in an API endpoint, passing the userId and optional userInfo. You must also create rooms manually with getOrCreateRoom and set permissions, since rooms are private by default.

How do I add a collaborative text editor with Liveblocks?▼

Use @liveblocks/react-tiptap, @liveblocks/react-blocknote, or @liveblocks/react-lexical depending on your editor. These packages provide extensions and hooks like useLiveblocksExtension that sync document content through Liveblocks rooms automatically.

What is the difference between Liveblocks Suspense and regular hooks?▼

Suspense hooks are imported from @liveblocks/react/suspense and work with ClientSideSuspense and ErrorBoundary for loading and error states. Regular hooks from @liveblocks/react return null or isLoading flags that you must check manually.

Why does my Liveblocks app re-render too often?▼

useOthers and useStorage update on every presence or storage change, up to 60 times per second. Use useOtherConnectionIds, useOthersMapped, or useStorage selectors with the shallow option to re-render only when the specific data you need changes.

How do I handle Liveblocks room connection errors?▼

Use the useErrorListener hook inside LiveblocksProvider and check error.context.type. ROOM_CONNECTION_ERROR codes indicate authentication failures (-1), missing permissions (4001), full rooms (4005), or changed room IDs (4006).

Can Liveblocks work with frameworks other than React?▼

Yes, @liveblocks/client works with any JavaScript framework including Vue, Svelte, and vanilla JS. There are also @liveblocks/redux and @liveblocks/zustand integrations, a Node.js server SDK, a Python SDK, and a REST API.