See the tldraw-yjs example for an example of how to use yjs with the @tldraw/tldraw library.
@tldraw/tldraw