I would like something similar to this: Getting Started
Probably your best bet is to analyze the source code for that project. There isn’t any out-of-the-box YJS feature that provides record functionality.
Can you not just use the undo manager?
I haven’t used the UndoManager, so I’m not sure. Sounds plausible though.