Guide on implementing a custom provider


I am trying to implement encryption in Yjs. It seems there is no way to implement persistence with encryption using the current y-websocket & y-leveldb implementations directly. Refer: Implementing end-to-end encryption - Yjs Community

It is recommended to implement a custom provider in such a case, but I couldn’t find much documentation on it. Document Updates - Yjs Docs is useful, but the practical implementations of y-websocket & y-leveldb are a lot more complex.

Is there a simple implementation which I could follow on implementing a custom provider? What are some recommendation for implementing E2EE?


1 Like

In the live coding session here Live Coding Session - Collaborative Drawing App - YouTube dmonad/Kevin talks about implementing a custom provider with encryption at around 2:05:00 in the video. He recommends looking at the code for the SerenityNotes backend which uses good encryption apparently (same as Signal?) and I guess uses yjs and is open source at GitHub - SerenityNotes/serenity-notes-backend: End-to-end encrypted collaborative notes app.
That live coding video is a little over a year old, and the Serenity Notes backend hasn’t had much in the way of updates lately but the frontend looks like its getting very active development so maybe its current and might even be useful for you.