@amplitude/analytics-browser 0.2.4 → 0.4.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/LICENSE +21 -0
- package/README.md +8 -22
- package/lib/cjs/attribution.d.ts +1 -1
- package/lib/cjs/attribution.d.ts.map +1 -1
- package/lib/cjs/attribution.js +5 -17
- package/lib/cjs/attribution.js.map +1 -1
- package/lib/cjs/browser-client.d.ts +96 -81
- package/lib/cjs/browser-client.d.ts.map +1 -1
- package/lib/cjs/browser-client.js +194 -196
- package/lib/cjs/browser-client.js.map +1 -1
- package/lib/cjs/config.d.ts +11 -7
- package/lib/cjs/config.d.ts.map +1 -1
- package/lib/cjs/config.js +33 -34
- package/lib/cjs/config.js.map +1 -1
- package/lib/cjs/cookie-migration/index.d.ts +5 -0
- package/lib/cjs/cookie-migration/index.d.ts.map +1 -0
- package/lib/cjs/cookie-migration/index.js +55 -0
- package/lib/cjs/cookie-migration/index.js.map +1 -0
- package/lib/cjs/plugins/context.js +1 -1
- package/lib/cjs/plugins/context.js.map +1 -1
- package/lib/cjs/session-manager.d.ts +3 -3
- package/lib/cjs/session-manager.d.ts.map +1 -1
- package/lib/cjs/session-manager.js +10 -16
- package/lib/cjs/session-manager.js.map +1 -1
- package/lib/cjs/storage/cookie.d.ts +2 -2
- package/lib/cjs/storage/cookie.d.ts.map +1 -1
- package/lib/cjs/storage/cookie.js +16 -11
- package/lib/cjs/storage/cookie.js.map +1 -1
- package/lib/cjs/storage/local-storage.d.ts +1 -0
- package/lib/cjs/storage/local-storage.d.ts.map +1 -1
- package/lib/cjs/storage/local-storage.js +4 -1
- package/lib/cjs/storage/local-storage.js.map +1 -1
- package/lib/cjs/storage/memory.d.ts +1 -0
- package/lib/cjs/storage/memory.d.ts.map +1 -1
- package/lib/cjs/storage/memory.js +4 -0
- package/lib/cjs/storage/memory.js.map +1 -1
- package/lib/cjs/storage/utm-cookie.js +1 -1
- package/lib/cjs/storage/utm-cookie.js.map +1 -1
- package/lib/cjs/transports/fetch.d.ts.map +1 -1
- package/lib/cjs/transports/fetch.js +0 -2
- package/lib/cjs/transports/fetch.js.map +1 -1
- package/lib/cjs/utils/snippet-helper.d.ts +1 -0
- package/lib/cjs/utils/snippet-helper.d.ts.map +1 -1
- package/lib/cjs/utils/snippet-helper.js +1 -0
- package/lib/cjs/utils/snippet-helper.js.map +1 -1
- package/lib/cjs/version.d.ts +1 -1
- package/lib/cjs/version.js +1 -1
- package/lib/cjs/version.js.map +1 -1
- package/lib/esm/attribution.d.ts +1 -1
- package/lib/esm/attribution.d.ts.map +1 -1
- package/lib/esm/attribution.js +4 -16
- package/lib/esm/attribution.js.map +1 -1
- package/lib/esm/browser-client.d.ts +96 -81
- package/lib/esm/browser-client.d.ts.map +1 -1
- package/lib/esm/browser-client.js +197 -182
- package/lib/esm/browser-client.js.map +1 -1
- package/lib/esm/config.d.ts +11 -7
- package/lib/esm/config.d.ts.map +1 -1
- package/lib/esm/config.js +28 -29
- package/lib/esm/config.js.map +1 -1
- package/lib/esm/cookie-migration/index.d.ts +5 -0
- package/lib/esm/cookie-migration/index.d.ts.map +1 -0
- package/lib/esm/cookie-migration/index.js +50 -0
- package/lib/esm/cookie-migration/index.js.map +1 -0
- package/lib/esm/plugins/context.js +2 -2
- package/lib/esm/plugins/context.js.map +1 -1
- package/lib/esm/session-manager.d.ts +3 -3
- package/lib/esm/session-manager.d.ts.map +1 -1
- package/lib/esm/session-manager.js +8 -14
- package/lib/esm/session-manager.js.map +1 -1
- package/lib/esm/storage/cookie.d.ts +2 -2
- package/lib/esm/storage/cookie.d.ts.map +1 -1
- package/lib/esm/storage/cookie.js +16 -11
- package/lib/esm/storage/cookie.js.map +1 -1
- package/lib/esm/storage/local-storage.d.ts +1 -0
- package/lib/esm/storage/local-storage.d.ts.map +1 -1
- package/lib/esm/storage/local-storage.js +4 -1
- package/lib/esm/storage/local-storage.js.map +1 -1
- package/lib/esm/storage/memory.d.ts +1 -0
- package/lib/esm/storage/memory.d.ts.map +1 -1
- package/lib/esm/storage/memory.js +4 -0
- package/lib/esm/storage/memory.js.map +1 -1
- package/lib/esm/storage/utm-cookie.js +1 -1
- package/lib/esm/storage/utm-cookie.js.map +1 -1
- package/lib/esm/transports/fetch.d.ts.map +1 -1
- package/lib/esm/transports/fetch.js +0 -2
- package/lib/esm/transports/fetch.js.map +1 -1
- package/lib/esm/utils/snippet-helper.d.ts +1 -0
- package/lib/esm/utils/snippet-helper.d.ts.map +1 -1
- package/lib/esm/utils/snippet-helper.js +1 -0
- package/lib/esm/utils/snippet-helper.js.map +1 -1
- package/lib/esm/version.d.ts +1 -1
- package/lib/esm/version.js +1 -1
- package/lib/esm/version.js.map +1 -1
- package/lib/scripts/amplitude-min.js +1 -1
- package/lib/scripts/amplitude-min.js.gz +0 -0
- package/lib/scripts/amplitude-min.umd.js +1 -1
- package/lib/scripts/amplitude-min.umd.js.gz +0 -0
- package/lib/scripts/amplitude-snippet-instructions.html +5 -0
- package/lib/scripts/amplitude-snippet-min.js +1 -0
- package/package.json +13 -9
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
var _this = this;
|
|
2
1
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
2
|
+
exports.setTransport = exports.setOptOut = exports.setSessionId = exports.getSessionId = exports.setDeviceId = exports.getDeviceId = exports.setUserId = exports.getUserId = exports.revenue = exports.setGroup = exports.groupIdentify = exports.identify = exports.logEvent = exports.track = exports.remove = exports.add = exports.init = exports.AmplitudeBrowser = void 0;
|
|
4
3
|
var tslib_1 = require("tslib");
|
|
5
4
|
var analytics_core_1 = require("@amplitude/analytics-core");
|
|
6
5
|
var snippet_helper_1 = require("./utils/snippet-helper");
|
|
@@ -8,177 +7,138 @@ var context_1 = require("./plugins/context");
|
|
|
8
7
|
var config_1 = require("./config");
|
|
9
8
|
var attribution_1 = require("./attribution");
|
|
10
9
|
var session_manager_1 = require("./session-manager");
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
return (0, tslib_1.__generator)(this, function (_a) {
|
|
24
|
-
switch (_a.label) {
|
|
10
|
+
var cookie_migration_1 = require("./cookie-migration");
|
|
11
|
+
var AmplitudeBrowser = /** @class */ (function (_super) {
|
|
12
|
+
(0, tslib_1.__extends)(AmplitudeBrowser, _super);
|
|
13
|
+
function AmplitudeBrowser() {
|
|
14
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
15
|
+
}
|
|
16
|
+
AmplitudeBrowser.prototype.init = function (apiKey, userId, options) {
|
|
17
|
+
var _a, _b, _c;
|
|
18
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
19
|
+
var oldCookies, browserOptions;
|
|
20
|
+
return (0, tslib_1.__generator)(this, function (_d) {
|
|
21
|
+
switch (_d.label) {
|
|
25
22
|
case 0:
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
(
|
|
29
|
-
return [4 /*yield*/, (0, analytics_core_1.add)(new context_1.Context())];
|
|
23
|
+
oldCookies = (0, cookie_migration_1.parseOldCookies)(apiKey, options);
|
|
24
|
+
browserOptions = (0, config_1.useBrowserConfig)(apiKey, userId || oldCookies.userId, (0, tslib_1.__assign)((0, tslib_1.__assign)({}, options), { deviceId: (_a = oldCookies.deviceId) !== null && _a !== void 0 ? _a : options === null || options === void 0 ? void 0 : options.deviceId, sessionId: (_b = oldCookies.sessionId) !== null && _b !== void 0 ? _b : options === null || options === void 0 ? void 0 : options.sessionId, optOut: (_c = options === null || options === void 0 ? void 0 : options.optOut) !== null && _c !== void 0 ? _c : oldCookies.optOut }));
|
|
25
|
+
return [4 /*yield*/, _super.prototype.init.call(this, undefined, undefined, browserOptions)];
|
|
30
26
|
case 1:
|
|
31
|
-
|
|
32
|
-
|
|
27
|
+
_d.sent();
|
|
28
|
+
// Step 3: Store user session in cookie storage
|
|
29
|
+
(0, session_manager_1.updateCookies)(this.config, oldCookies.lastEventTime);
|
|
30
|
+
// Step 4: Install plugins
|
|
31
|
+
return [4 /*yield*/, this.add(new context_1.Context())];
|
|
33
32
|
case 2:
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
// Step 4: Install plugins
|
|
34
|
+
_d.sent();
|
|
35
|
+
return [4 /*yield*/, this.add(new analytics_core_1.Destination())];
|
|
36
|
+
case 3:
|
|
37
|
+
_d.sent();
|
|
38
|
+
// Step 4: Track attributions
|
|
39
|
+
void this.trackAttributions();
|
|
36
40
|
return [2 /*return*/];
|
|
37
41
|
}
|
|
38
42
|
});
|
|
39
|
-
});
|
|
43
|
+
});
|
|
40
44
|
};
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Adds a new plugin.
|
|
45
|
-
*
|
|
46
|
-
* ```typescript
|
|
47
|
-
* const plugin = {...};
|
|
48
|
-
* amplitude.add(plugin);
|
|
49
|
-
* ```
|
|
50
|
-
*/
|
|
51
|
-
var add = function (plugin) {
|
|
52
|
-
return {
|
|
53
|
-
promise: (0, analytics_core_1.add)(plugin),
|
|
45
|
+
AmplitudeBrowser.prototype.getUserId = function () {
|
|
46
|
+
return this.config.userId;
|
|
54
47
|
};
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
* Removes a plugin.
|
|
59
|
-
*
|
|
60
|
-
* ```typescript
|
|
61
|
-
* amplitude.remove('myPlugin');
|
|
62
|
-
* ```
|
|
63
|
-
*/
|
|
64
|
-
var remove = function (pluginName) {
|
|
65
|
-
return {
|
|
66
|
-
promise: (0, analytics_core_1.remove)(pluginName),
|
|
48
|
+
AmplitudeBrowser.prototype.setUserId = function (userId) {
|
|
49
|
+
this.config.userId = userId;
|
|
50
|
+
(0, session_manager_1.updateCookies)(this.config);
|
|
67
51
|
};
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
var
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
52
|
+
AmplitudeBrowser.prototype.getDeviceId = function () {
|
|
53
|
+
return this.config.deviceId;
|
|
54
|
+
};
|
|
55
|
+
AmplitudeBrowser.prototype.setDeviceId = function (deviceId) {
|
|
56
|
+
this.config.deviceId = deviceId;
|
|
57
|
+
(0, session_manager_1.updateCookies)(this.config);
|
|
58
|
+
};
|
|
59
|
+
AmplitudeBrowser.prototype.getSessionId = function () {
|
|
60
|
+
return this.config.sessionId;
|
|
61
|
+
};
|
|
62
|
+
AmplitudeBrowser.prototype.setSessionId = function (sessionId) {
|
|
63
|
+
this.config.sessionId = sessionId;
|
|
64
|
+
(0, session_manager_1.updateCookies)(this.config);
|
|
65
|
+
};
|
|
66
|
+
AmplitudeBrowser.prototype.setOptOut = function (optOut) {
|
|
67
|
+
_super.prototype.setOptOut.call(this, optOut);
|
|
68
|
+
(0, session_manager_1.updateCookies)(this.config);
|
|
69
|
+
};
|
|
70
|
+
AmplitudeBrowser.prototype.setTransport = function (transport) {
|
|
71
|
+
this.config.transportProvider = (0, config_1.createTransport)(transport);
|
|
72
|
+
};
|
|
73
|
+
AmplitudeBrowser.prototype.identify = function (identify, eventOptions) {
|
|
74
|
+
if ((0, snippet_helper_1.isInstanceProxy)(identify)) {
|
|
75
|
+
var queue = identify._q;
|
|
76
|
+
identify._q = [];
|
|
77
|
+
identify = (0, snippet_helper_1.convertProxyObjectToRealObject)(new analytics_core_1.Identify(), queue);
|
|
78
|
+
}
|
|
79
|
+
return _super.prototype.identify.call(this, identify, eventOptions);
|
|
80
|
+
};
|
|
81
|
+
AmplitudeBrowser.prototype.groupIdentify = function (groupType, groupName, identify, eventOptions) {
|
|
82
|
+
if ((0, snippet_helper_1.isInstanceProxy)(identify)) {
|
|
83
|
+
var queue = identify._q;
|
|
84
|
+
identify._q = [];
|
|
85
|
+
identify = (0, snippet_helper_1.convertProxyObjectToRealObject)(new analytics_core_1.Identify(), queue);
|
|
86
|
+
}
|
|
87
|
+
return _super.prototype.groupIdentify.call(this, groupType, groupName, identify, eventOptions);
|
|
88
|
+
};
|
|
89
|
+
AmplitudeBrowser.prototype.revenue = function (revenue, eventOptions) {
|
|
90
|
+
if ((0, snippet_helper_1.isInstanceProxy)(revenue)) {
|
|
91
|
+
var queue = revenue._q;
|
|
92
|
+
revenue._q = [];
|
|
93
|
+
revenue = (0, snippet_helper_1.convertProxyObjectToRealObject)(new analytics_core_1.Revenue(), queue);
|
|
94
|
+
}
|
|
95
|
+
return _super.prototype.revenue.call(this, revenue, eventOptions);
|
|
96
|
+
};
|
|
97
|
+
AmplitudeBrowser.prototype.trackAttributions = function () {
|
|
98
|
+
var attributions = (0, attribution_1.getAttributions)(this.config);
|
|
99
|
+
if (Object.keys(attributions).length === 0) {
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
var id = new analytics_core_1.Identify();
|
|
103
|
+
Object.entries(attributions).forEach(function (_a) {
|
|
104
|
+
var _b = (0, tslib_1.__read)(_a, 2), key = _b[0], value = _b[1];
|
|
105
|
+
if (value) {
|
|
106
|
+
id.setOnce("initial_".concat(key), value);
|
|
107
|
+
id.set(key, value);
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
return this.identify(id);
|
|
111
|
+
};
|
|
112
|
+
return AmplitudeBrowser;
|
|
113
|
+
}(analytics_core_1.AmplitudeCore));
|
|
114
|
+
exports.AmplitudeBrowser = AmplitudeBrowser;
|
|
115
|
+
var client = new AmplitudeBrowser();
|
|
120
116
|
/**
|
|
121
|
-
*
|
|
117
|
+
* Initializes the Amplitude SDK with your apiKey, userId and optional configurations.
|
|
118
|
+
* This method must be called before any other operations.
|
|
122
119
|
*
|
|
123
120
|
* ```typescript
|
|
124
|
-
*
|
|
121
|
+
* await init(API_KEY, USER_ID, options).promise;
|
|
125
122
|
* ```
|
|
126
123
|
*/
|
|
127
|
-
|
|
128
|
-
return (0, config_1.getConfig)().sessionId;
|
|
129
|
-
};
|
|
130
|
-
exports.getSessionId = getSessionId;
|
|
124
|
+
exports.init = (0, analytics_core_1.returnWrapper)(client.init.bind(client));
|
|
131
125
|
/**
|
|
132
|
-
*
|
|
133
|
-
* When settign a custom session ID, make sure the value is in milliseconds since epoch (Unix Timestamp).
|
|
126
|
+
* Adds a new plugin.
|
|
134
127
|
*
|
|
135
128
|
* ```typescript
|
|
136
|
-
*
|
|
137
|
-
*
|
|
138
|
-
*/
|
|
139
|
-
var setSessionId = function (sessionId) {
|
|
140
|
-
var config = (0, config_1.getConfig)();
|
|
141
|
-
config.sessionId = sessionId;
|
|
142
|
-
(0, session_manager_1.updateCookies)(config);
|
|
143
|
-
};
|
|
144
|
-
exports.setSessionId = setSessionId;
|
|
145
|
-
/**
|
|
146
|
-
* Sets a new optOut config value. This toggles event tracking on/off.
|
|
147
|
-
*
|
|
148
|
-
*```typescript
|
|
149
|
-
* // Stops tracking
|
|
150
|
-
* setOptOut(true);
|
|
151
|
-
*
|
|
152
|
-
* // Starts/resumes tracking
|
|
153
|
-
* setOptOut(false);
|
|
129
|
+
* const plugin = {...};
|
|
130
|
+
* amplitude.add(plugin);
|
|
154
131
|
* ```
|
|
155
132
|
*/
|
|
156
|
-
|
|
157
|
-
(0, analytics_core_1.setOptOut)(optOut);
|
|
158
|
-
var config = (0, config_1.getConfig)();
|
|
159
|
-
(0, session_manager_1.updateCookies)(config);
|
|
160
|
-
};
|
|
161
|
-
exports.setOptOut = setOptOut;
|
|
133
|
+
exports.add = (0, analytics_core_1.returnWrapper)(client.add.bind(client));
|
|
162
134
|
/**
|
|
163
|
-
*
|
|
135
|
+
* Removes a plugin.
|
|
164
136
|
*
|
|
165
137
|
* ```typescript
|
|
166
|
-
*
|
|
167
|
-
* setTransport('fetch');
|
|
168
|
-
*
|
|
169
|
-
* // Use XMLHttpRequest API
|
|
170
|
-
* setTransport('xhr');
|
|
171
|
-
*
|
|
172
|
-
* // Use navigator.sendBeacon API
|
|
173
|
-
* setTransport('beacon');
|
|
138
|
+
* amplitude.remove('myPlugin');
|
|
174
139
|
* ```
|
|
175
140
|
*/
|
|
176
|
-
|
|
177
|
-
var config = (0, config_1.getConfig)();
|
|
178
|
-
var transportProvider = (0, config_1.createTransport)(transport);
|
|
179
|
-
config.transportProvider = transportProvider;
|
|
180
|
-
};
|
|
181
|
-
exports.setTransport = setTransport;
|
|
141
|
+
exports.remove = (0, analytics_core_1.returnWrapper)(client.remove.bind(client));
|
|
182
142
|
/**
|
|
183
143
|
* Tracks user-defined event, with specified type, optional event properties and optional overwrites.
|
|
184
144
|
*
|
|
@@ -199,16 +159,11 @@ exports.setTransport = setTransport;
|
|
|
199
159
|
* console.log(result.message); // "Event tracked successfully"
|
|
200
160
|
* ```
|
|
201
161
|
*/
|
|
202
|
-
|
|
203
|
-
return {
|
|
204
|
-
promise: (0, analytics_core_1.track)(eventType, eventProperties, eventOptions),
|
|
205
|
-
};
|
|
206
|
-
};
|
|
207
|
-
exports.track = track;
|
|
162
|
+
exports.track = (0, analytics_core_1.returnWrapper)(client.track.bind(client));
|
|
208
163
|
/**
|
|
209
|
-
*
|
|
164
|
+
* Alias for track()
|
|
210
165
|
*/
|
|
211
|
-
exports.logEvent =
|
|
166
|
+
exports.logEvent = (0, analytics_core_1.returnWrapper)(client.logEvent.bind(client));
|
|
212
167
|
/**
|
|
213
168
|
* Sends an identify event containing user property operations
|
|
214
169
|
*
|
|
@@ -224,17 +179,7 @@ exports.logEvent = exports.track;
|
|
|
224
179
|
* console.log(result.message); // "Event tracked successfully"
|
|
225
180
|
* ```
|
|
226
181
|
*/
|
|
227
|
-
|
|
228
|
-
if ((0, snippet_helper_1.isInstanceProxy)(identify)) {
|
|
229
|
-
var queue = identify._q;
|
|
230
|
-
identify._q = [];
|
|
231
|
-
identify = (0, snippet_helper_1.convertProxyObjectToRealObject)(new analytics_core_1.Identify(), queue);
|
|
232
|
-
}
|
|
233
|
-
return {
|
|
234
|
-
promise: (0, analytics_core_1.identify)(undefined, undefined, identify, eventOptions),
|
|
235
|
-
};
|
|
236
|
-
};
|
|
237
|
-
exports.identify = identify;
|
|
182
|
+
exports.identify = (0, analytics_core_1.returnWrapper)(client.identify.bind(client));
|
|
238
183
|
/**
|
|
239
184
|
* Sends a group identify event containing group property operations.
|
|
240
185
|
*
|
|
@@ -252,23 +197,8 @@ exports.identify = identify;
|
|
|
252
197
|
* console.log(result.message); // "Event tracked successfully"
|
|
253
198
|
* ```
|
|
254
199
|
*/
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
var queue = identify._q;
|
|
258
|
-
identify._q = [];
|
|
259
|
-
identify = (0, snippet_helper_1.convertProxyObjectToRealObject)(new analytics_core_1.Identify(), queue);
|
|
260
|
-
}
|
|
261
|
-
return {
|
|
262
|
-
promise: (0, analytics_core_1.groupIdentify)(undefined, undefined, groupType, groupName, identify, eventOptions),
|
|
263
|
-
};
|
|
264
|
-
};
|
|
265
|
-
exports.groupIdentify = groupIdentify;
|
|
266
|
-
var setGroup = function (groupType, groupName) {
|
|
267
|
-
return {
|
|
268
|
-
promise: (0, analytics_core_1.setGroup)(groupType, groupName),
|
|
269
|
-
};
|
|
270
|
-
};
|
|
271
|
-
exports.setGroup = setGroup;
|
|
200
|
+
exports.groupIdentify = (0, analytics_core_1.returnWrapper)(client.groupIdentify.bind(client));
|
|
201
|
+
exports.setGroup = (0, analytics_core_1.returnWrapper)(client.setGroup.bind(client));
|
|
272
202
|
/**
|
|
273
203
|
* Sends a revenue event containing revenue property operations.
|
|
274
204
|
*
|
|
@@ -284,15 +214,83 @@ exports.setGroup = setGroup;
|
|
|
284
214
|
* console.log(result.message); // "Event tracked successfully"
|
|
285
215
|
* ```
|
|
286
216
|
*/
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
217
|
+
exports.revenue = (0, analytics_core_1.returnWrapper)(client.revenue.bind(client));
|
|
218
|
+
/**
|
|
219
|
+
* Returns current user ID.
|
|
220
|
+
*
|
|
221
|
+
* ```typescript
|
|
222
|
+
* const userId = getUserId();
|
|
223
|
+
* ```
|
|
224
|
+
*/
|
|
225
|
+
exports.getUserId = client.getUserId.bind(client);
|
|
226
|
+
/**
|
|
227
|
+
* Sets a new user ID.
|
|
228
|
+
*
|
|
229
|
+
* ```typescript
|
|
230
|
+
* setUserId('userId');
|
|
231
|
+
* ```
|
|
232
|
+
*/
|
|
233
|
+
exports.setUserId = client.setUserId.bind(client);
|
|
234
|
+
/**
|
|
235
|
+
* Returns current device ID.
|
|
236
|
+
*
|
|
237
|
+
* ```typescript
|
|
238
|
+
* const deviceId = getDeviceId();
|
|
239
|
+
* ```
|
|
240
|
+
*/
|
|
241
|
+
exports.getDeviceId = client.getDeviceId.bind(client);
|
|
242
|
+
/**
|
|
243
|
+
* Sets a new device ID.
|
|
244
|
+
* When setting a custom device ID, make sure the value is sufficiently unique.
|
|
245
|
+
* A uuid is recommended.
|
|
246
|
+
*
|
|
247
|
+
* ```typescript
|
|
248
|
+
* setDeviceId('deviceId');
|
|
249
|
+
* ```
|
|
250
|
+
*/
|
|
251
|
+
exports.setDeviceId = client.setDeviceId.bind(client);
|
|
252
|
+
/**
|
|
253
|
+
* Returns current session ID.
|
|
254
|
+
*
|
|
255
|
+
* ```typescript
|
|
256
|
+
* const sessionId = getSessionId();
|
|
257
|
+
* ```
|
|
258
|
+
*/
|
|
259
|
+
exports.getSessionId = client.getSessionId.bind(client);
|
|
260
|
+
/**
|
|
261
|
+
* Sets a new session ID.
|
|
262
|
+
* When settign a custom session ID, make sure the value is in milliseconds since epoch (Unix Timestamp).
|
|
263
|
+
*
|
|
264
|
+
* ```typescript
|
|
265
|
+
* setSessionId(Date.now());
|
|
266
|
+
* ```
|
|
267
|
+
*/
|
|
268
|
+
exports.setSessionId = client.setSessionId.bind(client);
|
|
269
|
+
/**
|
|
270
|
+
* Sets a new optOut config value. This toggles event tracking on/off.
|
|
271
|
+
*
|
|
272
|
+
*```typescript
|
|
273
|
+
* // Stops tracking
|
|
274
|
+
* setOptOut(true);
|
|
275
|
+
*
|
|
276
|
+
* // Starts/resumes tracking
|
|
277
|
+
* setOptOut(false);
|
|
278
|
+
* ```
|
|
279
|
+
*/
|
|
280
|
+
exports.setOptOut = client.setOptOut.bind(client);
|
|
281
|
+
/**
|
|
282
|
+
* Sets the network transport type for events.
|
|
283
|
+
*
|
|
284
|
+
* ```typescript
|
|
285
|
+
* // Use Fetch API
|
|
286
|
+
* setTransport('fetch');
|
|
287
|
+
*
|
|
288
|
+
* // Use XMLHttpRequest API
|
|
289
|
+
* setTransport('xhr');
|
|
290
|
+
*
|
|
291
|
+
* // Use navigator.sendBeacon API
|
|
292
|
+
* setTransport('beacon');
|
|
293
|
+
* ```
|
|
294
|
+
*/
|
|
295
|
+
exports.setTransport = client.setTransport.bind(client);
|
|
298
296
|
//# sourceMappingURL=browser-client.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser-client.js","sourceRoot":"","sources":["../../src/browser-client.ts"],"names":[],"mappings":"AAAA,iBA2TA;;;;AA3TA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C,IAAI,yBAAQ,EAAE,EAAE,KAAK,CAAC,CAAC;KAClE;IACD,OAAO;QACL,OAAO,EAAE,IAAA,8BAAc,EAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,CAAC;KAC5F,CAAC;AACJ,CAAC,CAAC;AAdW,QAAA,aAAa,iBAcxB;AAEK,IAAM,QAAQ,GAAG,UAAC,SAAiB,EAAE,SAA4B;IACtE,OAAO;QACL,OAAO,EAAE,IAAA,yBAAS,EAAC,SAAS,EAAE,SAAS,CAAC;KACzC,CAAC;AACJ,CAAC,CAAC;AAJW,QAAA,QAAQ,YAInB;AAEF;;;;;;;;;;;;;;GAcG;AACI,IAAM,OAAO,GAAG,UAAC,OAAgB,EAAE,YAA2B;IACnE,IAAI,IAAA,gCAAe,EAAC,OAAO,CAAC,EAAE;QAC5B,IAAM,KAAK,GAAG,OAAO,CAAC,EAAE,CAAC;QACzB,OAAO,CAAC,EAAE,GAAG,EAAE,CAAC;QAChB,OAAO,GAAG,IAAA,+CAA8B,EAAC,IAAI,wBAAO,EAAE,EAAE,KAAK,CAAC,CAAC;KAChE;IACD,OAAO;QACL,OAAO,EAAE,IAAA,wBAAQ,EAAC,OAAO,EAAE,YAAY,CAAC;KACzC,CAAC;AACJ,CAAC,CAAC;AATW,QAAA,OAAO,WASlB","sourcesContent":["import {\n add as _add,\n groupIdentify as _groupIdentify,\n Destination,\n identify as _identify,\n revenue as _revenue,\n init as _init,\n setOptOut as _setOptOut,\n Identify,\n Revenue,\n track as _track,\n setGroup as _setGroup,\n remove as _remove,\n} from '@amplitude/analytics-core';\nimport {\n AmplitudeReturn,\n BrowserConfig,\n BrowserOptions,\n EventOptions,\n Plugin,\n Result,\n TransportType,\n} from '@amplitude/analytics-types';\nimport { convertProxyObjectToRealObject, isInstanceProxy } from './utils/snippet-helper';\nimport { Context } from './plugins/context';\nimport { createConfig, createTransport, getConfig } from './config';\nimport { trackAttributions } from './attribution';\nimport { updateCookies } from './session-manager';\n\n/**\n * Initializes the Amplitude SDK with your apiKey, userId and optional configurations.\n * This method must be called before any other operations.\n *\n * ```typescript\n * await init(API_KEY, USER_ID, options).promise;\n * ```\n */\nexport const init = (apiKey: string, userId?: string, options?: BrowserOptions): AmplitudeReturn<void> => {\n return {\n promise: (async () => {\n const browserOptions = createConfig(apiKey, userId, options);\n const config = _init(browserOptions) as BrowserConfig;\n updateCookies(config);\n\n await _add(new Context());\n await _add(new Destination());\n trackAttributions(config);\n })(),\n };\n};\n\n/**\n * Adds a new plugin.\n *\n * ```typescript\n * const plugin = {...};\n * amplitude.add(plugin);\n * ```\n */\nexport const add = (plugin: Plugin): AmplitudeReturn<void> => {\n return {\n promise: _add(plugin),\n };\n};\n\n/**\n * Removes a plugin.\n *\n * ```typescript\n * amplitude.remove('myPlugin');\n * ```\n */\nexport const remove = (pluginName: string): AmplitudeReturn<void> => {\n return {\n promise: _remove(pluginName),\n };\n};\n\n/**\n * Returns current user ID.\n *\n * ```typescript\n * const userId = getUserId();\n * ```\n */\nexport const getUserId = () => {\n return getConfig().userId;\n};\n\n/**\n * Sets a new user ID.\n *\n * ```typescript\n * setUserId('userId');\n * ```\n */\nexport const setUserId = (userId: string) => {\n const config = getConfig();\n config.userId = userId;\n updateCookies(config);\n};\n\n/**\n * Returns current device ID.\n *\n * ```typescript\n * const deviceId = getDeviceId();\n * ```\n */\nexport const getDeviceId = () => {\n return getConfig().deviceId;\n};\n\n/**\n * Sets a new device ID.\n * When setting a custom device ID, make sure the value is sufficiently unique.\n * A uuid is recommended.\n *\n * ```typescript\n * setDeviceId('deviceId');\n * ```\n */\nexport const setDeviceId = (deviceId: string) => {\n const config = getConfig();\n config.deviceId = deviceId;\n updateCookies(config);\n};\n\n/**\n * Returns current session ID.\n *\n * ```typescript\n * const sessionId = getSessionId();\n * ```\n */\nexport const getSessionId = () => {\n return getConfig().sessionId;\n};\n\n/**\n * Sets a new session ID.\n * When settign a custom session ID, make sure the value is in milliseconds since epoch (Unix Timestamp).\n *\n * ```typescript\n * setSessionId(Date.now());\n * ```\n */\nexport const setSessionId = (sessionId: number) => {\n const config = getConfig();\n config.sessionId = sessionId;\n updateCookies(config);\n};\n\n/**\n * Sets a new optOut config value. This toggles event tracking on/off.\n *\n *```typescript\n * // Stops tracking\n * setOptOut(true);\n *\n * // Starts/resumes tracking\n * setOptOut(false);\n * ```\n */\nexport const setOptOut = (optOut: boolean) => {\n _setOptOut(optOut);\n const config = getConfig();\n updateCookies(config);\n};\n\n/**\n * Sets the network transport type for events.\n *\n * ```typescript\n * // Use Fetch API\n * setTransport('fetch');\n *\n * // Use XMLHttpRequest API\n * setTransport('xhr');\n *\n * // Use navigator.sendBeacon API\n * setTransport('beacon');\n * ```\n */\nexport const setTransport = (transport: TransportType) => {\n const config = getConfig();\n const transportProvider = createTransport(transport);\n config.transportProvider = transportProvider;\n};\n\n/**\n * Tracks user-defined event, with specified type, optional event properties and optional overwrites.\n *\n * ```typescript\n * // event tracking with event type only\n * track('Page Load');\n *\n * // event tracking with event type and additional event properties\n * track('Page Load', { loadTime: 1000 });\n *\n * // event tracking with event type, additional event properties, and overwritten event options\n * track('Page Load', { loadTime: 1000 }, { sessionId: -1 });\n *\n * // alternatively, this tracking method is awaitable\n * const result = await track('Page Load').promise;\n * console.log(result.event); // {...}\n * console.log(result.code); // 200\n * console.log(result.message); // \"Event tracked successfully\"\n * ```\n */\nexport const track = (\n eventType: string,\n eventProperties?: Record<string, any>,\n eventOptions?: EventOptions,\n): AmplitudeReturn<Result> => {\n return {\n promise: _track(eventType, eventProperties, eventOptions),\n };\n};\n\n/**\n * Alis for track()\n */\nexport const logEvent = track;\n\n/**\n * Sends an identify event containing user property operations\n *\n * ```typescript\n * const id = new Identify();\n * id.set('colors', ['rose', 'gold']);\n * identify(id);\n *\n * // alternatively, this tracking method is awaitable\n * const result = await identify(id).promise;\n * console.log(result.event); // {...}\n * console.log(result.code); // 200\n * console.log(result.message); // \"Event tracked successfully\"\n * ```\n */\nexport const identify = (identify: Identify, eventOptions?: EventOptions): AmplitudeReturn<Result> => {\n if (isInstanceProxy(identify)) {\n const queue = identify._q;\n identify._q = [];\n identify = convertProxyObjectToRealObject(new Identify(), queue);\n }\n return {\n promise: _identify(undefined, undefined, identify, eventOptions),\n };\n};\n\n/**\n * Sends a group identify event containing group property operations.\n *\n * ```typescript\n * const id = new Identify();\n * id.set('skills', ['js', 'ts']);\n * const groupType = 'org';\n * const groupName = 'engineering';\n * groupIdentify(groupType, groupName, id);\n *\n * // alternatively, this tracking method is awaitable\n * const result = await groupIdentify(groupType, groupName, id).promise;\n * console.log(result.event); // {...}\n * console.log(result.code); // 200\n * console.log(result.message); // \"Event tracked successfully\"\n * ```\n */\nexport const groupIdentify = (\n groupType: string,\n groupName: string | string[],\n identify: Identify,\n eventOptions?: EventOptions,\n): AmplitudeReturn<Result> => {\n if (isInstanceProxy(identify)) {\n const queue = identify._q;\n identify._q = [];\n identify = convertProxyObjectToRealObject(new Identify(), queue);\n }\n return {\n promise: _groupIdentify(undefined, undefined, groupType, groupName, identify, eventOptions),\n };\n};\n\nexport const setGroup = (groupType: string, groupName: string | string[]): AmplitudeReturn<Result> => {\n return {\n promise: _setGroup(groupType, groupName),\n };\n};\n\n/**\n * Sends a revenue event containing revenue property operations.\n *\n * ```typescript\n * const rev = new Revenue();\n * rev.setRevenue(100);\n * revenue(rev);\n *\n * // alternatively, this tracking method is awaitable\n * const result = await revenue(rev).promise;\n * console.log(result.event); // {...}\n * console.log(result.code); // 200\n * console.log(result.message); // \"Event tracked successfully\"\n * ```\n */\nexport const revenue = (revenue: Revenue, eventOptions?: EventOptions): AmplitudeReturn<Result> => {\n if (isInstanceProxy(revenue)) {\n const queue = revenue._q;\n revenue._q = [];\n revenue = convertProxyObjectToRealObject(new Revenue(), queue);\n }\n return {\n promise: _revenue(revenue, eventOptions),\n };\n};\n"]}
|
|
1
|
+
{"version":3,"file":"browser-client.js","sourceRoot":"","sources":["../../src/browser-client.ts"],"names":[],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IAAA,8BAAa,EAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;AAEpE;;;;;;;;;;;;;;GAcG;AACU,QAAA,OAAO,GAAG,IAAA,8BAAa,EAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;AAElE;;;;;;GAMG;AACU,QAAA,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAEvD;;;;;;GAMG;AACU,QAAA,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAEvD;;;;;;GAMG;AACU,QAAA,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAE3D;;;;;;;;GAQG;AACU,QAAA,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAE3D;;;;;;GAMG;AACU,QAAA,YAAY,GAAG,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAE7D;;;;;;;GAOG;AACU,QAAA,YAAY,GAAG,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAE7D;;;;;;;;;;GAUG;AACU,QAAA,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAEvD;;;;;;;;;;;;;GAaG;AACU,QAAA,YAAY,GAAG,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC","sourcesContent":["import { AmplitudeCore, Destination, Identify, Revenue, returnWrapper } from '@amplitude/analytics-core';\nimport {\n BrowserConfig,\n BrowserOptions,\n EventOptions,\n Identify as IIdentify,\n Result,\n Revenue as IRevenue,\n TransportType,\n} from '@amplitude/analytics-types';\nimport { convertProxyObjectToRealObject, isInstanceProxy } from './utils/snippet-helper';\nimport { Context } from './plugins/context';\nimport { useBrowserConfig, createTransport } from './config';\nimport { getAttributions } from './attribution';\nimport { updateCookies } from './session-manager';\nimport { parseOldCookies } from './cookie-migration';\n\nexport class AmplitudeBrowser extends AmplitudeCore<BrowserConfig> {\n async init(apiKey: string, userId?: string, options?: BrowserOptions) {\n // Step 1: Read cookies stored by old SDK\n const oldCookies = parseOldCookies(apiKey, options);\n\n // Step 2: Create browser config\n const browserOptions = useBrowserConfig(apiKey, userId || oldCookies.userId, {\n ...options,\n deviceId: oldCookies.deviceId ?? options?.deviceId,\n sessionId: oldCookies.sessionId ?? options?.sessionId,\n optOut: options?.optOut ?? oldCookies.optOut,\n });\n await super.init(undefined, undefined, browserOptions);\n\n // Step 3: Store user session in cookie storage\n updateCookies(this.config, oldCookies.lastEventTime);\n\n // Step 4: Install plugins\n await this.add(new Context());\n await this.add(new Destination());\n\n // Step 4: Track attributions\n void this.trackAttributions();\n }\n\n getUserId() {\n return this.config.userId;\n }\n\n setUserId(userId: string) {\n this.config.userId = userId;\n updateCookies(this.config);\n }\n\n getDeviceId() {\n return this.config.deviceId;\n }\n\n setDeviceId(deviceId: string) {\n this.config.deviceId = deviceId;\n updateCookies(this.config);\n }\n\n getSessionId() {\n return this.config.sessionId;\n }\n\n setSessionId(sessionId: number) {\n this.config.sessionId = sessionId;\n updateCookies(this.config);\n }\n\n setOptOut(optOut: boolean) {\n super.setOptOut(optOut);\n updateCookies(this.config);\n }\n\n setTransport(transport: TransportType) {\n this.config.transportProvider = createTransport(transport);\n }\n\n identify(identify: IIdentify, eventOptions?: EventOptions): Promise<Result> {\n if (isInstanceProxy(identify)) {\n const queue = identify._q;\n identify._q = [];\n identify = convertProxyObjectToRealObject(new Identify(), queue);\n }\n return super.identify(identify, eventOptions);\n }\n\n groupIdentify(\n groupType: string,\n groupName: string | string[],\n identify: IIdentify,\n eventOptions?: EventOptions,\n ): Promise<Result> {\n if (isInstanceProxy(identify)) {\n const queue = identify._q;\n identify._q = [];\n identify = convertProxyObjectToRealObject(new Identify(), queue);\n }\n return super.groupIdentify(groupType, groupName, identify, eventOptions);\n }\n\n revenue(revenue: IRevenue, eventOptions?: EventOptions) {\n if (isInstanceProxy(revenue)) {\n const queue = revenue._q;\n revenue._q = [];\n revenue = convertProxyObjectToRealObject(new Revenue(), queue);\n }\n return super.revenue(revenue, eventOptions);\n }\n\n trackAttributions() {\n const attributions = getAttributions(this.config);\n if (Object.keys(attributions).length === 0) {\n return;\n }\n const id = new Identify();\n Object.entries(attributions).forEach(([key, value]: [string, string]) => {\n if (value) {\n id.setOnce(`initial_${key}`, value);\n id.set(key, value);\n }\n });\n return this.identify(id);\n }\n}\n\nconst client = new AmplitudeBrowser();\n\n/**\n * Initializes the Amplitude SDK with your apiKey, userId and optional configurations.\n * This method must be called before any other operations.\n *\n * ```typescript\n * await init(API_KEY, USER_ID, options).promise;\n * ```\n */\nexport const init = returnWrapper(client.init.bind(client));\n\n/**\n * Adds a new plugin.\n *\n * ```typescript\n * const plugin = {...};\n * amplitude.add(plugin);\n * ```\n */\nexport const add = returnWrapper(client.add.bind(client));\n\n/**\n * Removes a plugin.\n *\n * ```typescript\n * amplitude.remove('myPlugin');\n * ```\n */\nexport const remove = returnWrapper(client.remove.bind(client));\n\n/**\n * Tracks user-defined event, with specified type, optional event properties and optional overwrites.\n *\n * ```typescript\n * // event tracking with event type only\n * track('Page Load');\n *\n * // event tracking with event type and additional event properties\n * track('Page Load', { loadTime: 1000 });\n *\n * // event tracking with event type, additional event properties, and overwritten event options\n * track('Page Load', { loadTime: 1000 }, { sessionId: -1 });\n *\n * // alternatively, this tracking method is awaitable\n * const result = await track('Page Load').promise;\n * console.log(result.event); // {...}\n * console.log(result.code); // 200\n * console.log(result.message); // \"Event tracked successfully\"\n * ```\n */\nexport const track = returnWrapper(client.track.bind(client));\n\n/**\n * Alias for track()\n */\nexport const logEvent = returnWrapper(client.logEvent.bind(client));\n\n/**\n * Sends an identify event containing user property operations\n *\n * ```typescript\n * const id = new Identify();\n * id.set('colors', ['rose', 'gold']);\n * identify(id);\n *\n * // alternatively, this tracking method is awaitable\n * const result = await identify(id).promise;\n * console.log(result.event); // {...}\n * console.log(result.code); // 200\n * console.log(result.message); // \"Event tracked successfully\"\n * ```\n */\nexport const identify = returnWrapper(client.identify.bind(client));\n\n/**\n * Sends a group identify event containing group property operations.\n *\n * ```typescript\n * const id = new Identify();\n * id.set('skills', ['js', 'ts']);\n * const groupType = 'org';\n * const groupName = 'engineering';\n * groupIdentify(groupType, groupName, id);\n *\n * // alternatively, this tracking method is awaitable\n * const result = await groupIdentify(groupType, groupName, id).promise;\n * console.log(result.event); // {...}\n * console.log(result.code); // 200\n * console.log(result.message); // \"Event tracked successfully\"\n * ```\n */\nexport const groupIdentify = returnWrapper(client.groupIdentify.bind(client));\nexport const setGroup = returnWrapper(client.setGroup.bind(client));\n\n/**\n * Sends a revenue event containing revenue property operations.\n *\n * ```typescript\n * const rev = new Revenue();\n * rev.setRevenue(100);\n * revenue(rev);\n *\n * // alternatively, this tracking method is awaitable\n * const result = await revenue(rev).promise;\n * console.log(result.event); // {...}\n * console.log(result.code); // 200\n * console.log(result.message); // \"Event tracked successfully\"\n * ```\n */\nexport const revenue = returnWrapper(client.revenue.bind(client));\n\n/**\n * Returns current user ID.\n *\n * ```typescript\n * const userId = getUserId();\n * ```\n */\nexport const getUserId = client.getUserId.bind(client);\n\n/**\n * Sets a new user ID.\n *\n * ```typescript\n * setUserId('userId');\n * ```\n */\nexport const setUserId = client.setUserId.bind(client);\n\n/**\n * Returns current device ID.\n *\n * ```typescript\n * const deviceId = getDeviceId();\n * ```\n */\nexport const getDeviceId = client.getDeviceId.bind(client);\n\n/**\n * Sets a new device ID.\n * When setting a custom device ID, make sure the value is sufficiently unique.\n * A uuid is recommended.\n *\n * ```typescript\n * setDeviceId('deviceId');\n * ```\n */\nexport const setDeviceId = client.setDeviceId.bind(client);\n\n/**\n * Returns current session ID.\n *\n * ```typescript\n * const sessionId = getSessionId();\n * ```\n */\nexport const getSessionId = client.getSessionId.bind(client);\n\n/**\n * Sets a new session ID.\n * When settign a custom session ID, make sure the value is in milliseconds since epoch (Unix Timestamp).\n *\n * ```typescript\n * setSessionId(Date.now());\n * ```\n */\nexport const setSessionId = client.setSessionId.bind(client);\n\n/**\n * Sets a new optOut config value. This toggles event tracking on/off.\n *\n *```typescript\n * // Stops tracking\n * setOptOut(true);\n *\n * // Starts/resumes tracking\n * setOptOut(false);\n * ```\n */\nexport const setOptOut = client.setOptOut.bind(client);\n\n/**\n * Sets the network transport type for events.\n *\n * ```typescript\n * // Use Fetch API\n * setTransport('fetch');\n *\n * // Use XMLHttpRequest API\n * setTransport('xhr');\n *\n * // Use navigator.sendBeacon API\n * setTransport('beacon');\n * ```\n */\nexport const setTransport = client.setTransport.bind(client);\n"]}
|
package/lib/cjs/config.d.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { BrowserOptions, BrowserConfig as IBrowserConfig, Storage, TrackingOptions, TransportType, UserSession } from '@amplitude/analytics-types';
|
|
1
|
+
import { Event, BrowserOptions, BrowserConfig as IBrowserConfig, Storage, TrackingOptions, TransportType, UserSession } from '@amplitude/analytics-types';
|
|
2
2
|
import { Config } from '@amplitude/analytics-core';
|
|
3
3
|
import { FetchTransport } from './transports/fetch';
|
|
4
|
+
import { MemoryStorage } from './storage/memory';
|
|
4
5
|
import { XHRTransport } from './transports/xhr';
|
|
5
6
|
import { SendBeaconTransport } from './transports/send-beacon';
|
|
6
|
-
export declare const
|
|
7
|
+
export declare const getDefaultConfig: () => {
|
|
7
8
|
cookieExpiration: number;
|
|
8
9
|
cookieSameSite: string;
|
|
9
10
|
cookieSecure: boolean;
|
|
11
|
+
cookieStorage: MemoryStorage<UserSession>;
|
|
10
12
|
disableCookies: boolean;
|
|
11
13
|
domain: string;
|
|
12
14
|
includeGclid: boolean;
|
|
@@ -14,6 +16,7 @@ export declare const defaultConfig: {
|
|
|
14
16
|
includeReferrer: boolean;
|
|
15
17
|
includeUtm: boolean;
|
|
16
18
|
sessionTimeout: number;
|
|
19
|
+
storageProvider: MemoryStorage<Event[]>;
|
|
17
20
|
trackingOptions: {
|
|
18
21
|
city: boolean;
|
|
19
22
|
country: boolean;
|
|
@@ -38,19 +41,20 @@ export declare class BrowserConfig extends Config implements IBrowserConfig {
|
|
|
38
41
|
cookieStorage: Storage<UserSession>;
|
|
39
42
|
disableCookies: boolean;
|
|
40
43
|
domain: string;
|
|
41
|
-
includeUtm: boolean;
|
|
42
|
-
includeReferrer: boolean;
|
|
43
44
|
includeGclid: boolean;
|
|
44
45
|
includeFbclid: boolean;
|
|
46
|
+
includeReferrer: boolean;
|
|
47
|
+
includeUtm: boolean;
|
|
45
48
|
sessionTimeout: number;
|
|
46
49
|
trackingOptions: TrackingOptions;
|
|
47
50
|
constructor(apiKey: string, userId?: string, options?: BrowserOptions);
|
|
48
51
|
}
|
|
49
|
-
export declare const
|
|
52
|
+
export declare const useBrowserConfig: (apiKey: string, userId?: string | undefined, options?: BrowserOptions | undefined) => IBrowserConfig;
|
|
50
53
|
export declare const createCookieStorage: (overrides?: BrowserOptions | undefined, baseConfig?: {
|
|
51
54
|
cookieExpiration: number;
|
|
52
55
|
cookieSameSite: string;
|
|
53
56
|
cookieSecure: boolean;
|
|
57
|
+
cookieStorage: MemoryStorage<UserSession>;
|
|
54
58
|
disableCookies: boolean;
|
|
55
59
|
domain: string;
|
|
56
60
|
includeGclid: boolean;
|
|
@@ -58,6 +62,7 @@ export declare const createCookieStorage: (overrides?: BrowserOptions | undefine
|
|
|
58
62
|
includeReferrer: boolean;
|
|
59
63
|
includeUtm: boolean;
|
|
60
64
|
sessionTimeout: number;
|
|
65
|
+
storageProvider: MemoryStorage<Event[]>;
|
|
61
66
|
trackingOptions: {
|
|
62
67
|
city: boolean;
|
|
63
68
|
country: boolean;
|
|
@@ -75,9 +80,8 @@ export declare const createCookieStorage: (overrides?: BrowserOptions | undefine
|
|
|
75
80
|
};
|
|
76
81
|
transportProvider: FetchTransport;
|
|
77
82
|
}) => Storage<UserSession>;
|
|
78
|
-
export declare const createEventsStorage: (overrides?: BrowserOptions | undefined) => Storage<
|
|
83
|
+
export declare const createEventsStorage: (overrides?: BrowserOptions | undefined) => Storage<Event[]>;
|
|
79
84
|
export declare const createDeviceId: (idFromCookies?: string | undefined, idFromOptions?: string | undefined, idFromQueryParams?: string | undefined) => string;
|
|
80
85
|
export declare const createSessionId: (idFromCookies: number | undefined, idFromOptions: number | undefined, lastEventTime: number | undefined, sessionTimeout: number) => number;
|
|
81
86
|
export declare const createTransport: (transport?: TransportType | undefined) => FetchTransport | XHRTransport | SendBeaconTransport;
|
|
82
|
-
export declare const getConfig: () => BrowserConfig;
|
|
83
87
|
//# sourceMappingURL=config.d.ts.map
|
package/lib/cjs/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,aAAa,IAAI,cAAc,EAC/B,OAAO,EACP,eAAe,EACf,aAAa,EACb,WAAW,EACZ,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,cAAc,EACd,aAAa,IAAI,cAAc,EAC/B,OAAO,EACP,eAAe,EACf,aAAa,EACb,WAAW,EACZ,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAGnD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAIjD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;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