How do I create a Yjs Doc with initial default value?

I have specific requirement in my Notes application, where user creates a note, they should get some default data already in the editor.

Lets say,

const initialData = "Welcome to notes application...."
const docWithInitialData = new Y.Doc(default=initialData)

(and if I use docWithInitialData, it will have initial data 
without any client making any transactions. Later on they 
can wipe the initial data, its up to them)

above is example code of what I am expecting. I might be not entirely sure how Y.js docs work but this is what I need.

Is there any way, by which I can generate similar outcome ?

Also I want to intercept the cursors of connected users and give suggestions using AI (something similar to what Github Copilot does in vs code)

How can I intercept docs and do Y Doc manipulation when required after client starts typing??

Try this. This will create a document with a text node and then populate the text node with the initial data.

const Y = require('yjs')

const doc = new Y.Doc()
const text = doc.getText('text')
const initialData = "Welcome to notes application...."
text.insert(0, initialData)

console.log(JSON.stringify(doc))