Options
Menu

Class Convergence

This is the entry point for the Convergence JS client. It allows users to connect to the Convergence Engine using a variety of authentication methods. On success, each connection method returns a ConvergenceDomain bound to the Domain at the specified URL.

See the Developer Guide for more information about authentication options.

Hierarchy

  • Convergence

Index

Methods

StaticconfigureLogging

  • Allows customization of both the root (default) logger and any ancillary loggers.

    Convergence.configureLogging({
      root: LogLevel.ERROR,
      loggers: {
        "connection": LogLevel.DEBUG
      }
    });

    The available loggers (and where / how they are used) are:

    • "connection" (Connection and authentication messages)
    • "protocol.messages" (All messages to/from the server)
    • "protocol.ping" (All ping/pong messages to/from the server)
    • "heartbeat" (Heartbeat messages)
    • "activities.activity" (Activity)
    • "activities.service" (ActivityService)
    • "models" (ModelService, RealTimeModel)
    • "storage" (Offline store)

    Parameters

    Returns void

Staticconnect

  • Connects to a Convergence Domain using username / password authentication.

    deprecated

    Use connectWithPassword instead.

    Parameters

    • url: string

      The URL of the Convergence Domain to connect to.

    • username: string

      The username of the Convergence Domain User to connect as.

    • password: string

      The password for the corresponding Convergence Domain User.

    • Optional options: IConvergenceOptions

      Options that configure the behavior of the client.

    • Optional cancellationToken: CancellationToken

      Allow the user to bind a callback to cancel the connection.

    Returns Promise<ConvergenceDomain>

    A Promise which will be resolved with the ConvergenceDomain upon successful connection.

StaticconnectAnonymously

  • Connects to a Convergence Domain using anonymous authentication. For this to work, the domain must be configured to allow anonymous authentication.

    Parameters

    • url: string

      The URL of the Convergence Domain to connect to.

    • Optional displayName: string | function

      The display name to use for the anonymous user.

    • Optional options: IConvergenceOptions

      Options that configure the behavior of the client.

    • Optional cancellationToken: CancellationToken

      Allow the user to bind a callback to cancel the connection.

    Returns Promise<ConvergenceDomain>

    A Promise which will be resolved with the ConvergenceDomain upon successful connection.

StaticconnectWithJwt

  • Connects to a Convergence Domain using a JSON Web Token (JWT) for authentication. See the developer guide for information about configuring the server to accept JWTs.

    Parameters

    • url: string

      The URL of the Convergence Domain to connect to.

    • jwt: string | function

      A valid JSON Web Token (JWT) indicating the Domain User to connect as.

    • Optional options: IConvergenceOptions

      Options that configure the behavior of the client.

    • Optional cancellationToken: CancellationToken

      Allow the user to bind a callback to cancel the connection.

    Returns Promise<ConvergenceDomain>

    A Promise which will be resolved with the ConvergenceDomain upon successful connection.

StaticconnectWithPassword

  • Connects to a Convergence Domain using username / password authentication.

    Parameters

    • url: string

      The URL of the Convergence Domain to connect to.

    • credentials: IUsernameAndPassword | function

      The username and password of the Convergence Domain User to connect as.

    • Optional options: IConvergenceOptions

      Options that configure the behavior of the client.

    • Optional cancellationToken: CancellationToken

      Allow the user to bind a callback to cancel the connection.

    Returns Promise<ConvergenceDomain>

    A Promise which will be resolved with the ConvergenceDomain upon successful connection.

Staticreconnect

  • Reconnects to the specified domain using a previously generated reconnect token (which can be obtained from an existing ConvergenceSession).

    Parameters

    • url: string

      The URL of the Convergence Domain to connect to

    • token: string

      The reconnect token to use for authentication

    • Optional options: IConvergenceOptions

      Options that configure the behavior of the client.

    • Optional cancellationToken: CancellationToken

      Allow the user to bind a callback to cancel the connection.

    Returns Promise<ConvergenceDomain>

    A Promise which will be resolved with the ConvergenceDomain upon successful connection.