• A convenience wrapper around DocumentManager.createDoc for creating a new document. If a document with the given ID already exists, this is a no-op.

    Parameters

    • connectionString: string

      A connection string (starting with ys:// or yss://) referring to a y-sweet server.

    • Optional docId: string

      The ID of the document to create. If not provided, a random ID will be generated.

    Returns Promise<DocCreationResult>

    A DocCreationResult object containing the ID of the created document.