Function getOrCreateDoc

  • A convenience wrapper around DocumentManager.createDoc and DocumentManager.getClientToken for getting a client token for a document, given a value which may be a document ID or undefined.

    Parameters

    • Optional docId: string

      The ID of the document to get a token for. If undefined, a new doc is created.

    • Optional connectionString: string

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

    Returns Promise<ClientToken>

    A ClientToken object containing the URL and token needed to connect to the document.

Generated using TypeDoc