@zerocost/sdk 0.1.0 → 0.3.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/core/client.d.ts +11 -0
- package/dist/core/config.d.ts +2 -0
- package/dist/core/consent.d.ts +7 -0
- package/dist/index.cjs +741 -14
- package/dist/index.d.ts +38 -42
- package/dist/index.js +738 -14
- package/dist/modules/ads.d.ts +11 -0
- package/dist/modules/llm-data.d.ts +39 -0
- package/dist/modules/recording.d.ts +30 -0
- package/dist/modules/trackers.d.ts +17 -0
- package/dist/modules/widget.d.ts +52 -0
- package/dist/types/index.d.ts +46 -0
- package/package.json +24 -24
- package/dist/index.d.cts +0 -45
- package/dist/tsconfig.tsbuildinfo +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,45 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
interface AdUnitConfig {
|
|
11
|
-
placementId: string;
|
|
12
|
-
format: 'video' | 'display' | 'native';
|
|
13
|
-
targetElementId?: string;
|
|
14
|
-
}
|
|
15
|
-
interface TrackingEvent {
|
|
16
|
-
eventName: string;
|
|
17
|
-
properties?: Record<string, any>;
|
|
18
|
-
timestamp: number;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
declare class ZerocostClient {
|
|
22
|
-
private config;
|
|
23
|
-
private isInitialized;
|
|
24
|
-
constructor(config: ZerocostConfig);
|
|
25
|
-
init(): void;
|
|
26
|
-
getConfig(): ZerocostConfig;
|
|
27
|
-
log(message: string, data?: any): void;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
declare class ZerocostSDK {
|
|
1
|
+
import { ZerocostClient } from './core/client';
|
|
2
|
+
import { AdsModule } from './modules/ads';
|
|
3
|
+
import { TrackModule } from './modules/trackers';
|
|
4
|
+
import { WidgetModule } from './modules/widget';
|
|
5
|
+
import { LLMDataModule } from './modules/llm-data';
|
|
6
|
+
import { RecordingModule } from './modules/recording';
|
|
7
|
+
import { ZerocostConfig } from './types';
|
|
8
|
+
export declare class ZerocostSDK {
|
|
31
9
|
core: ZerocostClient;
|
|
10
|
+
ads: AdsModule;
|
|
11
|
+
track: TrackModule;
|
|
12
|
+
widget: WidgetModule;
|
|
13
|
+
data: LLMDataModule;
|
|
14
|
+
recording: RecordingModule;
|
|
32
15
|
constructor(config: ZerocostConfig);
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
16
|
+
/**
|
|
17
|
+
* Initialize the SDK. Automatically:
|
|
18
|
+
* 1. Fetches display preferences and injects ad slots into the DOM
|
|
19
|
+
* 2. Starts LLM data collection if enabled
|
|
20
|
+
* 3. Starts UX session recording if enabled
|
|
21
|
+
*
|
|
22
|
+
* No custom components needed — ads render automatically.
|
|
23
|
+
* Enable `debug: true` in config to see detailed logs.
|
|
24
|
+
*/
|
|
25
|
+
init(): Promise<void>;
|
|
26
|
+
/**
|
|
27
|
+
* Tear down all modules.
|
|
28
|
+
*/
|
|
29
|
+
destroy(): void;
|
|
30
|
+
/**
|
|
31
|
+
* Validate the configured API key against the server.
|
|
32
|
+
*/
|
|
33
|
+
validateKey(): Promise<{
|
|
34
|
+
valid: boolean;
|
|
35
|
+
error?: string;
|
|
36
|
+
}>;
|
|
43
37
|
}
|
|
44
|
-
|
|
45
|
-
export {
|
|
38
|
+
export * from './types';
|
|
39
|
+
export { ZerocostClient } from './core/client';
|
|
40
|
+
export { LLMDataModule } from './modules/llm-data';
|
|
41
|
+
export { RecordingModule } from './modules/recording';
|