Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
S

slate-collaborative

> 前端框架
Open source

slatejs collaborative plugin & microservice https://slate-collaborative.herokuapp.com/

389 stars0 likes0 views
WebsiteGitHub

About

slatejs collaborative plugin & microservice https://slate-collaborative.herokuapp.com/

slate-collaborative. Check demo

slatejs collaborative plugin & microservice

A little experiment for co-editing.

Based on idea of https://github.com/humandx/slate-automerge

API

Client

Use it as a simple slatejs plugin

typescript
import { withIOCollaboration } from '@slate-collaborative/client'

const collaborationEditor = withIOCollaboration(editor, options)

Check detailed example

Options:

typescript
{
  docId?: // document id
  url?: string // url to open connection
  connectOpts?: SocketIOClient.ConnectOpts // socket.io-client options
  cursorData?: any // any data passed to cursor
  onConnect?: () => void // connect callback
  onDisconnect?: () => void // disconnect callback
  onError?: (reason: string) => void // error callback
  preserveExternalHistory?: boolean // preserve slate-history operations form other clients
}

You need to attach the useCursor decorator to provide custom cursor data in renderLeaf function

typescript
import { useCursor } from '@slate-collaborative/client'

const decorator = useCursor(editor)

Backend

typescript
const { SocketIOConnection } = require('@slate-collaborative/backend')

const connection = new SocketIOConnection(options)

options:

typescript
{
  entry: Server // or specify port to start io server
  defaultValue: Node[] // default value
  saveFrequency: number // frequency of onDocumentSave callback execution in ms
  onAuthRequest: ( // auth callback
    query: Object,
    socket?: SocketIO.Socket
  ) => Promise | boolean
  onDocumentLoad: ( // request slate document callback
    pathname: string,
    query?: Object
  ) => Promise | Node[]
  onDocumentSave: (pathname: string, doc: Node[]) => Promise | void // save document callback
}

Contribute

You welcome to contribute!

start it ease:

bash
yarn
yarn dev

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

TypeScriptautomergecollaborationcollaborative-editingcrdt

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category前端框架
PricingOpen source

> Related tools

R
React
用于构建用户界面的 JavaScript 库
V
Vue.js
渐进式 JavaScript 框架
N
Next.js
基于 React 的全栈 Web 框架