Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@amplitude/analytics-browser

Package Overview
Dependencies
Maintainers
21
Versions
163
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@amplitude/analytics-browser - npm Package Compare versions

Comparing version 2.8.1 to 2.9.0

1

lib/cjs/browser-client.d.ts

@@ -27,3 +27,4 @@ import { AmplitudeCore } from '@amplitude/analytics-core';

process(event: Event): Promise<Result>;
private logBrowserOptions;
}
//# sourceMappingURL=browser-client.d.ts.map

@@ -60,2 +60,3 @@ Object.defineProperty(exports, "__esModule", { value: true });

_d.sent();
this.logBrowserOptions(options);
if (!(0, analytics_client_common_1.isAttributionTrackingEnabled)(this.config.defaultTracking)) return [3 /*break*/, 4];

@@ -98,2 +99,3 @@ attributionTrackingOptions = (0, analytics_client_common_1.getAttributionTrackingConfig)(this.config);

if (!(0, analytics_client_common_1.isFileDownloadTrackingEnabled)(this.config.defaultTracking)) return [3 /*break*/, 11];
this.config.loggerProvider.debug('Adding file download tracking plugin');
return [4 /*yield*/, this.add((0, file_download_tracking_1.fileDownloadTracking)()).promise];

@@ -105,2 +107,3 @@ case 10:

if (!(0, analytics_client_common_1.isFormInteractionTrackingEnabled)(this.config.defaultTracking)) return [3 /*break*/, 13];
this.config.loggerProvider.debug('Adding form interaction plugin');
return [4 /*yield*/, this.add((0, form_interaction_tracking_1.formInteractionTracking)()).promise];

@@ -112,2 +115,3 @@ case 12:

if (!(0, analytics_client_common_1.isPageViewTrackingEnabled)(this.config.defaultTracking)) return [3 /*break*/, 15];
this.config.loggerProvider.debug('Adding page view tracking plugin');
return [4 /*yield*/, this.add((0, plugin_page_view_tracking_browser_1.pageViewTrackingPlugin)((0, analytics_client_common_1.getPageViewTrackingConfig)(this.config))).promise];

@@ -142,2 +146,3 @@ case 14:

}
this.config.loggerProvider.debug('function setUserId: ', userId);
if (userId !== this.config.userId || userId === undefined) {

@@ -157,2 +162,3 @@ this.config.userId = userId;

}
this.config.loggerProvider.debug('function setDeviceId: ', deviceId);
this.config.deviceId = deviceId;

@@ -180,2 +186,3 @@ (0, analytics_client_common_1.setConnectorDeviceId)(deviceId, this.config.instanceName);

}
this.config.loggerProvider.debug('function setSessionId: ', sessionId);
var previousSessionId = this.getSessionId();

@@ -298,2 +305,12 @@ var lastEventTime = this.config.lastEventTime;

};
AmplitudeBrowser.prototype.logBrowserOptions = function (browserConfig) {
try {
var browserConfigCopy = tslib_1.__assign(tslib_1.__assign({}, browserConfig), { apiKey: browserConfig.apiKey.substring(0, 10) + '********' });
this.config.loggerProvider.debug('Initialized Amplitude with BrowserConfig:', JSON.stringify(browserConfigCopy));
}
catch (e) {
/* istanbul ignore next */
this.config.loggerProvider.error('Error logging browser config', e);
}
};
return AmplitudeBrowser;

@@ -300,0 +317,0 @@ }(analytics_core_1.AmplitudeCore));

4

lib/cjs/config.d.ts

@@ -42,3 +42,4 @@ import { Event, BrowserOptions, BrowserConfig as IBrowserConfig, DefaultTrackingOptions, Storage, TrackingOptions, TransportType, UserSession, Logger as ILogger, LogLevel, Plan, IngestionMetadata, IdentityStorageType, ServerZoneType, OfflineDisabled } from '@amplitude/analytics-types';

protected _pageCounter?: number;
constructor(apiKey: string, appVersion?: string | undefined, cookieStorage?: Storage<UserSession>, cookieOptions?: CookieOptions, defaultTracking?: boolean | DefaultTrackingOptions | undefined, deviceId?: string, flushIntervalMillis?: number, flushMaxRetries?: number, flushQueueSize?: number, identityStorage?: IdentityStorageType, ingestionMetadata?: IngestionMetadata | undefined, instanceName?: string | undefined, lastEventId?: number, lastEventTime?: number, loggerProvider?: ILogger, logLevel?: LogLevel, minIdLength?: number | undefined, offline?: boolean | typeof OfflineDisabled, optOut?: boolean, partnerId?: string | undefined, plan?: Plan | undefined, serverUrl?: string, serverZone?: ServerZoneType, sessionId?: number, sessionTimeout?: number, storageProvider?: Storage<Event[]>, trackingOptions?: Required<TrackingOptions>, transport?: 'fetch' | 'xhr' | 'beacon', useBatch?: boolean, userId?: string, pageCounter?: number);
protected _debugLogsEnabled?: boolean;
constructor(apiKey: string, appVersion?: string | undefined, cookieStorage?: Storage<UserSession>, cookieOptions?: CookieOptions, defaultTracking?: boolean | DefaultTrackingOptions | undefined, deviceId?: string, flushIntervalMillis?: number, flushMaxRetries?: number, flushQueueSize?: number, identityStorage?: IdentityStorageType, ingestionMetadata?: IngestionMetadata | undefined, instanceName?: string | undefined, lastEventId?: number, lastEventTime?: number, loggerProvider?: ILogger, logLevel?: LogLevel, minIdLength?: number | undefined, offline?: boolean | typeof OfflineDisabled, optOut?: boolean, partnerId?: string | undefined, plan?: Plan | undefined, serverUrl?: string, serverZone?: ServerZoneType, sessionId?: number, sessionTimeout?: number, storageProvider?: Storage<Event[]>, trackingOptions?: Required<TrackingOptions>, transport?: 'fetch' | 'xhr' | 'beacon', useBatch?: boolean, userId?: string, pageCounter?: number, debugLogsEnabled?: boolean);
get cookieStorage(): Storage<UserSession>;

@@ -60,2 +61,3 @@ set cookieStorage(cookieStorage: Storage<UserSession>);

set pageCounter(pageCounter: number | undefined);
set debugLogsEnabled(debugLogsEnabled: boolean | undefined);
private updateStorage;

@@ -62,0 +64,0 @@ }

@@ -17,3 +17,3 @@ var _this = this;

tslib_1.__extends(BrowserConfig, _super);
function BrowserConfig(apiKey, appVersion, cookieStorage, cookieOptions, defaultTracking, deviceId, flushIntervalMillis, flushMaxRetries, flushQueueSize, identityStorage, ingestionMetadata, instanceName, lastEventId, lastEventTime, loggerProvider, logLevel, minIdLength, offline, optOut, partnerId, plan, serverUrl, serverZone, sessionId, sessionTimeout, storageProvider, trackingOptions, transport, useBatch, userId, pageCounter) {
function BrowserConfig(apiKey, appVersion, cookieStorage, cookieOptions, defaultTracking, deviceId, flushIntervalMillis, flushMaxRetries, flushQueueSize, identityStorage, ingestionMetadata, instanceName, lastEventId, lastEventTime, loggerProvider, logLevel, minIdLength, offline, optOut, partnerId, plan, serverUrl, serverZone, sessionId, sessionTimeout, storageProvider, trackingOptions, transport, useBatch, userId, pageCounter, debugLogsEnabled) {
if (cookieStorage === void 0) { cookieStorage = new analytics_core_1.MemoryStorage(); }

@@ -79,3 +79,4 @@ if (cookieOptions === void 0) { cookieOptions = {

_this.userId = userId;
_this.loggerProvider.enable(_this.logLevel);
_this.debugLogsEnabled = debugLogsEnabled;
_this.loggerProvider.enable(debugLogsEnabled ? analytics_types_1.LogLevel.Debug : _this.logLevel);
return _this;

@@ -187,2 +188,12 @@ }

});
Object.defineProperty(BrowserConfig.prototype, "debugLogsEnabled", {
set: function (debugLogsEnabled) {
if (this._debugLogsEnabled !== debugLogsEnabled) {
this._debugLogsEnabled = debugLogsEnabled;
this.updateStorage();
}
},
enumerable: false,
configurable: true
});
BrowserConfig.prototype.updateStorage = function () {

@@ -197,2 +208,3 @@ var cache = {

pageCounter: this._pageCounter,
debugLogsEnabled: this._debugLogsEnabled,
};

@@ -207,3 +219,3 @@ void this.cookieStorage.set((0, analytics_client_common_1.getCookieName)(this.apiKey), cache);

return tslib_1.__awaiter(_this, void 0, void 0, function () {
var identityStorage, cookieOptions, _a, _b, cookieStorage, legacyCookies, previousCookies, queryParams, deviceId, lastEventId, lastEventTime, optOut, sessionId, userId, trackingOptions, pageCounter;
var identityStorage, cookieOptions, _a, _b, cookieStorage, legacyCookies, previousCookies, queryParams, deviceId, lastEventId, lastEventTime, optOut, sessionId, userId, trackingOptions, pageCounter, debugLogsEnabled;
var _c;

@@ -254,3 +266,4 @@ var _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2;

pageCounter = previousCookies === null || previousCookies === void 0 ? void 0 : previousCookies.pageCounter;
return [2 /*return*/, new BrowserConfig(apiKey, options.appVersion, cookieStorage, cookieOptions, options.defaultTracking, deviceId, options.flushIntervalMillis, options.flushMaxRetries, options.flushQueueSize, identityStorage, options.ingestionMetadata, options.instanceName, lastEventId, lastEventTime, options.loggerProvider, options.logLevel, options.minIdLength, options.offline, optOut, options.partnerId, options.plan, options.serverUrl, options.serverZone, sessionId, options.sessionTimeout, options.storageProvider, trackingOptions, options.transport, options.useBatch, userId, pageCounter)];
debugLogsEnabled = previousCookies === null || previousCookies === void 0 ? void 0 : previousCookies.debugLogsEnabled;
return [2 /*return*/, new BrowserConfig(apiKey, options.appVersion, cookieStorage, cookieOptions, options.defaultTracking, deviceId, options.flushIntervalMillis, options.flushMaxRetries, options.flushQueueSize, identityStorage, options.ingestionMetadata, options.instanceName, lastEventId, lastEventTime, options.loggerProvider, options.logLevel, options.minIdLength, options.offline, optOut, options.partnerId, options.plan, options.serverUrl, options.serverZone, sessionId, options.sessionTimeout, options.storageProvider, trackingOptions, options.transport, options.useBatch, userId, pageCounter, debugLogsEnabled)];
}

@@ -257,0 +270,0 @@ });

@@ -6,2 +6,3 @@ var _this = this;

var constants_1 = require("../constants");
var analytics_client_common_1 = require("@amplitude/analytics-client-common");
var fileDownloadTracking = function () {

@@ -29,8 +30,9 @@ var observer;

var setup = function (config, amplitude) { return tslib_1.__awaiter(_this, void 0, void 0, function () {
return tslib_1.__generator(this, function (_a) {
var _a;
return tslib_1.__generator(this, function (_b) {
// The form interaction plugin observes changes in the dom. For this to work correctly, the observer can only be setup
// after the body is built. When Amplitud gets initialized in a script tag, the body tag is still unavailable. So register this
// only after the window is loaded
// eslint-disable-next-line no-restricted-globals
window.addEventListener('load', function () {
/* istanbul ignore next */
(_a = (0, analytics_client_common_1.getGlobalScope)()) === null || _a === void 0 ? void 0 : _a.addEventListener('load', function () {
/* istanbul ignore if */

@@ -37,0 +39,0 @@ if (!amplitude) {

@@ -6,2 +6,3 @@ var _this = this;

var constants_1 = require("../constants");
var analytics_client_common_1 = require("@amplitude/analytics-client-common");
var formInteractionTracking = function () {

@@ -29,8 +30,9 @@ var observer;

var setup = function (config, amplitude) { return tslib_1.__awaiter(_this, void 0, void 0, function () {
return tslib_1.__generator(this, function (_a) {
var _a;
return tslib_1.__generator(this, function (_b) {
// The form interaction plugin observes changes in the dom. For this to work correctly, the observer can only be setup
// after the body is built. When Amplitud gets initialized in a script tag, the body tag is still unavailable. So register this
// only after the window is loaded
// eslint-disable-next-line no-restricted-globals
window.addEventListener('load', function () {
/* istanbul ignore next */
(_a = (0, analytics_client_common_1.getGlobalScope)()) === null || _a === void 0 ? void 0 : _a.addEventListener('load', function () {
/* istanbul ignore if */

@@ -37,0 +39,0 @@ if (!amplitude) {

@@ -27,9 +27,10 @@ Object.defineProperty(exports, "__esModule", { value: true });

if (xhr.readyState === _this.state.done) {
var responsePayload = xhr.responseText;
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
var parsedResponsePayload = responsePayload
? JSON.parse(responsePayload)
: { code: xhr.status };
var result = _this.buildResponse(parsedResponsePayload);
resolve(result);
var responseText = xhr.responseText;
try {
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
resolve(_this.buildResponse(JSON.parse(responseText)));
}
catch (_a) {
resolve(_this.buildResponse({ code: xhr.status }));
}
}

@@ -36,0 +37,0 @@ };

@@ -1,2 +0,2 @@

export declare const VERSION = "2.8.1";
export declare const VERSION = "2.9.0";
//# sourceMappingURL=version.d.ts.map
Object.defineProperty(exports, "__esModule", { value: true });
exports.VERSION = void 0;
exports.VERSION = '2.8.1';
exports.VERSION = '2.9.0';
//# sourceMappingURL=version.js.map

@@ -27,3 +27,4 @@ import { AmplitudeCore } from '@amplitude/analytics-core';

process(event: Event): Promise<Result>;
private logBrowserOptions;
}
//# sourceMappingURL=browser-client.d.ts.map

@@ -58,2 +58,3 @@ import { __assign, __awaiter, __extends, __generator } from "tslib";

_d.sent();
this.logBrowserOptions(options);
if (!isAttributionTrackingEnabled(this.config.defaultTracking)) return [3 /*break*/, 4];

@@ -96,2 +97,3 @@ attributionTrackingOptions = getAttributionTrackingConfig(this.config);

if (!isFileDownloadTrackingEnabled(this.config.defaultTracking)) return [3 /*break*/, 11];
this.config.loggerProvider.debug('Adding file download tracking plugin');
return [4 /*yield*/, this.add(fileDownloadTracking()).promise];

@@ -103,2 +105,3 @@ case 10:

if (!isFormInteractionTrackingEnabled(this.config.defaultTracking)) return [3 /*break*/, 13];
this.config.loggerProvider.debug('Adding form interaction plugin');
return [4 /*yield*/, this.add(formInteractionTracking()).promise];

@@ -110,2 +113,3 @@ case 12:

if (!isPageViewTrackingEnabled(this.config.defaultTracking)) return [3 /*break*/, 15];
this.config.loggerProvider.debug('Adding page view tracking plugin');
return [4 /*yield*/, this.add(pageViewTrackingPlugin(getPageViewTrackingConfig(this.config))).promise];

@@ -140,2 +144,3 @@ case 14:

}
this.config.loggerProvider.debug('function setUserId: ', userId);
if (userId !== this.config.userId || userId === undefined) {

@@ -155,2 +160,3 @@ this.config.userId = userId;

}
this.config.loggerProvider.debug('function setDeviceId: ', deviceId);
this.config.deviceId = deviceId;

@@ -178,2 +184,3 @@ setConnectorDeviceId(deviceId, this.config.instanceName);

}
this.config.loggerProvider.debug('function setSessionId: ', sessionId);
var previousSessionId = this.getSessionId();

@@ -296,2 +303,12 @@ var lastEventTime = this.config.lastEventTime;

};
AmplitudeBrowser.prototype.logBrowserOptions = function (browserConfig) {
try {
var browserConfigCopy = __assign(__assign({}, browserConfig), { apiKey: browserConfig.apiKey.substring(0, 10) + '********' });
this.config.loggerProvider.debug('Initialized Amplitude with BrowserConfig:', JSON.stringify(browserConfigCopy));
}
catch (e) {
/* istanbul ignore next */
this.config.loggerProvider.error('Error logging browser config', e);
}
};
return AmplitudeBrowser;

@@ -298,0 +315,0 @@ }(AmplitudeCore));

@@ -42,3 +42,4 @@ import { Event, BrowserOptions, BrowserConfig as IBrowserConfig, DefaultTrackingOptions, Storage, TrackingOptions, TransportType, UserSession, Logger as ILogger, LogLevel, Plan, IngestionMetadata, IdentityStorageType, ServerZoneType, OfflineDisabled } from '@amplitude/analytics-types';

protected _pageCounter?: number;
constructor(apiKey: string, appVersion?: string | undefined, cookieStorage?: Storage<UserSession>, cookieOptions?: CookieOptions, defaultTracking?: boolean | DefaultTrackingOptions | undefined, deviceId?: string, flushIntervalMillis?: number, flushMaxRetries?: number, flushQueueSize?: number, identityStorage?: IdentityStorageType, ingestionMetadata?: IngestionMetadata | undefined, instanceName?: string | undefined, lastEventId?: number, lastEventTime?: number, loggerProvider?: ILogger, logLevel?: LogLevel, minIdLength?: number | undefined, offline?: boolean | typeof OfflineDisabled, optOut?: boolean, partnerId?: string | undefined, plan?: Plan | undefined, serverUrl?: string, serverZone?: ServerZoneType, sessionId?: number, sessionTimeout?: number, storageProvider?: Storage<Event[]>, trackingOptions?: Required<TrackingOptions>, transport?: 'fetch' | 'xhr' | 'beacon', useBatch?: boolean, userId?: string, pageCounter?: number);
protected _debugLogsEnabled?: boolean;
constructor(apiKey: string, appVersion?: string | undefined, cookieStorage?: Storage<UserSession>, cookieOptions?: CookieOptions, defaultTracking?: boolean | DefaultTrackingOptions | undefined, deviceId?: string, flushIntervalMillis?: number, flushMaxRetries?: number, flushQueueSize?: number, identityStorage?: IdentityStorageType, ingestionMetadata?: IngestionMetadata | undefined, instanceName?: string | undefined, lastEventId?: number, lastEventTime?: number, loggerProvider?: ILogger, logLevel?: LogLevel, minIdLength?: number | undefined, offline?: boolean | typeof OfflineDisabled, optOut?: boolean, partnerId?: string | undefined, plan?: Plan | undefined, serverUrl?: string, serverZone?: ServerZoneType, sessionId?: number, sessionTimeout?: number, storageProvider?: Storage<Event[]>, trackingOptions?: Required<TrackingOptions>, transport?: 'fetch' | 'xhr' | 'beacon', useBatch?: boolean, userId?: string, pageCounter?: number, debugLogsEnabled?: boolean);
get cookieStorage(): Storage<UserSession>;

@@ -60,2 +61,3 @@ set cookieStorage(cookieStorage: Storage<UserSession>);

set pageCounter(pageCounter: number | undefined);
set debugLogsEnabled(debugLogsEnabled: boolean | undefined);
private updateStorage;

@@ -62,0 +64,0 @@ }

@@ -14,3 +14,3 @@ import { __assign, __awaiter, __extends, __generator } from "tslib";

__extends(BrowserConfig, _super);
function BrowserConfig(apiKey, appVersion, cookieStorage, cookieOptions, defaultTracking, deviceId, flushIntervalMillis, flushMaxRetries, flushQueueSize, identityStorage, ingestionMetadata, instanceName, lastEventId, lastEventTime, loggerProvider, logLevel, minIdLength, offline, optOut, partnerId, plan, serverUrl, serverZone, sessionId, sessionTimeout, storageProvider, trackingOptions, transport, useBatch, userId, pageCounter) {
function BrowserConfig(apiKey, appVersion, cookieStorage, cookieOptions, defaultTracking, deviceId, flushIntervalMillis, flushMaxRetries, flushQueueSize, identityStorage, ingestionMetadata, instanceName, lastEventId, lastEventTime, loggerProvider, logLevel, minIdLength, offline, optOut, partnerId, plan, serverUrl, serverZone, sessionId, sessionTimeout, storageProvider, trackingOptions, transport, useBatch, userId, pageCounter, debugLogsEnabled) {
if (cookieStorage === void 0) { cookieStorage = new MemoryStorage(); }

@@ -76,3 +76,4 @@ if (cookieOptions === void 0) { cookieOptions = {

_this.userId = userId;
_this.loggerProvider.enable(_this.logLevel);
_this.debugLogsEnabled = debugLogsEnabled;
_this.loggerProvider.enable(debugLogsEnabled ? LogLevel.Debug : _this.logLevel);
return _this;

@@ -184,2 +185,12 @@ }

});
Object.defineProperty(BrowserConfig.prototype, "debugLogsEnabled", {
set: function (debugLogsEnabled) {
if (this._debugLogsEnabled !== debugLogsEnabled) {
this._debugLogsEnabled = debugLogsEnabled;
this.updateStorage();
}
},
enumerable: false,
configurable: true
});
BrowserConfig.prototype.updateStorage = function () {

@@ -194,2 +205,3 @@ var cache = {

pageCounter: this._pageCounter,
debugLogsEnabled: this._debugLogsEnabled,
};

@@ -204,3 +216,3 @@ void this.cookieStorage.set(getCookieName(this.apiKey), cache);

return __awaiter(void 0, void 0, void 0, function () {
var identityStorage, cookieOptions, _a, _b, cookieStorage, legacyCookies, previousCookies, queryParams, deviceId, lastEventId, lastEventTime, optOut, sessionId, userId, trackingOptions, pageCounter;
var identityStorage, cookieOptions, _a, _b, cookieStorage, legacyCookies, previousCookies, queryParams, deviceId, lastEventId, lastEventTime, optOut, sessionId, userId, trackingOptions, pageCounter, debugLogsEnabled;
var _c;

@@ -251,3 +263,4 @@ var _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2;

pageCounter = previousCookies === null || previousCookies === void 0 ? void 0 : previousCookies.pageCounter;
return [2 /*return*/, new BrowserConfig(apiKey, options.appVersion, cookieStorage, cookieOptions, options.defaultTracking, deviceId, options.flushIntervalMillis, options.flushMaxRetries, options.flushQueueSize, identityStorage, options.ingestionMetadata, options.instanceName, lastEventId, lastEventTime, options.loggerProvider, options.logLevel, options.minIdLength, options.offline, optOut, options.partnerId, options.plan, options.serverUrl, options.serverZone, sessionId, options.sessionTimeout, options.storageProvider, trackingOptions, options.transport, options.useBatch, userId, pageCounter)];
debugLogsEnabled = previousCookies === null || previousCookies === void 0 ? void 0 : previousCookies.debugLogsEnabled;
return [2 /*return*/, new BrowserConfig(apiKey, options.appVersion, cookieStorage, cookieOptions, options.defaultTracking, deviceId, options.flushIntervalMillis, options.flushMaxRetries, options.flushQueueSize, identityStorage, options.ingestionMetadata, options.instanceName, lastEventId, lastEventTime, options.loggerProvider, options.logLevel, options.minIdLength, options.offline, optOut, options.partnerId, options.plan, options.serverUrl, options.serverZone, sessionId, options.sessionTimeout, options.storageProvider, trackingOptions, options.transport, options.useBatch, userId, pageCounter, debugLogsEnabled)];
}

@@ -254,0 +267,0 @@ });

import { __awaiter, __generator } from "tslib";
import { DEFAULT_FILE_DOWNLOAD_EVENT, FILE_EXTENSION, FILE_NAME, LINK_ID, LINK_TEXT, LINK_URL } from '../constants';
import { getGlobalScope } from '@amplitude/analytics-client-common';
export var fileDownloadTracking = function () {

@@ -25,8 +26,9 @@ var observer;

var setup = function (config, amplitude) { return __awaiter(void 0, void 0, void 0, function () {
return __generator(this, function (_a) {
var _a;
return __generator(this, function (_b) {
// The form interaction plugin observes changes in the dom. For this to work correctly, the observer can only be setup
// after the body is built. When Amplitud gets initialized in a script tag, the body tag is still unavailable. So register this
// only after the window is loaded
// eslint-disable-next-line no-restricted-globals
window.addEventListener('load', function () {
/* istanbul ignore next */
(_a = getGlobalScope()) === null || _a === void 0 ? void 0 : _a.addEventListener('load', function () {
/* istanbul ignore if */

@@ -33,0 +35,0 @@ if (!amplitude) {

import { __awaiter, __generator } from "tslib";
import { DEFAULT_FORM_START_EVENT, DEFAULT_FORM_SUBMIT_EVENT, FORM_ID, FORM_NAME, FORM_DESTINATION, } from '../constants';
import { getGlobalScope } from '@amplitude/analytics-client-common';
export var formInteractionTracking = function () {

@@ -25,8 +26,9 @@ var observer;

var setup = function (config, amplitude) { return __awaiter(void 0, void 0, void 0, function () {
return __generator(this, function (_a) {
var _a;
return __generator(this, function (_b) {
// The form interaction plugin observes changes in the dom. For this to work correctly, the observer can only be setup
// after the body is built. When Amplitud gets initialized in a script tag, the body tag is still unavailable. So register this
// only after the window is loaded
// eslint-disable-next-line no-restricted-globals
window.addEventListener('load', function () {
/* istanbul ignore next */
(_a = getGlobalScope()) === null || _a === void 0 ? void 0 : _a.addEventListener('load', function () {
/* istanbul ignore if */

@@ -33,0 +35,0 @@ if (!amplitude) {

@@ -25,9 +25,10 @@ import { __awaiter, __extends, __generator } from "tslib";

if (xhr.readyState === _this.state.done) {
var responsePayload = xhr.responseText;
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
var parsedResponsePayload = responsePayload
? JSON.parse(responsePayload)
: { code: xhr.status };
var result = _this.buildResponse(parsedResponsePayload);
resolve(result);
var responseText = xhr.responseText;
try {
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
resolve(_this.buildResponse(JSON.parse(responseText)));
}
catch (_a) {
resolve(_this.buildResponse({ code: xhr.status }));
}
}

@@ -34,0 +35,0 @@ };

@@ -1,2 +0,2 @@

export declare const VERSION = "2.8.1";
export declare const VERSION = "2.9.0";
//# sourceMappingURL=version.d.ts.map

@@ -1,2 +0,2 @@

export var VERSION = '2.8.1';
export var VERSION = '2.9.0';
//# sourceMappingURL=version.js.map

@@ -1,1 +0,1 @@

!function(){"use strict";!function(e,t){var r=e.amplitude||{_q:[],_iq:{}};if(r.invoked)e.console&&console.error&&console.error("Amplitude snippet has been loaded.");else{var n=function(e,t){e.prototype[t]=function(){return this._q.push({name:t,args:Array.prototype.slice.call(arguments,0)}),this}},i=function(e,t,r){return function(n){e._q.push({name:t,args:Array.prototype.slice.call(r,0),resolve:n})}},o=function(e,t,r){e[t]=function(){if(r)return{promise:new Promise(i(e,t,Array.prototype.slice.call(arguments)))}}},s=function(e){for(var t=0;t<v.length;t++)o(e,v[t],!1);for(var r=0;r<y.length;r++)o(e,y[r],!0)};r.invoked=!0;var u=t.getElementsByTagName("script")[0],a=t.createElement("script");a.src="https://cdn.amplitude.com/libs/plugin-autocapture-browser-0.9.0-min.js.gz",a.async=!1,u.parentNode.insertBefore(a,u);var c=t.createElement("script");c.type="text/javascript",c.integrity="sha384-7OMex1WYtzbDAdKl8HtBEJJB+8Yj6zAJRSeZhWCSQmjLGr4H2OBdrKtiw8HEhwgI",c.crossOrigin="anonymous",c.async=!1,c.src="https://cdn.amplitude.com/libs/analytics-browser-2.8.1-min.js.gz",c.onload=function(){e.amplitude.runQueuedFunctions||console.log("[Amplitude] Error: could not load SDK"),e.amplitude.init("YOUR_API_KEY","YOUR_USER_ID",{instanceName:"amplitude-bookmarklet",serverZone:"YOUR_SERVER_ZONE",ingestionMetadata:{sourceName:"browser-typescript-bookmarklet",sourceVersion:"1.0.0"},optOut:!1}),amplitudeAutocapturePlugin&&amplitudeAutocapturePlugin.autocapturePlugin&&"function"==typeof amplitudeAutocapturePlugin.autocapturePlugin&&e.amplitude.add(amplitudeAutocapturePlugin.autocapturePlugin()),alert("Amplitude is now tracking events!")},u.parentNode.insertBefore(c,u);for(var p=function(){return this._q=[],this},l=["add","append","clearAll","prepend","set","setOnce","unset","preInsert","postInsert","remove","getUserProperties"],d=0;d<l.length;d++)n(p,l[d]);r.Identify=p;for(var m=function(){return this._q=[],this},g=["getEventProperties","setProductId","setQuantity","setPrice","setRevenue","setRevenueType","setEventProperties"],f=0;f<g.length;f++)n(m,g[f]);r.Revenue=m;var v=["getDeviceId","setDeviceId","getSessionId","setSessionId","getUserId","setUserId","setOptOut","setTransport","reset","extendSession"],y=["init","add","remove","track","logEvent","identify","groupIdentify","setGroup","revenue","flush"];s(r),r.createInstance=function(e){return r._iq[e]={_q:[]},s(r._iq[e]),r._iq[e]},e.amplitude=r}}(window,document)}();
!function(){"use strict";!function(e,t){var r=e.amplitude||{_q:[],_iq:{}};if(r.invoked)e.console&&console.error&&console.error("Amplitude snippet has been loaded.");else{var n=function(e,t){e.prototype[t]=function(){return this._q.push({name:t,args:Array.prototype.slice.call(arguments,0)}),this}},i=function(e,t,r){return function(n){e._q.push({name:t,args:Array.prototype.slice.call(r,0),resolve:n})}},o=function(e,t,r){e[t]=function(){if(r)return{promise:new Promise(i(e,t,Array.prototype.slice.call(arguments)))}}},s=function(e){for(var t=0;t<v.length;t++)o(e,v[t],!1);for(var r=0;r<y.length;r++)o(e,y[r],!0)};r.invoked=!0;var u=t.getElementsByTagName("script")[0],a=t.createElement("script");a.src="https://cdn.amplitude.com/libs/plugin-autocapture-browser-0.9.0-min.js.gz",a.async=!1,u.parentNode.insertBefore(a,u);var c=t.createElement("script");c.type="text/javascript",c.integrity="sha384-Ag5J9qfXqjEfEr4ZgYYyRyytsut42EOm9b21f6k0xdhBxUPlRJhS6qzGBNgGTUnf",c.crossOrigin="anonymous",c.async=!1,c.src="https://cdn.amplitude.com/libs/analytics-browser-2.9.0-min.js.gz",c.onload=function(){e.amplitude.runQueuedFunctions||console.log("[Amplitude] Error: could not load SDK"),e.amplitude.init("YOUR_API_KEY","YOUR_USER_ID",{instanceName:"amplitude-bookmarklet",serverZone:"YOUR_SERVER_ZONE",ingestionMetadata:{sourceName:"browser-typescript-bookmarklet",sourceVersion:"1.0.0"},optOut:!1}),amplitudeAutocapturePlugin&&amplitudeAutocapturePlugin.autocapturePlugin&&"function"==typeof amplitudeAutocapturePlugin.autocapturePlugin&&e.amplitude.add(amplitudeAutocapturePlugin.autocapturePlugin()),alert("Amplitude is now tracking events!")},u.parentNode.insertBefore(c,u);for(var p=function(){return this._q=[],this},l=["add","append","clearAll","prepend","set","setOnce","unset","preInsert","postInsert","remove","getUserProperties"],d=0;d<l.length;d++)n(p,l[d]);r.Identify=p;for(var m=function(){return this._q=[],this},g=["getEventProperties","setProductId","setQuantity","setPrice","setRevenue","setRevenueType","setEventProperties"],f=0;f<g.length;f++)n(m,g[f]);r.Revenue=m;var v=["getDeviceId","setDeviceId","getSessionId","setSessionId","getUserId","setUserId","setOptOut","setTransport","reset","extendSession"],y=["init","add","remove","track","logEvent","identify","groupIdentify","setGroup","revenue","flush"];s(r),r.createInstance=function(e){return r._iq[e]={_q:[]},s(r._iq[e]),r._iq[e]},e.amplitude=r}}(window,document)}();

@@ -1,1 +0,1 @@

!function(){"use strict";!function(e,t){var r=e.amplitudeGTM||{_q:[],_iq:{}};if(r.invoked)e.console&&console.error&&console.error("Amplitude snippet has been loaded.");else{var n=function(e,t){e.prototype[t]=function(){return this._q.push({name:t,args:Array.prototype.slice.call(arguments,0)}),this}},s=function(e,t,r){return function(n){e._q.push({name:t,args:Array.prototype.slice.call(r,0),resolve:n})}},o=function(e,t,r){e._q.push({name:t,args:Array.prototype.slice.call(r,0)})},i=function(e,t,r){e[t]=function(){if(r)return{promise:new Promise(s(e,t,Array.prototype.slice.call(arguments)))};o(e,t,Array.prototype.slice.call(arguments))}},a=function(e){for(var t=0;t<y.length;t++)i(e,y[t],!1);for(var r=0;r<g.length;r++)i(e,g[r],!0)};r.invoked=!0;var c=t.createElement("script");c.type="text/javascript",c.integrity="sha384-eDok6/6H9kgHspp9YiBlZ5GpGB6hEhC7e5jjtQowkoiHJ3J84/ycC5289ba6CnS/",c.crossOrigin="anonymous",c.async=!0,c.src="https://cdn.amplitude.com/libs/analytics-browser-gtm-2.8.1-min.js.gz",c.onload=function(){e.amplitudeGTM.runQueuedFunctions||console.log("[Amplitude] Error: could not load SDK")};var u=t.getElementsByTagName("script")[0];u.parentNode.insertBefore(c,u);for(var p=function(){return this._q=[],this},l=["add","append","clearAll","prepend","set","setOnce","unset","preInsert","postInsert","remove","getUserProperties"],d=0;d<l.length;d++)n(p,l[d]);r.Identify=p;for(var f=function(){return this._q=[],this},m=["getEventProperties","setProductId","setQuantity","setPrice","setRevenue","setRevenueType","setEventProperties"],v=0;v<m.length;v++)n(f,m[v]);r.Revenue=f;var y=["getDeviceId","setDeviceId","getSessionId","setSessionId","getUserId","setUserId","setOptOut","setTransport","reset","extendSession"],g=["init","add","remove","track","logEvent","identify","groupIdentify","setGroup","revenue","flush"];a(r),r.createInstance=function(e){return r._iq[e]={_q:[]},a(r._iq[e]),r._iq[e]},e.amplitudeGTM=r,e.amplitude||(e.amplitude=e.amplitudeGTM)}}(window,document)}();
!function(){"use strict";!function(e,t){var r=e.amplitudeGTM||{_q:[],_iq:{}};if(r.invoked)e.console&&console.error&&console.error("Amplitude snippet has been loaded.");else{var n=function(e,t){e.prototype[t]=function(){return this._q.push({name:t,args:Array.prototype.slice.call(arguments,0)}),this}},s=function(e,t,r){return function(n){e._q.push({name:t,args:Array.prototype.slice.call(r,0),resolve:n})}},o=function(e,t,r){e._q.push({name:t,args:Array.prototype.slice.call(r,0)})},i=function(e,t,r){e[t]=function(){if(r)return{promise:new Promise(s(e,t,Array.prototype.slice.call(arguments)))};o(e,t,Array.prototype.slice.call(arguments))}},a=function(e){for(var t=0;t<v.length;t++)i(e,v[t],!1);for(var r=0;r<g.length;r++)i(e,g[r],!0)};r.invoked=!0;var u=t.createElement("script");u.type="text/javascript",u.integrity="sha384-9HsNgjJk02De4JrziAnJAuSZoL1qr0j/uknyPyatrUafItOPqYLWco4GQMMeZNyN",u.crossOrigin="anonymous",u.async=!0,u.src="https://cdn.amplitude.com/libs/analytics-browser-gtm-2.9.0-min.js.gz",u.onload=function(){e.amplitudeGTM.runQueuedFunctions||console.log("[Amplitude] Error: could not load SDK")};var c=t.getElementsByTagName("script")[0];c.parentNode.insertBefore(u,c);for(var l=function(){return this._q=[],this},p=["add","append","clearAll","prepend","set","setOnce","unset","preInsert","postInsert","remove","getUserProperties"],d=0;d<p.length;d++)n(l,p[d]);r.Identify=l;for(var f=function(){return this._q=[],this},y=["getEventProperties","setProductId","setQuantity","setPrice","setRevenue","setRevenueType","setEventProperties"],m=0;m<y.length;m++)n(f,y[m]);r.Revenue=f;var v=["getDeviceId","setDeviceId","getSessionId","setSessionId","getUserId","setUserId","setOptOut","setTransport","reset","extendSession"],g=["init","add","remove","track","logEvent","identify","groupIdentify","setGroup","revenue","flush"];a(r),r.createInstance=function(e){return r._iq[e]={_q:[]},a(r._iq[e]),r._iq[e]},e.amplitudeGTM=r,e.amplitude||(e.amplitude=e.amplitudeGTM)}}(window,document)}();

@@ -1,1 +0,1 @@

!function(){"use strict";!function(e,t){var r=e.amplitude||{_q:[],_iq:{}};if(r.invoked)e.console&&console.error&&console.error("Amplitude snippet has been loaded.");else{var n=function(e,t){e.prototype[t]=function(){return this._q.push({name:t,args:Array.prototype.slice.call(arguments,0)}),this}},s=function(e,t,r){return function(n){e._q.push({name:t,args:Array.prototype.slice.call(r,0),resolve:n})}},o=function(e,t,r){e._q.push({name:t,args:Array.prototype.slice.call(r,0)})},i=function(e,t,r){e[t]=function(){if(r)return{promise:new Promise(s(e,t,Array.prototype.slice.call(arguments)))};o(e,t,Array.prototype.slice.call(arguments))}},a=function(e){for(var t=0;t<g.length;t++)i(e,g[t],!1);for(var r=0;r<m.length;r++)i(e,m[r],!0)};r.invoked=!0;var c=t.createElement("script");c.type="text/javascript",c.integrity="sha384-7OMex1WYtzbDAdKl8HtBEJJB+8Yj6zAJRSeZhWCSQmjLGr4H2OBdrKtiw8HEhwgI",c.crossOrigin="anonymous",c.async=!0,c.src="https://cdn.amplitude.com/libs/analytics-browser-2.8.1-min.js.gz",c.onload=function(){e.amplitude.runQueuedFunctions||console.log("[Amplitude] Error: could not load SDK")};var u=t.getElementsByTagName("script")[0];u.parentNode.insertBefore(c,u);for(var l=function(){return this._q=[],this},p=["add","append","clearAll","prepend","set","setOnce","unset","preInsert","postInsert","remove","getUserProperties"],d=0;d<p.length;d++)n(l,p[d]);r.Identify=l;for(var f=function(){return this._q=[],this},v=["getEventProperties","setProductId","setQuantity","setPrice","setRevenue","setRevenueType","setEventProperties"],y=0;y<v.length;y++)n(f,v[y]);r.Revenue=f;var g=["getDeviceId","setDeviceId","getSessionId","setSessionId","getUserId","setUserId","setOptOut","setTransport","reset","extendSession"],m=["init","add","remove","track","logEvent","identify","groupIdentify","setGroup","revenue","flush"];a(r),r.createInstance=function(e){return r._iq[e]={_q:[]},a(r._iq[e]),r._iq[e]},e.amplitude=r}}(window,document)}();
!function(){"use strict";!function(e,t){var r=e.amplitude||{_q:[],_iq:{}};if(r.invoked)e.console&&console.error&&console.error("Amplitude snippet has been loaded.");else{var n=function(e,t){e.prototype[t]=function(){return this._q.push({name:t,args:Array.prototype.slice.call(arguments,0)}),this}},s=function(e,t,r){return function(n){e._q.push({name:t,args:Array.prototype.slice.call(r,0),resolve:n})}},o=function(e,t,r){e._q.push({name:t,args:Array.prototype.slice.call(r,0)})},i=function(e,t,r){e[t]=function(){if(r)return{promise:new Promise(s(e,t,Array.prototype.slice.call(arguments)))};o(e,t,Array.prototype.slice.call(arguments))}},a=function(e){for(var t=0;t<g.length;t++)i(e,g[t],!1);for(var r=0;r<m.length;r++)i(e,m[r],!0)};r.invoked=!0;var c=t.createElement("script");c.type="text/javascript",c.integrity="sha384-Ag5J9qfXqjEfEr4ZgYYyRyytsut42EOm9b21f6k0xdhBxUPlRJhS6qzGBNgGTUnf",c.crossOrigin="anonymous",c.async=!0,c.src="https://cdn.amplitude.com/libs/analytics-browser-2.9.0-min.js.gz",c.onload=function(){e.amplitude.runQueuedFunctions||console.log("[Amplitude] Error: could not load SDK")};var u=t.getElementsByTagName("script")[0];u.parentNode.insertBefore(c,u);for(var l=function(){return this._q=[],this},p=["add","append","clearAll","prepend","set","setOnce","unset","preInsert","postInsert","remove","getUserProperties"],d=0;d<p.length;d++)n(l,p[d]);r.Identify=l;for(var f=function(){return this._q=[],this},y=["getEventProperties","setProductId","setQuantity","setPrice","setRevenue","setRevenueType","setEventProperties"],v=0;v<y.length;v++)n(f,y[v]);r.Revenue=f;var g=["getDeviceId","setDeviceId","getSessionId","setSessionId","getUserId","setUserId","setOptOut","setTransport","reset","extendSession"],m=["init","add","remove","track","logEvent","identify","groupIdentify","setGroup","revenue","flush"];a(r),r.createInstance=function(e){return r._iq[e]={_q:[]},a(r._iq[e]),r._iq[e]},e.amplitude=r}}(window,document)}();

@@ -27,3 +27,4 @@ import { AmplitudeCore } from '@amplitude/analytics-core';

process(event: Event): Promise<Result>;
private logBrowserOptions;
}
//# sourceMappingURL=browser-client.d.ts.map

@@ -42,3 +42,4 @@ import { Event, BrowserOptions, BrowserConfig as IBrowserConfig, DefaultTrackingOptions, Storage, TrackingOptions, TransportType, UserSession, Logger as ILogger, LogLevel, Plan, IngestionMetadata, IdentityStorageType, ServerZoneType, OfflineDisabled } from '@amplitude/analytics-types';

protected _pageCounter?: number;
constructor(apiKey: string, appVersion?: string | undefined, cookieStorage?: Storage<UserSession>, cookieOptions?: CookieOptions, defaultTracking?: boolean | DefaultTrackingOptions | undefined, deviceId?: string, flushIntervalMillis?: number, flushMaxRetries?: number, flushQueueSize?: number, identityStorage?: IdentityStorageType, ingestionMetadata?: IngestionMetadata | undefined, instanceName?: string | undefined, lastEventId?: number, lastEventTime?: number, loggerProvider?: ILogger, logLevel?: LogLevel, minIdLength?: number | undefined, offline?: boolean | typeof OfflineDisabled, optOut?: boolean, partnerId?: string | undefined, plan?: Plan | undefined, serverUrl?: string, serverZone?: ServerZoneType, sessionId?: number, sessionTimeout?: number, storageProvider?: Storage<Event[]>, trackingOptions?: Required<TrackingOptions>, transport?: 'fetch' | 'xhr' | 'beacon', useBatch?: boolean, userId?: string, pageCounter?: number);
protected _debugLogsEnabled?: boolean;
constructor(apiKey: string, appVersion?: string | undefined, cookieStorage?: Storage<UserSession>, cookieOptions?: CookieOptions, defaultTracking?: boolean | DefaultTrackingOptions | undefined, deviceId?: string, flushIntervalMillis?: number, flushMaxRetries?: number, flushQueueSize?: number, identityStorage?: IdentityStorageType, ingestionMetadata?: IngestionMetadata | undefined, instanceName?: string | undefined, lastEventId?: number, lastEventTime?: number, loggerProvider?: ILogger, logLevel?: LogLevel, minIdLength?: number | undefined, offline?: boolean | typeof OfflineDisabled, optOut?: boolean, partnerId?: string | undefined, plan?: Plan | undefined, serverUrl?: string, serverZone?: ServerZoneType, sessionId?: number, sessionTimeout?: number, storageProvider?: Storage<Event[]>, trackingOptions?: Required<TrackingOptions>, transport?: 'fetch' | 'xhr' | 'beacon', useBatch?: boolean, userId?: string, pageCounter?: number, debugLogsEnabled?: boolean);
get cookieStorage(): Storage<UserSession>;

@@ -60,2 +61,3 @@ set cookieStorage(cookieStorage: Storage<UserSession>);

set pageCounter(pageCounter: number | undefined);
set debugLogsEnabled(debugLogsEnabled: boolean | undefined);
private updateStorage;

@@ -62,0 +64,0 @@ }

@@ -1,2 +0,2 @@

export declare const VERSION = "2.8.1";
export declare const VERSION = "2.9.0";
//# sourceMappingURL=version.d.ts.map
{
"name": "@amplitude/analytics-browser",
"version": "2.8.1",
"version": "2.9.0",
"description": "Official Amplitude SDK for Web",

@@ -37,3 +37,3 @@ "keywords": [

"playground:html": "cp lib/scripts/amplitude-min.js playground/html/amplitude.js && http-server ./playground/html",
"playground:react-spa": "cp lib/scripts/amplitude-min.js playground/react-spa/public/amplitude.js && cd ./playground/react-spa && yarn start",
"playground:react-spa": "cp lib/scripts/amplitude-min.js playground/react-spa/public/amplitude.js && cd ./playground/react-spa && yarn install && yarn start",
"publish": "node ../../scripts/publish/upload-to-s3.js",

@@ -49,6 +49,6 @@ "test": "jest",

"dependencies": {
"@amplitude/analytics-client-common": "^2.2.1",
"@amplitude/analytics-core": "^2.2.8",
"@amplitude/analytics-types": "^2.5.1",
"@amplitude/plugin-page-view-tracking-browser": "^2.2.13",
"@amplitude/analytics-client-common": "^2.2.2",
"@amplitude/analytics-core": "^2.3.0",
"@amplitude/analytics-types": "^2.6.0",
"@amplitude/plugin-page-view-tracking-browser": "^2.2.14",
"tslib": "^2.4.1"

@@ -71,3 +71,3 @@ },

],
"gitHead": "6100045c41af91694fbe03565e9620df2f556463"
"gitHead": "79b78f3a3c810012825defd513488bdf3390ac0c"
}

@@ -56,3 +56,3 @@ <p align="center">

<script type="text/javascript">
!function(){"use strict";!function(e,t){var r=e.amplitude||{_q:[],_iq:{}};if(r.invoked)e.console&&console.error&&console.error("Amplitude snippet has been loaded.");else{var n=function(e,t){e.prototype[t]=function(){return this._q.push({name:t,args:Array.prototype.slice.call(arguments,0)}),this}},s=function(e,t,r){return function(n){e._q.push({name:t,args:Array.prototype.slice.call(r,0),resolve:n})}},o=function(e,t,r){e._q.push({name:t,args:Array.prototype.slice.call(r,0)})},i=function(e,t,r){e[t]=function(){if(r)return{promise:new Promise(s(e,t,Array.prototype.slice.call(arguments)))};o(e,t,Array.prototype.slice.call(arguments))}},a=function(e){for(var t=0;t<g.length;t++)i(e,g[t],!1);for(var r=0;r<m.length;r++)i(e,m[r],!0)};r.invoked=!0;var c=t.createElement("script");c.type="text/javascript",c.integrity="sha384-7OMex1WYtzbDAdKl8HtBEJJB+8Yj6zAJRSeZhWCSQmjLGr4H2OBdrKtiw8HEhwgI",c.crossOrigin="anonymous",c.async=!0,c.src="https://cdn.amplitude.com/libs/analytics-browser-2.8.1-min.js.gz",c.onload=function(){e.amplitude.runQueuedFunctions||console.log("[Amplitude] Error: could not load SDK")};var u=t.getElementsByTagName("script")[0];u.parentNode.insertBefore(c,u);for(var l=function(){return this._q=[],this},p=["add","append","clearAll","prepend","set","setOnce","unset","preInsert","postInsert","remove","getUserProperties"],d=0;d<p.length;d++)n(l,p[d]);r.Identify=l;for(var f=function(){return this._q=[],this},v=["getEventProperties","setProductId","setQuantity","setPrice","setRevenue","setRevenueType","setEventProperties"],y=0;y<v.length;y++)n(f,v[y]);r.Revenue=f;var g=["getDeviceId","setDeviceId","getSessionId","setSessionId","getUserId","setUserId","setOptOut","setTransport","reset","extendSession"],m=["init","add","remove","track","logEvent","identify","groupIdentify","setGroup","revenue","flush"];a(r),r.createInstance=function(e){return r._iq[e]={_q:[]},a(r._iq[e]),r._iq[e]},e.amplitude=r}}(window,document)}();
!function(){"use strict";!function(e,t){var r=e.amplitude||{_q:[],_iq:{}};if(r.invoked)e.console&&console.error&&console.error("Amplitude snippet has been loaded.");else{var n=function(e,t){e.prototype[t]=function(){return this._q.push({name:t,args:Array.prototype.slice.call(arguments,0)}),this}},s=function(e,t,r){return function(n){e._q.push({name:t,args:Array.prototype.slice.call(r,0),resolve:n})}},o=function(e,t,r){e._q.push({name:t,args:Array.prototype.slice.call(r,0)})},i=function(e,t,r){e[t]=function(){if(r)return{promise:new Promise(s(e,t,Array.prototype.slice.call(arguments)))};o(e,t,Array.prototype.slice.call(arguments))}},a=function(e){for(var t=0;t<g.length;t++)i(e,g[t],!1);for(var r=0;r<m.length;r++)i(e,m[r],!0)};r.invoked=!0;var c=t.createElement("script");c.type="text/javascript",c.integrity="sha384-Ag5J9qfXqjEfEr4ZgYYyRyytsut42EOm9b21f6k0xdhBxUPlRJhS6qzGBNgGTUnf",c.crossOrigin="anonymous",c.async=!0,c.src="https://cdn.amplitude.com/libs/analytics-browser-2.9.0-min.js.gz",c.onload=function(){e.amplitude.runQueuedFunctions||console.log("[Amplitude] Error: could not load SDK")};var u=t.getElementsByTagName("script")[0];u.parentNode.insertBefore(c,u);for(var l=function(){return this._q=[],this},p=["add","append","clearAll","prepend","set","setOnce","unset","preInsert","postInsert","remove","getUserProperties"],d=0;d<p.length;d++)n(l,p[d]);r.Identify=l;for(var f=function(){return this._q=[],this},y=["getEventProperties","setProductId","setQuantity","setPrice","setRevenue","setRevenueType","setEventProperties"],v=0;v<y.length;v++)n(f,y[v]);r.Revenue=f;var g=["getDeviceId","setDeviceId","getSessionId","setSessionId","getUserId","setUserId","setOptOut","setTransport","reset","extendSession"],m=["init","add","remove","track","logEvent","identify","groupIdentify","setGroup","revenue","flush"];a(r),r.createInstance=function(e){return r._iq[e]={_q:[]},a(r._iq[e]),r._iq[e]},e.amplitude=r}}(window,document)}();

@@ -59,0 +59,0 @@ amplitude.init("<YOUR_API_KEY>");

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc