Home > @eppo/js-client-sdk > IClientConfig
Configuration used for initializing the Eppo client
Signature:
export interface IClientConfig
Property | Modifiers | Type | Description |
---|---|---|---|
apiKey | string | Eppo API key | |
assignmentLogger | IAssignmentLogger | Pass a logging implementation to send variation assignments to your data warehouse. | |
baseUrl? | string | (Optional) Base URL of the Eppo API. Clients should use the default setting in most cases. | |
forceReinitialize? | boolean | (Optional) Force reinitialize the SDK if it is already initialized. | |
maxCacheAgeSeconds? | number | (Optional) Maximum age, in seconds, previously cached values are considered valid until new values will be fetched (default: 0) | |
numInitialRequestRetries? | number | (Optional) Number of additional times the initial configuration request will be attempted if it fails. This is the request typically synchronously waited (via await) for completion. A small wait will be done between requests. (Default: 1) | |
numPollRequestRetries? | number | (Optional) Number of additional times polling for updated configurations will be attempted before giving up. Polling is done after a successful initial request. Subsequent attempts are done using an exponential backoff. (Default: 7) | |
persistentStore? | IAsyncStore<Flag> | (Optional) A custom class to use for storing flag configurations. This is useful for cases where you want to use a different storage mechanism than the default storage provided by the SDK. | |
pollAfterFailedInitialization? | boolean | (Optional) Poll for new configurations even if the initial configuration request failed. (default: false) | |
pollAfterSuccessfulInitialization? | boolean | (Optional) Poll for new configurations (every pollingIntervalMs ) after successfully requesting the initial configuration. (default: false) |
|
pollingIntervalMs? | number | (Optional) Amount of time to wait between API calls to refresh configuration data. Default of 30_000 (30 seconds). | |
requestTimeoutMs? | number | (Optional) * Timeout in milliseconds for the HTTPS request for the experiment configuration. (Default: 5000) | |
skipInitialRequest? | boolean | (Optional) Skip the request for new configurations during initialization. (default: false) | |
throwOnFailedInitialization? | boolean | (Optional) Throw an error if unable to fetch an initial configuration during initialization. (default: true) | |
updateOnFetch? | ServingStoreUpdateStrategy | (Optional) Sets how the configuration is updated after a successful fetch - always: immediately start using the new configuration - expired: immediately start using the new configuration only if the current one has expired - empty: only use the new configuration if the current one is both expired and uninitialized/empty | |
useExpiredCache? | boolean | (Optional) Whether initialization will be considered successfully complete if expired cache values are loaded. If false, initialization will always wait for a fetch if cached values are expired. (default: false) |