import { AttributeType, BanditActions, BanditSubjectAttributes, EppoClient, EppoPrecomputedClient, EventDispatcher, Flag, IAssignmentDetails, IAssignmentLogger, IBanditLogger, IContainerExperiment, ObfuscatedFlag } from '@eppo/js-client-sdk-common'; import { IClientConfig, IPrecomputedClientConfig } from './i-client-config'; /** * Valid log levels for the Eppo SDK logger. * @public */ export declare type LogLevel = 'trace' | 'debug' | 'info' | 'warn' | 'error' | 'silent'; /** * Configuration interface for synchronous client initialization. * @public */ export interface IClientConfigSync { flagsConfiguration: Record; assignmentLogger?: IAssignmentLogger; banditLogger?: IBanditLogger; isObfuscated?: boolean; throwOnFailedInitialization?: boolean; enableOverrides?: boolean; overridesStorageKey?: string; configPublishedAt?: string; configFetchedAt?: string; } export { IClientConfig, IPrecomputedClientConfig }; export { IAssignmentDetails, IAssignmentEvent, IAssignmentLogger, IAsyncStore, Flag, ObfuscatedFlag, EppoAssignmentLogger, IBanditLogger, IBanditEvent, ContextAttributes, BanditSubjectAttributes, BanditActions, Attributes, AttributeType, } from '@eppo/js-client-sdk-common'; export { ChromeStorageEngine } from './chrome-storage-engine'; /** * @internal */ export declare const NO_OP_EVENT_DISPATCHER: EventDispatcher; /** * Client for assigning experiment variations. * @public */ export declare class EppoJSClient extends EppoClient { /** * @deprecated Use `getInstance()` instead. */ static instance: EppoJSClient; static initialized: boolean; private initialized; getStringAssignment(flagKey: string, subjectKey: string, subjectAttributes: Record, defaultValue: string): string; getStringAssignmentDetails(flagKey: string, subjectKey: string, subjectAttributes: Record, defaultValue: string): IAssignmentDetails; /** * @deprecated Use getBooleanAssignment instead */ getBoolAssignment(flagKey: string, subjectKey: string, subjectAttributes: Record, defaultValue: boolean): boolean; getBooleanAssignment(flagKey: string, subjectKey: string, subjectAttributes: Record, defaultValue: boolean): boolean; getBooleanAssignmentDetails(flagKey: string, subjectKey: string, subjectAttributes: Record, defaultValue: boolean): IAssignmentDetails; getIntegerAssignment(flagKey: string, subjectKey: string, subjectAttributes: Record, defaultValue: number): number; getIntegerAssignmentDetails(flagKey: string, subjectKey: string, subjectAttributes: Record, defaultValue: number): IAssignmentDetails; getNumericAssignment(flagKey: string, subjectKey: string, subjectAttributes: Record, defaultValue: number): number; getNumericAssignmentDetails(flagKey: string, subjectKey: string, subjectAttributes: Record, defaultValue: number): IAssignmentDetails; getJSONAssignment(flagKey: string, subjectKey: string, subjectAttributes: Record, defaultValue: object): object; getJSONAssignmentDetails(flagKey: string, subjectKey: string, subjectAttributes: Record, defaultValue: object): IAssignmentDetails; getBanditAction(flagKey: string, subjectKey: string, subjectAttributes: BanditSubjectAttributes, actions: BanditActions, defaultValue: string): Omit, 'evaluationDetails'>; getBanditActionDetails(flagKey: string, subjectKey: string, subjectAttributes: BanditSubjectAttributes, actions: BanditActions, defaultValue: string): IAssignmentDetails; getExperimentContainerEntry(flagExperiment: IContainerExperiment, subjectKey: string, subjectAttributes: Record): T; private ensureInitialized; /** * @internal */ init(config: Omit): Promise; /** * @internal */ offlineInit(config: IClientConfigSync): void; } /** * Builds a storage key suffix from an API key. * @param apiKey - The API key to build the suffix from * @returns A string suffix for storage keys * @public */ export declare function buildStorageKeySuffix(apiKey: string): string; /** * Initializes the Eppo client with configuration parameters. * * The purpose is for use-cases where the configuration is available from an external process * that can bootstrap the SDK. * * This method should be called once on application startup. * * @param config - client configuration * @returns a singleton client instance * @public */ export declare function offlineInit(config: IClientConfigSync): EppoClient; /** * Initializes the Eppo client with configuration parameters. * This method should be called once on application startup. * @param config - client configuration * @public */ export declare function init(config: IClientConfig): Promise; /** * Used to access a singleton SDK client instance. * Use the method after calling init() to initialize the client. * @returns a singleton client instance * @public */ export declare function getInstance(): EppoJSClient; /** * Used to build the URL for fetching the flag configuration. * @returns a URL string * @public */ export declare function getConfigUrl(apiKey: string, baseUrl?: string): string; /** * Client for assigning precomputed experiment variations. * @public */ export declare class EppoPrecomputedJSClient extends EppoPrecomputedClient { static instance: EppoPrecomputedJSClient; static initialized: boolean; getStringAssignment(flagKey: string, defaultValue: string): string; getBooleanAssignment(flagKey: string, defaultValue: boolean): boolean; getIntegerAssignment(flagKey: string, defaultValue: number): number; getNumericAssignment(flagKey: string, defaultValue: number): number; getJSONAssignment(flagKey: string, defaultValue: object): object; getBanditAction(flagKey: string, defaultValue: string): Omit, 'evaluationDetails'>; private static getAssignmentInitializationCheck; } /** * Initializes the Eppo precomputed client with configuration parameters. * This method should be called once on application startup. * @param config - client configuration * @public */ export declare function precomputedInit(config: IPrecomputedClientConfig): Promise; /** * Configuration parameters for initializing the Eppo precomputed client. * * This interface is used for cases where precomputed assignments are available * from an external process that can bootstrap the SDK client. * * @param precomputedConfiguration - The configuration as a string to bootstrap the client. * @param assignmentLogger - Optional logger for assignment events. * @param banditLogger - Optional logger for bandit events. * @param throwOnFailedInitialization - Optional flag to throw an error if initialization fails. * @public */ export interface IPrecomputedClientConfigSync { precomputedConfiguration: string; assignmentLogger?: IAssignmentLogger; banditLogger?: IBanditLogger; throwOnFailedInitialization?: boolean; enableOverrides?: boolean; overridesStorageKey?: string; } /** * Initializes the Eppo precomputed client with configuration parameters. * * The purpose is for use-cases where the precomputed assignments are available from an external process * that can bootstrap the SDK. * * This method should be called once on application startup. * * @param config - precomputed client configuration * @returns a singleton precomputed client instance * @public */ export declare function offlinePrecomputedInit(config: IPrecomputedClientConfigSync): EppoPrecomputedClient; /** * Used to access a singleton SDK precomputed client instance. * Use the method after calling precomputedInit() to initialize the client. * @returns a singleton precomputed client instance * @public */ export declare function getPrecomputedInstance(): EppoPrecomputedClient; /** * Sets the log level for the Eppo SDK logger globally. * This affects all logging across the entire SDK, including both * EppoJSClient and EppoPrecomputedJSClient instances. * * @param level - The log level to set: * - 'trace': Most verbose, logs everything * - 'debug': Detailed debugging information * - 'info': General informational messages * - 'warn': Warning messages (default in production) * - 'error': Error messages only * - 'silent': Disable all logging * * @public */ export declare function setLogLevel(level: LogLevel): void; //# sourceMappingURL=index.d.ts.map