Function getClientToken

  • A convenience wrapper around DocumentManager.getClientToken for getting a client token for a document.

    Parameters

    • connectionString: string

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

    • docId: string | DocCreationResult

      The ID of the document to get a token for.

    • Optional authDocRequest: AuthDocRequest

      An optional AuthDocRequest providing options for the token request.

    Returns Promise<ClientToken>

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