Open vincesp opened 1 year ago
I think the best way to do this is to create a document in your database with an initial value through a POST request and open that document from the backend.
I've managed to get a Plate.js + Slate-yjs + y-socket.io setup to work using the 'document-update' and the 'document-loaded' event handlers from this library, and the app is 100% server-driven. If you're trying to get a similar setup, I'd be happy to give you some pointers!
hi @midsplit, I working on something similar, if you don't mind could you share some pointers on how you got this working?
There are use cases where the server is the master of the documents. Is there a better way to have documents created by the server than opening a socket to self, i.e., running a client on the server?
y-websocket has
getYDoc()
to create new documents on the server.Couldn't y-socket.io somehow export
initDocument()
as well?