Skip to main content

@barocss/collaboration

Version in this checkout: 0.1.3. npm · Source

Adapter contracts, presence state, and conflict-resolution support for shared document editing.

Purpose

Use this package to implement or connect a collaboration transport. Yjs and Liveblocks integrations live in separate packages.

Install

npm install @barocss/collaboration

The published package provides ES modules and TypeScript declarations. Use a bundler that supports package exports.

Public entry points

ImportRole
@barocss/collaborationPublic JavaScript and TypeScript API

Import only these public paths. Source paths such as @barocss/collaboration/src/... are not part of the published API.

Usage

import { DefaultAwarenessManager } from '@barocss/collaboration';

const awareness = new DefaultAwarenessManager();
awareness.setLocalState({ clientId: 'tab-1', user: { id: 'user-1' } });
const unsubscribe = awareness.onRemoteChange((states) => {
console.log('Remote participants', states.size);
});
// The host transport sends local state and applies received remote state.
unsubscribe();
awareness.destroy();

Integration notes

Presence and adapter primitives are not a hosted collaboration service. The host owns authentication, authorization, network transport, persistence, and adapter lifecycle. Destroy awareness managers to stop cleanup timers.

Documentation

License

MIT. The published archive includes the license in dist/LICENSE.