@ninetailed/experience.js 6.3.0 → 6.4.0-beta.4
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/index.cjs +26 -3165
- package/index.js +8 -3147
- package/lib/Ninetailed.d.ts +3 -2
- package/lib/analytics/get-analytics-plugin.d.ts +3 -2
- package/package.json +2 -2
package/lib/Ninetailed.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="analytics" />
|
|
2
|
-
import { Locale, Traits, Profile, OnLogHandler, OnErrorHandler, Logger, PageviewProperties, Properties, NinetailedApiClient, NinetailedApiClientOptions } from '@ninetailed/experience.js-shared';
|
|
2
|
+
import { Locale, Traits, Profile, OnLogHandler, OnErrorHandler, Logger, PageviewProperties, Properties, NinetailedApiClient, NinetailedApiClientOptions, NinetailedRequestContext } from '@ninetailed/experience.js-shared';
|
|
3
3
|
import { EventFunctionOptions, NinetailedInstance, NinetailedPlugin, OnIsInitializedCallback, OnProfileChangeCallback, ProfileState, TrackHasSeenComponent, ElementSeenPayload, TrackComponentView } from './types';
|
|
4
4
|
import { ObserveOptions } from './ElementSeenObserver';
|
|
5
5
|
declare global {
|
|
@@ -21,6 +21,7 @@ type Options = {
|
|
|
21
21
|
onLog?: OnLogHandler;
|
|
22
22
|
onError?: OnErrorHandler;
|
|
23
23
|
componentViewTrackingThreshold?: number;
|
|
24
|
+
buildClientContext?: () => NinetailedRequestContext;
|
|
24
25
|
};
|
|
25
26
|
type NinetailedApiClientInstanceOrOptions = NinetailedApiClient | NinetailedApiClientOptions;
|
|
26
27
|
export declare class Ninetailed implements NinetailedInstance {
|
|
@@ -36,7 +37,7 @@ export declare class Ninetailed implements NinetailedInstance {
|
|
|
36
37
|
readonly plugins: NinetailedPlugin[];
|
|
37
38
|
readonly logger: Logger;
|
|
38
39
|
private readonly componentViewTrackingThreshold;
|
|
39
|
-
constructor(ninetailedApiClientInstanceOrOptions: NinetailedApiClientInstanceOrOptions, { plugins, url, profile, locale, requestTimeout, onLog, onError, componentViewTrackingThreshold, }?: Options);
|
|
40
|
+
constructor(ninetailedApiClientInstanceOrOptions: NinetailedApiClientInstanceOrOptions, { plugins, url, profile, locale, requestTimeout, onLog, onError, buildClientContext, componentViewTrackingThreshold, }?: Options);
|
|
40
41
|
page: (data?: Partial<PageviewProperties>, options?: EventFunctionOptions) => Promise<import("./types").FlushResult>;
|
|
41
42
|
track: (event: string, properties?: Properties, options?: EventFunctionOptions) => Promise<import("./types").FlushResult>;
|
|
42
43
|
/**
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { AnalyticsPlugin } from 'analytics';
|
|
2
|
-
import { Profile, Locale, NinetailedApiClient } from '@ninetailed/experience.js-shared';
|
|
2
|
+
import { Profile, Locale, NinetailedApiClient, NinetailedRequestContext } from '@ninetailed/experience.js-shared';
|
|
3
3
|
import { NinetailedInstance, FlushResult } from '../types';
|
|
4
4
|
type AnalyticsPluginNinetailedConfig = {
|
|
5
5
|
apiClient: NinetailedApiClient;
|
|
6
6
|
profile?: Profile;
|
|
7
7
|
locale?: Locale;
|
|
8
8
|
requestTimeout?: number;
|
|
9
|
+
buildClientContext?: () => NinetailedRequestContext;
|
|
9
10
|
ninetailed: NinetailedInstance;
|
|
10
11
|
};
|
|
11
12
|
export declare const PLUGIN_NAME = "ninetailed";
|
|
12
13
|
export interface NinetailedEventQueue extends AnalyticsPlugin {
|
|
13
14
|
flush: () => Promise<FlushResult>;
|
|
14
15
|
}
|
|
15
|
-
export declare const ninetailedPlugin: ({ apiClient, profile, locale, ninetailed, }: AnalyticsPluginNinetailedConfig) => NinetailedEventQueue;
|
|
16
|
+
export declare const ninetailedPlugin: ({ apiClient, profile, locale, ninetailed, buildClientContext, }: AnalyticsPluginNinetailedConfig) => NinetailedEventQueue;
|
|
16
17
|
export {};
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ninetailed/experience.js",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.4.0-beta.4",
|
|
4
4
|
"module": "./index.js",
|
|
5
5
|
"main": "./index.cjs",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"types": "./index.d.ts",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@ninetailed/experience.js-shared": "6.
|
|
9
|
+
"@ninetailed/experience.js-shared": "6.4.0-beta.4",
|
|
10
10
|
"analytics": "0.8.1",
|
|
11
11
|
"zod": "3.21.4"
|
|
12
12
|
},
|