liveblocks-best-practices

Implements and debugs Liveblocks realtime collaboration features in React applications.

Updated Sep 19, 2026
One-click install
npx skills add https://github.com/paramcodes/autobro --skill liveblocks-best-practices-paramcodes
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: liveblocks-best-practices
Source: https://github.com/paramcodes/autobro/tree/main/.agents/skills/liveblocks-best-practices
Command: npx skills add https://github.com/paramcodes/autobro --skill liveblocks-best-practices-paramcodes

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 tricky authentication, permissions, performance, and error-handling decisions. This Skill provides curated best practices and troubleshooting guidance for every Liveblocks feature so you avoid common pitfalls. ## Core Features & Use Cases - Authentication & Permissions: Set up ID token or access token auth, create rooms manually with correct permissions, and compartmentalize resources with organizations. - Collaboration Features: Implement comments, threads, notifications, presence, avatar stacks, multiplayer React Flow diagrams, and collaborative Tiptap, BlockNote, or Lexical editors. - Performance & Reliability: Optimize renders with useStorage selectors and presence hooks, handle connection errors, full rooms, unstable networks, and loading or error states with Suspense. - Use Case: When adding a collaborative Tiptap editor with commenting to a Next.js app, load the relevant references to configure authentication, resolve user info, and structure Suspense boundaries correctly. ## Quick Start Use the liveblocks-best-practices skill to help me set up authentication and a collaborative text editor with Liveblocks in my React app.

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?▼

Liveblocks authentication uses an auth endpoint that calls identifyUser from @liveblocks/node with the user's ID, returning a token to the client. ID tokens are the recommended method and require creating rooms manually with explicit permissions via getOrCreateRoom.

What is the difference between Liveblocks ID tokens and access tokens?▼

ID tokens are the recommended Liveblocks authentication method and work best with complex permissions set per room. Access tokens are simpler, using prepareSession with wildcard room naming patterns, and suit basic permission models.

How do I add comments and threads to a React app with Liveblocks?▼

Add Liveblocks comments by installing @liveblocks/react-ui and rendering Thread and Composer components inside a RoomProvider. You must configure resolveUsers in LiveblocksProvider so user names and avatars appear in threads.

Does Liveblocks work with Tiptap, BlockNote, and Lexical editors?▼

Liveblocks provides dedicated packages for each editor: @liveblocks/react-tiptap, @liveblocks/react-blocknote, and @liveblocks/react-lexical. These add realtime collaboration, cursors, and threaded comments to the respective editors.

Why does useOthers cause too many re-renders in Liveblocks?▼

useOthers re-renders on every presence change, which can occur up to 60 times per second. Use useOtherConnectionIds with useOther, or useOthersMapped with a selector and shallow comparison, to limit updates to relevant changes.

How do I handle Liveblocks room connection errors?▼

Handle Liveblocks connection errors with the useErrorListener hook inside LiveblocksProvider, checking error.context.type for ROOM_CONNECTION_ERROR. Error codes distinguish causes: 4001 for missing access, 4005 for full rooms, and 4006 for changed room IDs.