@amplitude/experiment-tag 0.24.0 → 0.25.1
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.
|
Binary file
|
|
@@ -69,7 +69,7 @@ export declare class DefaultWebExperimentClient implements WebExperimentClient {
|
|
|
69
69
|
* Apply evaluated variants to the page.
|
|
70
70
|
* @param options
|
|
71
71
|
*/
|
|
72
|
-
applyVariants(options?: ApplyVariantsOptions): void
|
|
72
|
+
applyVariants(options?: ApplyVariantsOptions): Promise<void>;
|
|
73
73
|
/**
|
|
74
74
|
* Revert variant actions applied by the experiment.
|
|
75
75
|
* @param options
|
|
@@ -79,7 +79,7 @@ export declare class DefaultWebExperimentClient implements WebExperimentClient {
|
|
|
79
79
|
* Preview the effect of a variant on the page.
|
|
80
80
|
* @param options
|
|
81
81
|
*/
|
|
82
|
-
previewVariants(options: PreviewVariantsOptions): void
|
|
82
|
+
previewVariants(options: PreviewVariantsOptions): Promise<void>;
|
|
83
83
|
/**
|
|
84
84
|
* Get all variants for the current web experiment user context.
|
|
85
85
|
*/
|
|
@@ -79,6 +79,19 @@ export type BehavioralTargetingRules = {
|
|
|
79
79
|
[id: string]: BehavioralTargeting;
|
|
80
80
|
};
|
|
81
81
|
};
|
|
82
|
+
export interface RedirectConfig {
|
|
83
|
+
/**
|
|
84
|
+
* When true, redirect impression data is stored in a cookie scoped to the root domain,
|
|
85
|
+
* enabling impression tracking across subdomains.
|
|
86
|
+
*/
|
|
87
|
+
encodeRedirectInCookie?: boolean;
|
|
88
|
+
/**
|
|
89
|
+
* When true, redirect impression data is base64-encoded as an AMP_REDIRECT query
|
|
90
|
+
* parameter on the destination URL, enabling tracking in cross-domain redirects
|
|
91
|
+
* and cookie-blocked environments.
|
|
92
|
+
*/
|
|
93
|
+
encodeRedirectInUrl?: boolean;
|
|
94
|
+
}
|
|
82
95
|
export interface WebExperimentConfig extends ExperimentConfig {
|
|
83
96
|
/**
|
|
84
97
|
* Determines whether the default implementation for handling navigation will be used
|
|
@@ -87,6 +100,7 @@ export interface WebExperimentConfig extends ExperimentConfig {
|
|
|
87
100
|
* 2. Custom handling of navigation {@link setRedirectHandler} should be implemented such that variant actions applied on the site reflect the latest context
|
|
88
101
|
*/
|
|
89
102
|
useDefaultNavigationHandler?: boolean;
|
|
103
|
+
redirectConfig?: RedirectConfig;
|
|
90
104
|
}
|
|
91
105
|
export declare const Defaults: WebExperimentConfig;
|
|
92
106
|
/**
|
|
@@ -108,6 +122,7 @@ export interface WebExperimentClient {
|
|
|
108
122
|
}
|
|
109
123
|
export type WebExperimentUser = {
|
|
110
124
|
web_exp_id?: string;
|
|
125
|
+
web_exp_id_v2?: string;
|
|
111
126
|
} & ExperimentUser;
|
|
112
127
|
export type InitConfigs = {
|
|
113
128
|
initialFlags: string;
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
+
import { CookieStorage } from '@amplitude/analytics-core';
|
|
2
|
+
export declare function getTopLevelDomain(hostname: string): Promise<string>;
|
|
1
3
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
+
* Resolves a cross-subdomain value using cookie storage as the authoritative
|
|
5
|
+
* source. Falls back to a provided localStorage value (migration path), then
|
|
6
|
+
* generates a new value if neither exists. Attempts to set the cookie when
|
|
7
|
+
* missing; cookie I/O failures fall back to localStorage / generateNew.
|
|
8
|
+
* Callers are responsible for syncing the returned value back to localStorage.
|
|
4
9
|
*/
|
|
5
|
-
export declare function
|
|
10
|
+
export declare function resolveCrossSubdomainValue(cookieStorage: CookieStorage<string>, cookieKey: string, localStorageValue: string | undefined, generateNew: () => string): Promise<string>;
|
|
11
|
+
export declare function setMarketingCookie(apiKey: string, hostname: string): Promise<void>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@amplitude/experiment-tag",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.25.1",
|
|
4
4
|
"description": "Amplitude Experiment Javascript Snippet",
|
|
5
5
|
"author": "Amplitude",
|
|
6
6
|
"homepage": "https://github.com/amplitude/experiment-js-client",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@amplitude/analytics-core": "^2.21.0",
|
|
31
31
|
"@amplitude/analytics-types": "^2.11.0",
|
|
32
|
-
"@amplitude/experiment-core": "^0.13.
|
|
33
|
-
"@amplitude/experiment-js-client": "^1.21.
|
|
32
|
+
"@amplitude/experiment-core": "^0.13.2",
|
|
33
|
+
"@amplitude/experiment-js-client": "^1.21.2",
|
|
34
34
|
"dom-mutator": "git+ssh://git@github.com/amplitude/dom-mutator#bb5f4b52273e6a3de39dcf6db6f428d66d988a7b",
|
|
35
35
|
"rollup-plugin-license": "^3.6.0"
|
|
36
36
|
},
|
|
@@ -43,5 +43,5 @@
|
|
|
43
43
|
"files": [
|
|
44
44
|
"dist"
|
|
45
45
|
],
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "053a2257db0111d8800502b6ef379c65c9dab9a4"
|
|
47
47
|
}
|