Persisting slate-ydoc to an external database #290
Replies: 2 comments
-
https://www.hocuspocus.dev/ offers a pre-build solution for this for multiple persistence layers, but it's currently still in beta. The examples in the repo show an example on how to use it and you could combine it with e.g. https://www.npmjs.com/package/@hocuspocus/extension-redis or https://www.npmjs.com/package/@hocuspocus/extension-sqlite |
Beta Was this translation helpful? Give feedback.
-
https://docs.slate-yjs.dev/api/slate-yjs-core/utils might be helpful to you as well. It covers the utility functions required to convert between shared types and slate elements. ( |
Beta Was this translation helpful? Give feedback.
-
So in our app clients fetch the initial documents from our apps DB via a REST API. The clients then collaborate on the document. I have defined a customer persistence layer on y-websocket, and would like to persist the changed document to the same external DB via the REST API.
The barrier is transforming the the data in the ydoc that existing on y-websocket back into JSON so that I can persist the ydoc via the REST API. How do I get the initial data, and updates as one unified view from the ydoc(WSSharedDoc)?
Beta Was this translation helpful? Give feedback.
All reactions