liveblocks
БесплатноБез исполняемых скриптовНе проверенLiveblocks is a hosted platform for adding real-time collaboration to web apps: live cursors, presence, shared storage, comments, notifications and…
от TerminalSkills★ 221 звезда на GitHubОб этом скилле
Liveblocks — Real-Time Collaboration SDK
Overview
Liveblocks runs the WebSocket servers, storage and permissions for collaborative features. A room is a shared space; inside it you get Presence (per-user, ephemeral: cursor, selection), Storage (persistent conflict-free data built from LiveObject, LiveList, LiveMap), Comments (threads, composer, UI components), Notifications, and editor bindings (@liveblocks/react-tiptap, react-lexical, react-blocknote, @liveblocks/yjs). Current packages are 3.x (3.24 in October 2026); keep every @liveblocks/* package on the same version.
In 3.x you import hooks directly from @liveblocks/react/suspense (Suspense hooks: data is always defined) or @liveblocks/react (regular hooks: data is null while loading). Types are declared once, globally, in liveblocks.config.ts. createRoomContext still exists but is the non-standard route.
Instructions
- Install and generate the config file:
npm install @liveblocks/client @liveblocks/react
npm install @liveblocks/react-ui # Thread, Composer, notifications UI
npm install @liveblocks/node # server-side auth, REST API
npx create-liveblocks-app@latest --init --framework react
- Declare your types by augmenting the global
Liveblocksinterface (keys:Presence,Storage,UserMeta,RoomEvent,ThreadMetadata,RoomInfo):
// liveblocks.config.ts
import type { LiveList, LiveObject } from "@liveblocks/client";
type Shape = { id: string; x: number; y: number; width: number; height: number; fill: string };
declare global {
interface Liveblocks {
Presence: { cursor: { x: number; y: number } | null; selectedId: string | null };
Storage: { shapes: LiveList<LiveObject<Shape>> };
UserMeta: { id: string; info: { name: string; avatar: string; color: string } };
ThreadMetadata: { elementId: string; resolved: boolean };
}
}
export {};
- Wrap the app in
LiveblocksProvider(client config:publicApiKeyfor prototypes,authEndpointfor production), thenRoomProvider(roomid,initialPresence,initialStorage), thenClientSideSuspense(renders the fallback on the server, since Suspense hooks throw there):
// app/Room.tsx
"use client";
import { ReactNode } from "react";
import { LiveList } from "@liveblocks/client";
import { ClientSideSuspense, LiveblocksProvider, RoomProvider } from "@liveblocks/react/suspense";
export function Room({ roomId, children }: { roomId: string; children: ReactNode }) {
return (
<LiveblocksProvider authEndpoint="/api/liveblocks-auth" throttle={50}>
<RoomProvider id={roomId} initialPresence={{ cursor: null, selectedId: null }}
initialStorage={{ shapes: new LiveList([]) }}>
<ClientSideSuspense fallback={<div>Loading…</div>}>{children}</ClientSideSuspense>
</RoomProvider>
</LiveblocksProvider>
);
}
initialStorage only applies the first time a room is created; later changes to it have no effect. throttle (16 to 1000 ms, default 100) controls how often updates are sent.
- Presence hooks:
useOthers,useSelf,useMyPresence,useUpdateMyPresence(merges a partial object and re-renders less thanuseMyPresence). Storage hooks:useStorage(selector)reads immutable snapshots,useMutation(({ storage, self, others, setMyPresence }, ...args) => ...)writes. Pass selectors to avoid re-rendering on unrelated changes. - Comments:
useThreads,useCreateThread,useCreateCommentfrom@liveblocks/react/suspense, ready-madeThreadandComposerfrom@liveblocks/react-ui, andimport "@liveblocks/react-ui/styles.css"once in the root layout.resolveUsers/resolveMentionSuggestionsonLiveblocksProviderturn user IDs into names and avatars. - Auth on the server:
Liveblocks.identifyUser(ID token, recommended for most apps; permissions come from room accesses and groups) orprepareSession(access token, you list the rooms per request). Never cache the auth endpoint's response. The secret key (sk_...) stays on the server.
Examples
Live cursors
// components/LiveCursors.tsx
"use client";
import { useOthers, useUpdateMyPresence } from "@liveblocks/react/suspense";
export function LiveCursors({ children }: { children: React.ReactNode }) {
const others = useOthers();
const updateMyPresence = useUpdateMyPresence();
return (
<div
style={{ position: "relative", height: "100vh" }}
onPointerMove={(e) => {
const box = e.currentTarget.getBoundingClientRect();
updateMyPresence({ cursor: { x: e.clientX - box.left, y: e.clientY - box.top } });
}}
onPointerLeave={() => updateMyPresence({ cursor: null })}
>
{children}
{others.map(({ connectionId, presence, info }) =>
presence.cursor ? (
<div key={connectionId} style={{ position: "absolute", left: presence.cursor.x,
top: presence.cursor.y, pointerEvents
Установить liveblocks в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл liveblocks?
Liveblocks is a hosted platform for adding real-time collaboration to web apps: live cursors, presence, shared storage, comments, notifications and collaborative text editors. Use this skill when a user wants multiplayer features in a React or Next.js app, asks how to use Liveblocks hooks (useOthers, useStorage, useMutation, useThreads), set up the LiveblocksProvider and RoomProvider, or write the server auth endpoint with @liveblocks/node.
Как установить скилл liveblocks?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл liveblocks запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic