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

Optional apiKey

apiKey: undefined | 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.

If you are connecting to a dfuse for EOSIO instance (or a local instance of our other supported chains) or if you are connection to a dfuse Community Edition, you can leave this value blank but you need to also set authentication: false otherwise the client factory function will complain that apiKey is required.

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 if authentication is set to true.

default

'https://auth.dfuse.io' if authentication: true, 'null://' otherwise

Optional authentication

authentication: undefined | false | true

Whether authentication mechanism should be used for this client instance. If you are connecting to a dfuse for EOSIO instance (or a local instance of our other supported chains) or if you are connection to a dfuse Community Edition, set this value to false so authentication will be disabled altogether.

default

true

Optional graphqlStreamClient

graphqlStreamClient: GraphqlStreamClient

The GraphqlStreamClient instance that DfuseClient should use to interact with dfuse GraphQL Subscription API. When undefined (the default), an instance is created using createGraphqlStreamClient factory method and used. If DfuseClientOptions.graphqlStreamClientOptions is set, it used when creating the default instanve.

default

A default GraphqlStreamClient instance (via createGraphqlStreamClient) using DfuseClientOptions.graphqlStreamClientOptions.

Optional graphqlStreamClientOptions

graphqlStreamClientOptions: GraphqlStreamClientOptions

The GraphqlStreamClientOptions that should be used when creating the default instance of GraphqlStreamClient.

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

default

{} See GraphqlStreamClientOptions for default values

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" | "kylin" | string

The network to connect to. Can be a plain string in the set mainnet | jungle | kylin | worbli. 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.

default

true

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.streamClientOptions.

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