Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface DfuseClientOptions

All the options that can be pass to dfuse Client factory createDfuseClient.

Hierarchy

  • DfuseClientOptions

Index

Properties

apiKey

apiKey: string

You dfuse API key to interact with the dfuse API service. You can obtain and manage your API keys at https://app.dfuse.io. This is the self-management portal where all information about your account can be found.

Optional apiTokenStore

apiTokenStore: ApiTokenStore

The API token store instance that should be use by the DfuseClient to retrieve and store the API token from. It's via this interface the API token is persisted and also retrieved from persistence storage when required.

When undefined (the default), a LocalStorageApiTokenStore is used when a Browser environment is detected, a OnDiskApiTokenStore is used when a Node.js environment is detected and the InMemoryApiTokenStore is used as a fallback if niether detection worked.

default

Inferred based on the environment (Browser LocalStorageApiTokenStore, Node.js OnDiskApiTokenStore, InMemoryApiTokenStore otherwise).

Optional authUrl

authUrl: undefined | string

This is the authentication URL that will be reach to issue new API token.

default

https://auth.dfuse.io

Optional httpClient

httpClient: HttpClient

The HttpClient instance that DfuseClient should use to interact with dfuse REST API. When undefined (the default), an instance is created using createHttpClient factory method and used. If DfuseClientOptions.httpClientOptions is set, it used when creating the default instanve.

default

A default HttpClient instance (via createHttpClient) using DfuseClientOptions.httpClientOptions.

Optional httpClientOptions

httpClientOptions: HttpClientOptions

The HttpClientOptions that should be used when creating the default instance of HttpClient.

This parameter has no effect at all if the DfuseClientOptions.httpClient is provided.

default

{} See HttpClientOptions for default values

network

network: "mainnet" | "jungle" | "kylin" | string

The network to connect to. Can be a plain string in the set mainnet | jungle | kylin. If it's not a string in this set, the value is assumed to be an hostname pointing to the the service, for example, your internal dfuse endpoint.

When it's a known network name, the hostname that is used will be the known hostname for this network name.

The final urls are constructed using the DfuseClientOptions.secure option to determine which protocol to use for HTTP (https or http) and WebSocket (wss or ws).

see

https://docs.dfuse.io/#endpoints

Optional refreshScheduler

refreshScheduler: RefreshScheduler

The refresh scheduler instance that should be used to schedule a token refresh. This is more an internal details of the DfuseClient should most likely undefined for most user to pick a default refresh scheduler.

default

A default RefreshScheduler instance (via createRefreshScheduler)

Optional requestIdGenerator

requestIdGenerator: RequestIdGenerator

A function that generates a random request ID. This request ID is used when using the dfuse Stream API when no specific ID is passed at registration time.

default

A generator that generates random id of the form dc-<13-hex-chars>.

Optional secure

secure: undefined | false | true

Whether to use secure protocols or unsecure ones. This will control final URL constructed using this parameter value and the actual hostname as defined by the DfuseClientOptions.network value.

Optional streamClient

streamClient: StreamClient

The StreamClient instance that DfuseClient should use to interact with dfuse Stream API. When undefined (the default), an instance is created using createStreamClient factory method and used. If DfuseClientOptions.streamClientOptions is set, it used when creating the default instanve.

default

A default StreamClient instance (via createStreamClient) using DfuseClientOptions.httpClientOptions.

Optional streamClientOptions

streamClientOptions: StreamClientOptions

The StreamClientOptions that should be used when creating the default instance of StreamClient.

This parameter has no effect at all if the DfuseClientOptions.streamClient is provided.

default

{} See StreamClientOptions for default values

Generated using TypeDoc