provider/websocket.WebsocketProvider()

Websocket Provider for Yjs. Creates a single websocket connection to each document. The document name is attached to the provided url. I.e. the following example creates a websocket connection to http://localhost:1234/my-document-name

new WebsocketProvider()

Example
import { WebsocketProvider } from 'yjs/provider/websocket/client.js'
  const provider = new WebsocketProvider('http://localhost:1234')
  const ydocument = provider.get('my-document-name')

Members

docs :Map.<string, WebsocketsSharedDocument>

Methods

get(name) → {WebsocketsSharedDocument}

Parameters:
Name Type Description
name string
Returns:
WebsocketsSharedDocument