@zerocost/sdk 0.10.0 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -12,31 +12,27 @@ export declare class ZerocostSDK {
12
12
  widget: WidgetModule;
13
13
  data: LLMDataModule;
14
14
  recording: RecordingModule;
15
- private configPollTimer;
16
15
  private lastConfigHash;
16
+ private lastDataCollectionHash;
17
+ private configSyncInFlight;
18
+ private lastConfigSyncAt;
19
+ private cleanupConfigListeners;
17
20
  constructor(config: ZerocostConfig);
18
- /**
19
- * Initialize the SDK. Automatically:
20
- * 1. Fetches display preferences and injects ad slots into the DOM
21
- * 2. Starts LLM data collection if enabled
22
- * 3. Starts UX session recording if enabled
23
- * 4. Polls for config changes every 5s — instant ad format switching
24
- *
25
- * No custom components needed — ads render automatically.
26
- * Enable `debug: true` in config to see detailed logs.
27
- */
28
21
  init(): Promise<void>;
22
+ refreshConfig(options?: {
23
+ force?: boolean;
24
+ reason?: string;
25
+ }): Promise<void>;
29
26
  private fetchConfig;
30
- private applyConfig;
31
27
  private configToHash;
32
- private startConfigPolling;
33
- /**
34
- * Tear down all modules.
35
- */
28
+ private dataCollectionToHash;
29
+ private syncDataCollection;
30
+ private getConfigCacheKey;
31
+ private readCachedConfig;
32
+ private writeCachedConfig;
33
+ private startConfigSync;
34
+ private patchHistory;
36
35
  destroy(): void;
37
- /**
38
- * Validate the configured API key against the server.
39
- */
40
36
  validateKey(): Promise<{
41
37
  valid: boolean;
42
38
  error?: string;