
Product
PHP and Composer Support Is Now in Beta
Socket’s PHP and Composer support is now in Beta for all customers, with PHP reachability analysis generally available.
@hocuspocus/provider
Advanced tools
The client-side provider for Hocuspocus. Connects to a Hocuspocus server over WebSockets and syncs one or more Y.js documents — including awareness (presence), authentication, and stateless messaging.
Building a React app? Use
@hocuspocus/provider-reactinstead — it wraps the provider in components and hooks so React handles the lifecycle for you (including StrictMode double-mounts).
npm install @hocuspocus/provider yjs
import * as Y from "yjs"
import { HocuspocusProvider } from "@hocuspocus/provider"
const ydoc = new Y.Doc()
const provider = new HocuspocusProvider({
url: "ws://127.0.0.1:1234",
name: "example-document",
document: ydoc,
})
Changes to ydoc are now synced to every other client connected to the same name.
Pass a token — it's forwarded to the server's onAuthenticate hook:
new HocuspocusProvider({
url: "wss://collab.example.com",
name: "example-document",
document: ydoc,
token: "super-secret-token",
})
Create a HocuspocusProviderWebsocket once, then reuse it for multiple documents:
import {
HocuspocusProvider,
HocuspocusProviderWebsocket,
} from "@hocuspocus/provider"
const socket = new HocuspocusProviderWebsocket({ url: "ws://127.0.0.1:1234" })
const doc1 = new HocuspocusProvider({ websocketProvider: socket, name: "doc-1" })
const doc2 = new HocuspocusProvider({ websocketProvider: socket, name: "doc-2" })
Call provider.destroy() to disconnect a single document. Call socket.destroy() to tear down the shared connection.
Full configuration, events, and awareness reference: tiptap.dev/docs/hocuspocus/provider.
MIT — see LICENSE.md.
y-websocket is a WebSocket provider for Yjs that enables real-time collaboration over WebSocket connections. It is similar to @hocuspocus/provider in that it facilitates the synchronization of Yjs documents across clients. However, @hocuspocus/provider offers additional features such as awareness states and a more flexible API for handling connections and events.
ShareDB is a real-time database backend based on Operational Transformation (OT) that allows for collaborative editing. While it provides similar real-time collaboration capabilities, it uses a different algorithm (OT vs. CRDT) and is not specifically designed to work with Yjs. ShareDB is more focused on providing a backend for real-time applications, whereas @hocuspocus/provider is tailored for use with Yjs and CRDTs.
Automerge is a library for building collaborative applications using CRDTs. Like @hocuspocus/provider, it enables real-time collaboration, but it is a more general-purpose CRDT library that does not include built-in networking capabilities. Developers need to implement their own networking layer to synchronize changes between clients.
FAQs
hocuspocus provider
The npm package @hocuspocus/provider receives a total of 710,316 weekly downloads. As such, @hocuspocus/provider popularity was classified as popular.
We found that @hocuspocus/provider demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 6 open source maintainers collaborating on the project.

Product
Socket’s PHP and Composer support is now in Beta for all customers, with PHP reachability analysis generally available.

Product
Socket is bringing experimental protection to Firefox, scanning 97,000+ extensions in Mozilla's official directory for malware and risky updates.

Research
/Security News
Three compromised Rust crates pulled in a malicious dependency that downloaded and executed cross-platform malware during Cargo builds.