@remirror/extension-yjs
v4.0.1
Published
Realtime collaboration with yjs
Downloads
109,575
Readme
@remirror/extension-yjs
Realtime collaboration with yjs
Installation
# yarn
yarn add yjs @remirror/extension-yjs
# pnpm
pnpm add yjs @remirror/extension-yjs
# npm
npm install yjs @remirror/extension-yjs
You will also need to install your preferred YjsRealtimeProvider
.
Due to the required peer dependencies this package is not included by default when installing remirror
.
You will also need to install your preferred yjs protocol
# yarn
yarn add y-webrtc
# pnpm
pnpm add y-webrtc
# npm
npm install y-webrtc
Usage
The following code creates an instance of this extension.
import { WebrtcProvider } from 'y-webrtc';
import { Doc } from 'yjs';
import { YjsExtension } from '@remirror/extension-yjs';
const extension = new YjsExtension({
getProvider: () => new WebrtcProvider('global', new Doc()),
});