Looking through the code (opens in a new tab) can be instructive for understanding how exactly
If a doc is undefined,
getOrCreateDocwill automatically generate a doc and associated docID for you. This is the docId that shows up as a search param in your app url.
And if you're using y-sweet for authentication,
getOrCreateDoc will provide an authorization token.
Say that you don't want a doc to be automatically generated for you, you can directly use
getClientToken (opens in a new tab), which is what
getOrCreateDoc calls to generate the client token.