# Liveblocks — Realtime Collaboration Infrastructure for Apps > An open-source toolkit for adding multiplayer collaboration features like presence, cursors, comments, and real-time sync to web applications. ## Install Save as a script file and run: # Liveblocks — Realtime Collaboration Infrastructure for Apps ## Quick Use ```bash # Install the React package npm install @liveblocks/client @liveblocks/react # Initialize in your app import { createClient } from "@liveblocks/client"; const client = createClient({ publicApiKey: "pk_..." }); ``` ## Introduction Liveblocks is an open-source infrastructure toolkit for building real-time collaborative features into web applications. It provides ready-made primitives for presence indicators, live cursors, real-time document editing, threaded comments, and notifications — reducing months of custom development to days. ## What Liveblocks Does - Adds real-time presence and live cursor tracking to any web app - Provides conflict-free replicated data types (CRDTs) for document sync - Includes pre-built comment threads and notification components - Supports Yjs integration for rich text collaborative editing - Offers React hooks and vanilla JS APIs for flexible integration ## Architecture Overview Liveblocks uses a WebSocket-based real-time sync layer with CRDT conflict resolution for concurrent edits. The client SDK maintains local state that synchronizes with other connected users through the Liveblocks infrastructure. Storage is abstracted through a room-based model where each collaborative space has its own state, presence, and history. ## Self-Hosting & Configuration - Install client packages via npm for React, Vue, or vanilla JavaScript - Configure room-based access control and authentication - Set up webhooks for real-time event processing on your backend - Integrate with Yjs for advanced rich text collaboration use cases - Use the DevTools browser extension for debugging room state ## Key Features - Drop-in React hooks for presence, storage, and comments - Yjs provider for rich text collaborative editing - Built-in conflict resolution with undo/redo history - Threaded comments and notifications as pre-built components - TypeScript-first with full type safety across the API ## Comparison with Similar Tools - **Socket.IO** — low-level WebSocket library, requires building all collaboration logic - **Yjs** — CRDT library only, no hosted infrastructure or UI components - **Partykit** — lower-level primitives for real-time apps, more DIY - **Ably** — pub/sub messaging service, not collaboration-specific - **Firebase Realtime Database** — general real-time sync, no collaboration primitives ## FAQ **Q: Can I self-host the Liveblocks infrastructure?** A: The client SDK is open-source. Check the project for self-hosting options vs. the managed service. **Q: Which frameworks are supported?** A: React has first-class support with hooks. Vanilla JS and other frameworks work via the core client. **Q: How does conflict resolution work?** A: Liveblocks uses CRDTs to automatically resolve concurrent edits without data loss. **Q: Is it suitable for production applications?** A: Yes. It is designed for production use with presence, permissions, and rate limiting. ## Sources - https://github.com/liveblocks/liveblocks - https://liveblocks.io --- Source: https://tokrepo.com/en/workflows/liveblocks-realtime-collaboration-infrastructure-apps-b3b7eb26 Author: Script Depot