The IConvergenceOptions interface represents that options that can be set within Convergence when connecting to a domain.

See the ConvergenceOptions implementation for the default settings.

### Hierarchy

- IConvergenceOptions

## Index

### Properties

- connection
- offline
- protocol
- reconnect
- webSocket

## Properties

### Optionalconnection

connection: object

Options that configure the connection strategy.

#### Type declaration

- ##### Optional handshakeTimeout?: number

  The maximum time in seconds to wait for a successful handshake to be made after the web socket connection is successful.

- ##### Optional timeout?: number

  The maximum time in seconds to wait for a successful web socket connection to be made.

### Optionaloffline

offline: object

Configures offline storage for Convergence. Several of these options are required to enable offline editing of data.

experimental

#### Type declaration

- ##### Optional modelSnapshotInterval?: number

  The number of operations after which a snapshot of local offline that is being edited should be taken. The default is 100.

  experimental

- ##### storage: IStorageAdapter

  The storage adapter to use for offline storage.

  experimental

### Optionalprotocol

protocol: object

Configures the behavior of the messaging protocol subsystem.

#### Type declaration

- ##### defaultRequestTimeout: number

  The timeout for a request to the server, in seconds. Defaults to 10.

- ##### Optional heartbeat?: object

  Configures the keep-alive heartbeat.

  - ##### enabled: boolean

    Determines if the heartbeat is enabled.

  - ##### Optional pingInterval?: number

    Configures how long the client will wait, in seconds after the last message is received from the server before a ping will be sent. Defaults to 5.

  - ##### Optional pongTimeout?: number

    Specifies the time in seconds the client will wait for a response from the server to a ping before considering the connection dead. Defaults to 10.

### Optionalreconnect

reconnect: object

Options that configure how Convergence will reconnect when a connection is lost.

#### Type declaration

- ##### Optional autoReconnect?: boolean

  Whether to automatically reconnect. Default is true.

- ##### Optional fallbackAuth?: function

  The fallbackAuth method to use when a reconnect token is rejected. It provides the opportunity to use a fallback method of authentication.

      options.reconnect.fallbackAuth = (authChallenge:IFallbackAuthChallenge) => {
        return Authentication.fetchJWT().then(jwt => {
          authChallenge.jwt(jwt);
        })
      };

  - - (authChallenge: IFallbackAuthChallenge): void

    - #### Parameters

      - ##### authChallenge: IFallbackAuthChallenge

      #### Returns void

- ##### Optional reconnectIntervals?: number[]

  The intervals to use between reconnects. This array will be sorted from smallest to largest. When the largest interval is reached it will simply be repeated.

### OptionalwebSocket

webSocket: object

Options that configure how Convergence will use WebSockets.

See the Node.js Usage section on [this page] for an example of these parameters in action.

#### Type declaration

- ##### Optional class?: IWebSocketClass

  The constructor to use when creating a web socket. Essentially this is class that should be used to represent the web socket.

- ##### Optional factory?: WebSocketFactory

  Defines the class / constructor that should be used to create WebSocket objects. This is useful when operating in NodeJS where a library like ws or isomorphic-ws can be used to provide a client side WebSocket API.