Skip to content

Loro

Make the editor collaborative by integrating Loro with ProseKit.

Usage

You need to install loro-crdt and loro-prosemirror to use this extension.

shell
npm install loro-crdt loro-prosemirror
shell
yarn add loro-crdt loro-prosemirror
shell
pnpm add loro-crdt loro-prosemirror
ts
import 'prosekit/extensions/loro/style.css'
import { 
LoroDoc
} from 'loro-crdt'
import {
CursorAwareness
, type
LoroDocType
} from 'loro-prosemirror'
import {
defineLoro
} from 'prosekit/extensions/loro'
const
doc
:
LoroDocType
= new
LoroDoc
()
const
awareness
= new
CursorAwareness
(
doc
.
peerIdStr
)
const
extension
=
defineLoro
({
doc
,
awareness
})

API Reference