@amplitude/analytics-core 2.40.1 → 2.41.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.
Files changed (75) hide show
  1. package/lib/cjs/index.d.ts +2 -0
  2. package/lib/cjs/index.d.ts.map +1 -1
  3. package/lib/cjs/index.js +8 -2
  4. package/lib/cjs/index.js.map +1 -1
  5. package/lib/cjs/plugins/destination.d.ts.map +1 -1
  6. package/lib/cjs/plugins/destination.js +16 -2
  7. package/lib/cjs/plugins/destination.js.map +1 -1
  8. package/lib/cjs/storage/cookie.d.ts.map +1 -1
  9. package/lib/cjs/storage/cookie.js +35 -13
  10. package/lib/cjs/storage/cookie.js.map +1 -1
  11. package/lib/cjs/transports/base.d.ts +1 -1
  12. package/lib/cjs/transports/base.d.ts.map +1 -1
  13. package/lib/cjs/transports/base.js +1 -1
  14. package/lib/cjs/transports/base.js.map +1 -1
  15. package/lib/cjs/transports/gzip.d.ts +12 -0
  16. package/lib/cjs/transports/gzip.d.ts.map +1 -0
  17. package/lib/cjs/transports/gzip.js +43 -0
  18. package/lib/cjs/transports/gzip.js.map +1 -0
  19. package/lib/cjs/types/client/browser-client.d.ts +6 -0
  20. package/lib/cjs/types/client/browser-client.d.ts.map +1 -1
  21. package/lib/cjs/types/client/browser-client.js.map +1 -1
  22. package/lib/cjs/types/config/browser-config.d.ts +18 -1
  23. package/lib/cjs/types/config/browser-config.d.ts.map +1 -1
  24. package/lib/cjs/types/config/browser-config.js +5 -0
  25. package/lib/cjs/types/config/browser-config.js.map +1 -1
  26. package/lib/cjs/types/config/core-config.d.ts +16 -0
  27. package/lib/cjs/types/config/core-config.d.ts.map +1 -1
  28. package/lib/cjs/types/config/core-config.js.map +1 -1
  29. package/lib/cjs/types/config/node-config.d.ts +1 -1
  30. package/lib/cjs/types/config/node-config.d.ts.map +1 -1
  31. package/lib/cjs/types/config/node-config.js.map +1 -1
  32. package/lib/cjs/types/config/react-native-config.d.ts +1 -1
  33. package/lib/cjs/types/config/react-native-config.d.ts.map +1 -1
  34. package/lib/cjs/types/config/react-native-config.js.map +1 -1
  35. package/lib/cjs/types/transport.d.ts +1 -1
  36. package/lib/cjs/types/transport.d.ts.map +1 -1
  37. package/lib/cjs/types/transport.js.map +1 -1
  38. package/lib/esm/index.d.ts +2 -0
  39. package/lib/esm/index.d.ts.map +1 -1
  40. package/lib/esm/index.js +2 -0
  41. package/lib/esm/index.js.map +1 -1
  42. package/lib/esm/plugins/destination.d.ts.map +1 -1
  43. package/lib/esm/plugins/destination.js +17 -3
  44. package/lib/esm/plugins/destination.js.map +1 -1
  45. package/lib/esm/storage/cookie.d.ts.map +1 -1
  46. package/lib/esm/storage/cookie.js +35 -13
  47. package/lib/esm/storage/cookie.js.map +1 -1
  48. package/lib/esm/transports/base.d.ts +1 -1
  49. package/lib/esm/transports/base.d.ts.map +1 -1
  50. package/lib/esm/transports/base.js +1 -1
  51. package/lib/esm/transports/base.js.map +1 -1
  52. package/lib/esm/transports/gzip.d.ts +12 -0
  53. package/lib/esm/transports/gzip.d.ts.map +1 -0
  54. package/lib/esm/transports/gzip.js +38 -0
  55. package/lib/esm/transports/gzip.js.map +1 -0
  56. package/lib/esm/types/client/browser-client.d.ts +6 -0
  57. package/lib/esm/types/client/browser-client.d.ts.map +1 -1
  58. package/lib/esm/types/client/browser-client.js.map +1 -1
  59. package/lib/esm/types/config/browser-config.d.ts +18 -1
  60. package/lib/esm/types/config/browser-config.d.ts.map +1 -1
  61. package/lib/esm/types/config/browser-config.js +4 -1
  62. package/lib/esm/types/config/browser-config.js.map +1 -1
  63. package/lib/esm/types/config/core-config.d.ts +16 -0
  64. package/lib/esm/types/config/core-config.d.ts.map +1 -1
  65. package/lib/esm/types/config/core-config.js.map +1 -1
  66. package/lib/esm/types/config/node-config.d.ts +1 -1
  67. package/lib/esm/types/config/node-config.d.ts.map +1 -1
  68. package/lib/esm/types/config/node-config.js.map +1 -1
  69. package/lib/esm/types/config/react-native-config.d.ts +1 -1
  70. package/lib/esm/types/config/react-native-config.d.ts.map +1 -1
  71. package/lib/esm/types/config/react-native-config.js.map +1 -1
  72. package/lib/esm/types/transport.d.ts +1 -1
  73. package/lib/esm/types/transport.d.ts.map +1 -1
  74. package/lib/esm/types/transport.js.map +1 -1
  75. package/package.json +1 -1
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.compressToGzipArrayBuffer = exports.isCompressionStreamAvailable = exports.MIN_GZIP_UPLOAD_BODY_SIZE_BYTES = void 0;
4
+ var tslib_1 = require("tslib");
5
+ exports.MIN_GZIP_UPLOAD_BODY_SIZE_BYTES = 2 * 1024;
6
+ /**
7
+ * Returns true if CompressionStream is available (e.g. in supported browsers).
8
+ */
9
+ function isCompressionStreamAvailable() {
10
+ return typeof CompressionStream !== 'undefined';
11
+ }
12
+ exports.isCompressionStreamAvailable = isCompressionStreamAvailable;
13
+ /**
14
+ * Compress a string to gzip and return the result as an ArrayBuffer.
15
+ * Best-effort: returns undefined if CompressionStream is unavailable or compression fails.
16
+ * Payload is small so buffering is fine. Used by Fetch and XHR transports.
17
+ */
18
+ function compressToGzipArrayBuffer(data) {
19
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
20
+ var CompressionStreamImpl, stream, _a;
21
+ return tslib_1.__generator(this, function (_b) {
22
+ switch (_b.label) {
23
+ case 0:
24
+ CompressionStreamImpl = CompressionStream;
25
+ if (typeof CompressionStreamImpl === 'undefined') {
26
+ return [2 /*return*/, undefined];
27
+ }
28
+ _b.label = 1;
29
+ case 1:
30
+ _b.trys.push([1, 3, , 4]);
31
+ stream = new Blob([data]).stream().pipeThrough(new CompressionStreamImpl('gzip'));
32
+ return [4 /*yield*/, new Response(stream).arrayBuffer()];
33
+ case 2: return [2 /*return*/, _b.sent()];
34
+ case 3:
35
+ _a = _b.sent();
36
+ return [2 /*return*/, undefined];
37
+ case 4: return [2 /*return*/];
38
+ }
39
+ });
40
+ });
41
+ }
42
+ exports.compressToGzipArrayBuffer = compressToGzipArrayBuffer;
43
+ //# sourceMappingURL=gzip.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gzip.js","sourceRoot":"","sources":["../../../src/transports/gzip.ts"],"names":[],"mappings":";;;;AAOa,QAAA,+BAA+B,GAAG,CAAC,GAAG,IAAI,CAAC;AAExD;;GAEG;AACH,SAAgB,4BAA4B;IAC1C,OAAO,OAAO,iBAAiB,KAAK,WAAW,CAAC;AAClD,CAAC;AAFD,oEAEC;AAED;;;;GAIG;AACH,SAAsB,yBAAyB,CAAC,IAAY;;;;;;oBACpD,qBAAqB,GAAG,iBAAiB,CAAC;oBAChD,IAAI,OAAO,qBAAqB,KAAK,WAAW,EAAE;wBAChD,sBAAO,SAAS,EAAC;qBAClB;;;;oBAEO,MAAM,GAAG,IAAI,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,WAAW,CAAC,IAAI,qBAAqB,CAAC,MAAM,CAAC,CAAC,CAAC;oBACjF,qBAAM,IAAI,QAAQ,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,EAAA;wBAA/C,sBAAO,SAAwC,EAAC;;;oBAEhD,sBAAO,SAAS,EAAC;;;;;CAEpB;AAXD,8DAWC","sourcesContent":["// CompressionStream is a Web API not included in TypeScript's dom/es6 libs.\ndeclare const CompressionStream:\n | {\n new (format: string): { readable: ReadableStream; writable: WritableStream };\n }\n | undefined;\n\nexport const MIN_GZIP_UPLOAD_BODY_SIZE_BYTES = 2 * 1024;\n\n/**\n * Returns true if CompressionStream is available (e.g. in supported browsers).\n */\nexport function isCompressionStreamAvailable(): boolean {\n return typeof CompressionStream !== 'undefined';\n}\n\n/**\n * Compress a string to gzip and return the result as an ArrayBuffer.\n * Best-effort: returns undefined if CompressionStream is unavailable or compression fails.\n * Payload is small so buffering is fine. Used by Fetch and XHR transports.\n */\nexport async function compressToGzipArrayBuffer(data: string): Promise<ArrayBuffer | undefined> {\n const CompressionStreamImpl = CompressionStream;\n if (typeof CompressionStreamImpl === 'undefined') {\n return undefined;\n }\n try {\n const stream = new Blob([data]).stream().pipeThrough(new CompressionStreamImpl('gzip'));\n return await new Response(stream).arrayBuffer();\n } catch {\n return undefined;\n }\n}\n"]}
@@ -108,5 +108,11 @@ export interface BrowserClient extends Client {
108
108
  * @param sampleRate - The sample rate to set
109
109
  */
110
110
  _setDiagnosticsSampleRate(sampleRate: number): void;
111
+ /**
112
+ * @experimental
113
+ * WARNING: This method is for internal testing only and is not part of the public API.
114
+ * It may be changed or removed at any time without notice.
115
+ */
116
+ _enableRequestBodyCompressionExperimental(enabled: boolean): void;
111
117
  }
112
118
  //# sourceMappingURL=browser-client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"browser-client.d.ts","sourceRoot":"","sources":["../../../../src/types/client/browser-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAEzE,MAAM,WAAW,aAAc,SAAQ,MAAM;IAC3C;;;;;;;OAOG;IACH,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC;IAEtE,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC;IAEvF;;;;;;;;;;;;;;;;OAgBG;IACH,YAAY,CAAC,SAAS,EAAE,sBAAsB,GAAG,IAAI,CAAC;IAEtD;;;;;;;;;;;;;;;;OAgBG;IACH,GAAG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,aAAa,CAAC,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC;IAEzE;;;;;;OAMG;IACH,WAAW,IAAI,iBAAiB,CAAC;IAEjC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+BG;IACH,WAAW,CAAC,QAAQ,EAAE,OAAO,CAAC,iBAAiB,CAAC,GAAG,IAAI,CAAC;IAExD;;;;;;OAMG;IACH,SAAS,IAAI,OAAO,GAAG,SAAS,CAAC;IAEjC;;;;;;;OAOG;IACH,yBAAyB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAEpD;;;;OAIG;IACH,yCAAyC,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;CACnE"}
@@ -1 +1 @@
1
- {"version":3,"file":"browser-client.js","sourceRoot":"","sources":["../../../../src/types/client/browser-client.ts"],"names":[],"mappings":"","sourcesContent":["import { TransportTypeOrOptions } from '../transport';\nimport { Client } from './core-client';\nimport { AnalyticsIdentity, Plugin } from '../plugin';\nimport { AmplitudeReturn } from '../../utils/return-wrapper';\nimport { BrowserConfig, BrowserOptions } from '../config/browser-config';\n\nexport interface BrowserClient extends Client {\n /**\n * Initializes the Amplitude SDK with your apiKey, optional configurations.\n * This method must be called before any other operations.\n *\n * ```typescript\n * await init(API_KEY, options).promise;\n * ```\n */\n init(apiKey: string, options?: BrowserOptions): AmplitudeReturn<void>;\n\n init(apiKey: string, userId?: string, options?: BrowserOptions): AmplitudeReturn<void>;\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 * // Use Fetch API with custom headers\n * setTransport({ type: 'fetch', headers: { 'X-Custom-Header': 'value' } });\n * ```\n */\n setTransport(transport: TransportTypeOrOptions): void;\n\n /**\n * Adds a new plugin.\n *\n * ```typescript\n * const plugin = {\n * name: 'my-plugin',\n * type: 'enrichment',\n * async setup(config: BrowserConfig, amplitude: BrowserClient) {\n * return;\n * },\n * async execute(event: Event) {\n * return event;\n * },\n * };\n * amplitude.add(plugin);\n * ```\n */\n add(plugin: Plugin<BrowserClient, BrowserConfig>): AmplitudeReturn<void>;\n\n /**\n * Returns the current identity.\n *\n * ```typescript\n * const identity = getIdentity();\n * ```\n */\n getIdentity(): AnalyticsIdentity;\n\n /**\n * Sets the identity (userId, deviceId, and/or userProperties).\n * This is a unified shortcut for `setUserId()`, `setDeviceId()`, and setting user properties.\n * When userProperties change, an identify event is automatically sent.\n *\n * **Important limitation:** When userProperties are replaced, the local state is fully replaced\n * but the identify event sent to the server only includes `$set` operations for the new properties.\n * Properties removed from the local state are **not** `$unset` on the server.\n *\n * For example, changing from `{plan: 'premium', theme: 'dark'}` to `{plan: 'basic'}` removes\n * `theme` locally but leaves it on the server. To remove a property from the server, use\n * `identify()` with `Identify.unset()` directly.\n *\n * ```typescript\n * // Set user properties (auto-sends identify event with $set)\n * setIdentity({ userProperties: { plan: 'premium' } });\n *\n * // Set userId (equivalent to setUserId('user-123'))\n * setIdentity({ userId: 'user-123' });\n *\n * // Set deviceId (equivalent to setDeviceId('device-456'))\n * setIdentity({ deviceId: 'device-456' });\n *\n * // Set multiple identity fields together\n * setIdentity({ userId: 'user-123', deviceId: 'device-456', userProperties: { name: 'John' } });\n *\n * // To remove a property from the server, use identify() directly:\n * const identify = new Identify();\n * identify.unset('theme');\n * amplitude.identify(identify);\n * ```\n */\n setIdentity(identity: Partial<AnalyticsIdentity>): void;\n\n /**\n * Returns the current optOut config value.\n *\n * ```typescript\n * const optOut = getOptOut();\n * ```\n */\n getOptOut(): boolean | undefined;\n\n /**\n * @experimental\n * WARNING: This method is for internal testing only and is not part of the public API.\n * It may be changed or removed at any time without notice.\n *\n * Sets the diagnostics sample rate before amplitude.init()\n * @param sampleRate - The sample rate to set\n */\n _setDiagnosticsSampleRate(sampleRate: number): void;\n}\n"]}
1
+ {"version":3,"file":"browser-client.js","sourceRoot":"","sources":["../../../../src/types/client/browser-client.ts"],"names":[],"mappings":"","sourcesContent":["import { TransportTypeOrOptions } from '../transport';\nimport { Client } from './core-client';\nimport { AnalyticsIdentity, Plugin } from '../plugin';\nimport { AmplitudeReturn } from '../../utils/return-wrapper';\nimport { BrowserConfig, BrowserOptions } from '../config/browser-config';\n\nexport interface BrowserClient extends Client {\n /**\n * Initializes the Amplitude SDK with your apiKey, optional configurations.\n * This method must be called before any other operations.\n *\n * ```typescript\n * await init(API_KEY, options).promise;\n * ```\n */\n init(apiKey: string, options?: BrowserOptions): AmplitudeReturn<void>;\n\n init(apiKey: string, userId?: string, options?: BrowserOptions): AmplitudeReturn<void>;\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 * // Use Fetch API with custom headers\n * setTransport({ type: 'fetch', headers: { 'X-Custom-Header': 'value' } });\n * ```\n */\n setTransport(transport: TransportTypeOrOptions): void;\n\n /**\n * Adds a new plugin.\n *\n * ```typescript\n * const plugin = {\n * name: 'my-plugin',\n * type: 'enrichment',\n * async setup(config: BrowserConfig, amplitude: BrowserClient) {\n * return;\n * },\n * async execute(event: Event) {\n * return event;\n * },\n * };\n * amplitude.add(plugin);\n * ```\n */\n add(plugin: Plugin<BrowserClient, BrowserConfig>): AmplitudeReturn<void>;\n\n /**\n * Returns the current identity.\n *\n * ```typescript\n * const identity = getIdentity();\n * ```\n */\n getIdentity(): AnalyticsIdentity;\n\n /**\n * Sets the identity (userId, deviceId, and/or userProperties).\n * This is a unified shortcut for `setUserId()`, `setDeviceId()`, and setting user properties.\n * When userProperties change, an identify event is automatically sent.\n *\n * **Important limitation:** When userProperties are replaced, the local state is fully replaced\n * but the identify event sent to the server only includes `$set` operations for the new properties.\n * Properties removed from the local state are **not** `$unset` on the server.\n *\n * For example, changing from `{plan: 'premium', theme: 'dark'}` to `{plan: 'basic'}` removes\n * `theme` locally but leaves it on the server. To remove a property from the server, use\n * `identify()` with `Identify.unset()` directly.\n *\n * ```typescript\n * // Set user properties (auto-sends identify event with $set)\n * setIdentity({ userProperties: { plan: 'premium' } });\n *\n * // Set userId (equivalent to setUserId('user-123'))\n * setIdentity({ userId: 'user-123' });\n *\n * // Set deviceId (equivalent to setDeviceId('device-456'))\n * setIdentity({ deviceId: 'device-456' });\n *\n * // Set multiple identity fields together\n * setIdentity({ userId: 'user-123', deviceId: 'device-456', userProperties: { name: 'John' } });\n *\n * // To remove a property from the server, use identify() directly:\n * const identify = new Identify();\n * identify.unset('theme');\n * amplitude.identify(identify);\n * ```\n */\n setIdentity(identity: Partial<AnalyticsIdentity>): void;\n\n /**\n * Returns the current optOut config value.\n *\n * ```typescript\n * const optOut = getOptOut();\n * ```\n */\n getOptOut(): boolean | undefined;\n\n /**\n * @experimental\n * WARNING: This method is for internal testing only and is not part of the public API.\n * It may be changed or removed at any time without notice.\n *\n * Sets the diagnostics sample rate before amplitude.init()\n * @param sampleRate - The sample rate to set\n */\n _setDiagnosticsSampleRate(sampleRate: number): void;\n\n /**\n * @experimental\n * WARNING: This method is for internal testing only and is not part of the public API.\n * It may be changed or removed at any time without notice.\n */\n _enableRequestBodyCompressionExperimental(enabled: boolean): void;\n}\n"]}
@@ -113,6 +113,8 @@ interface InternalBrowserConfig {
113
113
  diagnosticsClient?: IDiagnosticsClient;
114
114
  remoteConfigClient?: IRemoteConfigClient;
115
115
  deferredSessionId?: number;
116
+ topLevelDomain?: string;
117
+ _enableRequestBodyCompressionExperimental?: boolean;
116
118
  }
117
119
  /**
118
120
  * @deprecated This interface is deprecated and will be removed in future versions. Please migrate to using `AutocaptureOptions` instead.
@@ -220,6 +222,13 @@ export interface AttributionOptions {
220
222
  * @defaultValue `[/your-domain\.com$/]`
221
223
  */
222
224
  excludeReferrers?: (string | RegExp)[];
225
+ /**
226
+ * Exclude internal referrers from campaign attribution.
227
+ * (a referrer is 'internal' if it is on the same domain as the current page)
228
+ * @experimental this feature is experimental and may not be stable
229
+ * @defaultValue `false`
230
+ */
231
+ excludeInternalReferrers?: true | false | ExcludeInternalReferrersOptions;
223
232
  /**
224
233
  * The value to represent undefined/no initial campaign parameter for first-touch attribution.
225
234
  * @defaultValue `"EMPTY"`
@@ -231,6 +240,14 @@ export interface AttributionOptions {
231
240
  */
232
241
  resetSessionOnNewCampaign?: boolean;
233
242
  }
243
+ export declare const EXCLUDE_INTERNAL_REFERRERS_CONDITIONS: {
244
+ readonly always: "always";
245
+ readonly ifEmptyCampaign: "ifEmptyCampaign";
246
+ };
247
+ type ExcludeInternalReferrersCondition = (typeof EXCLUDE_INTERNAL_REFERRERS_CONDITIONS)[keyof typeof EXCLUDE_INTERNAL_REFERRERS_CONDITIONS];
248
+ export interface ExcludeInternalReferrersOptions {
249
+ condition?: ExcludeInternalReferrersCondition;
250
+ }
234
251
  export interface RemoteConfigOptions {
235
252
  /**
236
253
  * Whether to fetch remote configuration. The remote configuration can be updated in the Amplitude platform here:
@@ -273,7 +290,7 @@ export interface CookieOptions {
273
290
  */
274
291
  upgrade?: boolean;
275
292
  }
276
- type HiddenOptions = 'apiKey' | 'transportProvider' | 'requestMetadata';
293
+ type HiddenOptions = 'apiKey' | 'transportProvider' | 'requestMetadata' | '_enableRequestBodyCompressionExperimental';
277
294
  export interface BrowserOptions extends Omit<Partial<ExternalBrowserConfig>, HiddenOptions> {
278
295
  }
279
296
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"browser-config.d.ts","sourceRoot":"","sources":["../../../../src/types/config/browser-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;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M,OAAO,qCAAqC,CAAC,CAAC;AAErG,MAAM,WAAW,+BAA+B;IAK9C,SAAS,CAAC,EAAE,iCAAiC,CAAC;CAC/C;AAED,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,aAAa;IAC5B;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,QAAQ,CAAC,EAAE,QAAQ,GAAG,KAAK,GAAG,MAAM,CAAC;IACrC;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,KAAK,aAAa,GAAG,QAAQ,GAAG,mBAAmB,GAAG,iBAAiB,GAAG,2CAA2C,CAAC;AAGtH,MAAM,WAAW,cAAe,SAAQ,IAAI,CAAC,OAAO,CAAC,qBAAqB,CAAC,EAAE,aAAa,CAAC;CAAG"}
@@ -1,3 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EXCLUDE_INTERNAL_REFERRERS_CONDITIONS = void 0;
4
+ exports.EXCLUDE_INTERNAL_REFERRERS_CONDITIONS = {
5
+ always: 'always',
6
+ ifEmptyCampaign: 'ifEmptyCampaign',
7
+ };
3
8
  //# sourceMappingURL=browser-config.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"browser-config.js","sourceRoot":"","sources":["../../../../src/types/config/browser-config.ts"],"names":[],"mappings":"","sourcesContent":["import { UserSession } from '../user-session';\nimport { IdentityStorageType, Storage } from '../storage';\nimport { Transport, TransportTypeOrOptions } from '../transport';\nimport { IConfig } from './core-config';\nimport { ElementInteractionsOptions } from '../element-interactions';\nimport { FormInteractionsOptions } from '../form-interactions';\nimport { PageTrackingOptions } from '../page-view-tracking';\nimport { NetworkTrackingOptions } from '../network-tracking';\nimport { FrustrationInteractionsOptions } from '../frustration-interactions';\nimport { IDiagnosticsClient } from '../../diagnostics/diagnostics-client';\nimport { IRemoteConfigClient } from '../../remote-config/remote-config';\n\nexport interface BrowserConfig extends ExternalBrowserConfig, InternalBrowserConfig {}\n\nexport interface ExternalBrowserConfig extends IConfig {\n /**\n * An app version for events tracked. This can be the version of your application.\n * @defaultValue `undefined`\n */\n appVersion?: string;\n /**\n * @deprecated This property is deprecated and will be removed in future versions. Please migrate to using `autocapture` instead.\n * The default event tracking configuration.\n * See {@link https://www.docs.developers.amplitude.com/data/sdks/browser-2/#tracking-default-events}.\n * @defaultValue `true`\n */\n defaultTracking?: boolean | DefaultTrackingOptions;\n /**\n * The configurations for auto-captured events.\n * See {@link https://www.docs.developers.amplitude.com/data/sdks/browser-2/autocapture/}.\n */\n autocapture?: boolean | AutocaptureOptions;\n /**\n * The identifier for the device running your application.\n * @defaultValue `UUID()`\n */\n deviceId?: string;\n /**\n * Configuration for cookie.\n */\n cookieOptions?: CookieOptions;\n /**\n * The storage for user identify.\n * @defaultValue `\"cookie\"`\n */\n identityStorage?: IdentityStorageType;\n /**\n * The partner identifier.\n * Amplitude requires the customer who built an event ingestion integration to add the partner identifier to partner_id.\n * @defaultValue `undefined`\n */\n partnerId?: string;\n /**\n * The custom Session ID for the current session.\n * @defaultValue `timestamp`\n */\n sessionId?: number;\n /**\n * The period of inactivity from the last tracked event before a session expires in milliseconds.\n * @defaultValue `1,800,000` (30 minutes)\n */\n sessionTimeout: number;\n /**\n * The configurations for tracking additional properties.\n * See {@link https://www.docs.developers.amplitude.com/data/sdks/browser-2/#optional-tracking}.\n */\n trackingOptions: TrackingOptions;\n /**\n * Network transport mechanism used to send events.\n * @defaultValue `\"fetch\"`\n */\n transport?: TransportTypeOrOptions;\n /**\n * The identifier for the user being tracked.\n * @defaultValue `undefined`\n */\n userId?: string;\n /**\n * User's Nth instance of performing a default Page Viewed event within a session.\n * Used for landing page analysis.\n */\n pageCounter?: number;\n /**\n * Whether to fetch remote configuration. The remote configuration can be updated in the Amplitude platform here:\n * https://app.amplitude.com/data/amplitude/{your_org_name}/settings/autocapture\n * @defaultValue `true`\n * @deprecated This property is deprecated and will be removed in future versions. Please use `remoteConfig.fetchRemoteConfig` instead.\n */\n fetchRemoteConfig?: boolean;\n /**\n * Remote configuration options.\n * @defaultValue `undefined`\n */\n remoteConfig?: RemoteConfigOptions;\n /**\n * Captures network requests and responses.\n * @defaultValue `undefined`\n * @deprecated use autocapture.networkTracking instead\n */\n networkTrackingOptions?: NetworkTrackingOptions;\n /**\n * Whether to enable diagnostics.\n * @defaultValue `true`\n */\n enableDiagnostics?: boolean;\n}\n\ninterface InternalBrowserConfig {\n cookieStorage: Storage<UserSession>;\n lastEventTime?: number;\n lastEventId?: number;\n transportProvider: Transport;\n version?: string;\n diagnosticsSampleRate?: number;\n diagnosticsClient?: IDiagnosticsClient;\n remoteConfigClient?: IRemoteConfigClient;\n deferredSessionId?: number;\n}\n\n/**\n * @deprecated This interface is deprecated and will be removed in future versions. Please migrate to using `AutocaptureOptions` instead.\n */\nexport interface DefaultTrackingOptions {\n /**\n * Enables/disables marketing attribution tracking or config with detailed attribution options.\n * @defaultValue `true`\n */\n attribution?: boolean | AttributionOptions;\n /**\n * Enables/disables form downloads tracking.\n * @defaultValue `true`\n */\n fileDownloads?: boolean;\n /**\n * Enables/disables form interaction tracking or configures with detailed options.\n * @defaultValue `true`\n */\n formInteractions?: boolean | FormInteractionsOptions;\n /**\n * Enables/disables default page view tracking.\n * @defaultValue `true`\n */\n pageViews?: boolean | PageTrackingOptions;\n /**\n * Enables/disables session tracking.\n * @defaultValue `true`\n */\n sessions?: boolean;\n}\n\nexport interface AutocaptureOptions {\n /**\n * Enables/disables marketing attribution tracking or config with detailed attribution options.\n * @defaultValue `true`\n */\n attribution?: boolean | AttributionOptions;\n /**\n * Enables/disables form downloads tracking.\n * @defaultValue `true`\n */\n fileDownloads?: boolean;\n /**\n * Enables/disables form interaction tracking or configures with detailed options.\n * @defaultValue `true`\n */\n formInteractions?: boolean | FormInteractionsOptions;\n /**\n * Enables/disables default page view tracking.\n * @defaultValue `true`\n */\n pageViews?: boolean | PageTrackingOptions;\n /**\n * Enables/disables session tracking.\n * @defaultValue `true`\n */\n sessions?: boolean;\n /**\n * Enables/disables user interactions tracking.\n * @defaultValue `false`\n */\n elementInteractions?: boolean | ElementInteractionsOptions;\n /**\n * Enables/disables frustration interactions tracking.\n * @defaultValue `false`\n */\n frustrationInteractions?: boolean | FrustrationInteractionsOptions;\n /**\n * Enables/disables network request tracking or config with detailed network tracking options.\n * @defaultValue `false`\n */\n networkTracking?: boolean | NetworkTrackingOptions;\n /**\n * Enables/disables web vitals tracking.\n * @defaultValue `false`\n */\n webVitals?: boolean;\n /**\n * Enables/disables page url enrichment.\n * @defaultValue `true`\n * @experimental This feature is experimental and may not be stable\n */\n pageUrlEnrichment?: boolean;\n}\n\nexport interface TrackingOptions {\n /**\n * Enables/disables ip address tracking.\n * @defaultValue `true`\n */\n ipAddress?: boolean;\n /**\n * Enables/disables language tracking.\n * @defaultValue `true`\n */\n language?: boolean;\n /**\n * Enables/disables plantform tracking.\n * @defaultValue `true`\n */\n platform?: boolean;\n}\n\nexport interface AttributionOptions {\n /**\n * The rules to determine which referrers are excluded from being tracked as traffic source.\n * @defaultValue `[/your-domain\\.com$/]`\n */\n excludeReferrers?: (string | RegExp)[];\n /**\n * The value to represent undefined/no initial campaign parameter for first-touch attribution.\n * @defaultValue `\"EMPTY\"`\n */\n initialEmptyValue?: string;\n /**\n * The flag of if Amplitude to start a new session if any campaign parameter changes.\n * @defaultValue `false`\n */\n resetSessionOnNewCampaign?: boolean;\n}\n\nexport interface RemoteConfigOptions {\n /**\n * Whether to fetch remote configuration. The remote configuration can be updated in the Amplitude platform here:\n * https://app.amplitude.com/data/amplitude/{your_org_name}/settings/autocapture\n * @defaultValue `true`\n */\n fetchRemoteConfig?: boolean;\n /**\n * Custom server URL for remote configuration requests. If not provided, defaults to the standard\n * Amplitude remote config endpoint based on serverZone (US or EU).\n * Use this to proxy remote config requests through your own server.\n * @defaultValue `undefined` (uses standard Amplitude remote config endpoint)\n */\n serverUrl?: string;\n}\n\nexport interface CookieOptions {\n /**\n * The domain property of cookies created.\n * @defaultValue `Your top level domain`\n */\n domain?: string;\n /**\n * The expiration of cookies created in days.\n * @defaultValue `365`\n */\n expiration?: number;\n /**\n * How cookies are sent with cross-site requests.\n * @defaultValue `\"Lax\"`\n */\n sameSite?: 'Strict' | 'Lax' | 'None';\n /**\n * The flag of if send cookies over secure protocols.\n * @defaultValue `false`\n */\n secure?: boolean;\n /**\n * The flag of if upgrade the cookies created by maintenance Browser SDK.\n * @defaultValue `true`\n */\n upgrade?: boolean;\n}\n\ntype HiddenOptions = 'apiKey' | 'transportProvider' | 'requestMetadata';\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface BrowserOptions extends Omit<Partial<ExternalBrowserConfig>, HiddenOptions> {}\n"]}
1
+ {"version":3,"file":"browser-config.js","sourceRoot":"","sources":["../../../../src/types/config/browser-config.ts"],"names":[],"mappings":";;;AAyPa,QAAA,qCAAqC,GAAG;IACnD,MAAM,EAAE,QAAQ;IAChB,eAAe,EAAE,iBAAiB;CAC1B,CAAC","sourcesContent":["import { UserSession } from '../user-session';\nimport { IdentityStorageType, Storage } from '../storage';\nimport { Transport, TransportTypeOrOptions } from '../transport';\nimport { IConfig } from './core-config';\nimport { ElementInteractionsOptions } from '../element-interactions';\nimport { FormInteractionsOptions } from '../form-interactions';\nimport { PageTrackingOptions } from '../page-view-tracking';\nimport { NetworkTrackingOptions } from '../network-tracking';\nimport { FrustrationInteractionsOptions } from '../frustration-interactions';\nimport { IDiagnosticsClient } from '../../diagnostics/diagnostics-client';\nimport { IRemoteConfigClient } from '../../remote-config/remote-config';\n\nexport interface BrowserConfig extends ExternalBrowserConfig, InternalBrowserConfig {}\n\nexport interface ExternalBrowserConfig extends IConfig {\n /**\n * An app version for events tracked. This can be the version of your application.\n * @defaultValue `undefined`\n */\n appVersion?: string;\n /**\n * @deprecated This property is deprecated and will be removed in future versions. Please migrate to using `autocapture` instead.\n * The default event tracking configuration.\n * See {@link https://www.docs.developers.amplitude.com/data/sdks/browser-2/#tracking-default-events}.\n * @defaultValue `true`\n */\n defaultTracking?: boolean | DefaultTrackingOptions;\n /**\n * The configurations for auto-captured events.\n * See {@link https://www.docs.developers.amplitude.com/data/sdks/browser-2/autocapture/}.\n */\n autocapture?: boolean | AutocaptureOptions;\n /**\n * The identifier for the device running your application.\n * @defaultValue `UUID()`\n */\n deviceId?: string;\n /**\n * Configuration for cookie.\n */\n cookieOptions?: CookieOptions;\n /**\n * The storage for user identify.\n * @defaultValue `\"cookie\"`\n */\n identityStorage?: IdentityStorageType;\n /**\n * The partner identifier.\n * Amplitude requires the customer who built an event ingestion integration to add the partner identifier to partner_id.\n * @defaultValue `undefined`\n */\n partnerId?: string;\n /**\n * The custom Session ID for the current session.\n * @defaultValue `timestamp`\n */\n sessionId?: number;\n /**\n * The period of inactivity from the last tracked event before a session expires in milliseconds.\n * @defaultValue `1,800,000` (30 minutes)\n */\n sessionTimeout: number;\n /**\n * The configurations for tracking additional properties.\n * See {@link https://www.docs.developers.amplitude.com/data/sdks/browser-2/#optional-tracking}.\n */\n trackingOptions: TrackingOptions;\n /**\n * Network transport mechanism used to send events.\n * @defaultValue `\"fetch\"`\n */\n transport?: TransportTypeOrOptions;\n /**\n * The identifier for the user being tracked.\n * @defaultValue `undefined`\n */\n userId?: string;\n /**\n * User's Nth instance of performing a default Page Viewed event within a session.\n * Used for landing page analysis.\n */\n pageCounter?: number;\n /**\n * Whether to fetch remote configuration. The remote configuration can be updated in the Amplitude platform here:\n * https://app.amplitude.com/data/amplitude/{your_org_name}/settings/autocapture\n * @defaultValue `true`\n * @deprecated This property is deprecated and will be removed in future versions. Please use `remoteConfig.fetchRemoteConfig` instead.\n */\n fetchRemoteConfig?: boolean;\n /**\n * Remote configuration options.\n * @defaultValue `undefined`\n */\n remoteConfig?: RemoteConfigOptions;\n /**\n * Captures network requests and responses.\n * @defaultValue `undefined`\n * @deprecated use autocapture.networkTracking instead\n */\n networkTrackingOptions?: NetworkTrackingOptions;\n /**\n * Whether to enable diagnostics.\n * @defaultValue `true`\n */\n enableDiagnostics?: boolean;\n}\n\ninterface InternalBrowserConfig {\n cookieStorage: Storage<UserSession>;\n lastEventTime?: number;\n lastEventId?: number;\n transportProvider: Transport;\n version?: string;\n diagnosticsSampleRate?: number;\n diagnosticsClient?: IDiagnosticsClient;\n remoteConfigClient?: IRemoteConfigClient;\n deferredSessionId?: number;\n topLevelDomain?: string;\n _enableRequestBodyCompressionExperimental?: boolean;\n}\n\n/**\n * @deprecated This interface is deprecated and will be removed in future versions. Please migrate to using `AutocaptureOptions` instead.\n */\nexport interface DefaultTrackingOptions {\n /**\n * Enables/disables marketing attribution tracking or config with detailed attribution options.\n * @defaultValue `true`\n */\n attribution?: boolean | AttributionOptions;\n /**\n * Enables/disables form downloads tracking.\n * @defaultValue `true`\n */\n fileDownloads?: boolean;\n /**\n * Enables/disables form interaction tracking or configures with detailed options.\n * @defaultValue `true`\n */\n formInteractions?: boolean | FormInteractionsOptions;\n /**\n * Enables/disables default page view tracking.\n * @defaultValue `true`\n */\n pageViews?: boolean | PageTrackingOptions;\n /**\n * Enables/disables session tracking.\n * @defaultValue `true`\n */\n sessions?: boolean;\n}\n\nexport interface AutocaptureOptions {\n /**\n * Enables/disables marketing attribution tracking or config with detailed attribution options.\n * @defaultValue `true`\n */\n attribution?: boolean | AttributionOptions;\n /**\n * Enables/disables form downloads tracking.\n * @defaultValue `true`\n */\n fileDownloads?: boolean;\n /**\n * Enables/disables form interaction tracking or configures with detailed options.\n * @defaultValue `true`\n */\n formInteractions?: boolean | FormInteractionsOptions;\n /**\n * Enables/disables default page view tracking.\n * @defaultValue `true`\n */\n pageViews?: boolean | PageTrackingOptions;\n /**\n * Enables/disables session tracking.\n * @defaultValue `true`\n */\n sessions?: boolean;\n /**\n * Enables/disables user interactions tracking.\n * @defaultValue `false`\n */\n elementInteractions?: boolean | ElementInteractionsOptions;\n /**\n * Enables/disables frustration interactions tracking.\n * @defaultValue `false`\n */\n frustrationInteractions?: boolean | FrustrationInteractionsOptions;\n /**\n * Enables/disables network request tracking or config with detailed network tracking options.\n * @defaultValue `false`\n */\n networkTracking?: boolean | NetworkTrackingOptions;\n /**\n * Enables/disables web vitals tracking.\n * @defaultValue `false`\n */\n webVitals?: boolean;\n /**\n * Enables/disables page url enrichment.\n * @defaultValue `true`\n * @experimental This feature is experimental and may not be stable\n */\n pageUrlEnrichment?: boolean;\n}\n\nexport interface TrackingOptions {\n /**\n * Enables/disables ip address tracking.\n * @defaultValue `true`\n */\n ipAddress?: boolean;\n /**\n * Enables/disables language tracking.\n * @defaultValue `true`\n */\n language?: boolean;\n /**\n * Enables/disables plantform tracking.\n * @defaultValue `true`\n */\n platform?: boolean;\n}\n\nexport interface AttributionOptions {\n /**\n * The rules to determine which referrers are excluded from being tracked as traffic source.\n * @defaultValue `[/your-domain\\.com$/]`\n */\n excludeReferrers?: (string | RegExp)[];\n /**\n * Exclude internal referrers from campaign attribution.\n * (a referrer is 'internal' if it is on the same domain as the current page)\n * @experimental this feature is experimental and may not be stable\n * @defaultValue `false`\n */\n excludeInternalReferrers?: true | false | ExcludeInternalReferrersOptions;\n /**\n * The value to represent undefined/no initial campaign parameter for first-touch attribution.\n * @defaultValue `\"EMPTY\"`\n */\n initialEmptyValue?: string;\n /**\n * The flag of if Amplitude to start a new session if any campaign parameter changes.\n * @defaultValue `false`\n */\n resetSessionOnNewCampaign?: boolean;\n}\n\nexport const EXCLUDE_INTERNAL_REFERRERS_CONDITIONS = {\n always: 'always',\n ifEmptyCampaign: 'ifEmptyCampaign',\n} as const;\n\ntype ExcludeInternalReferrersCondition =\n (typeof EXCLUDE_INTERNAL_REFERRERS_CONDITIONS)[keyof typeof EXCLUDE_INTERNAL_REFERRERS_CONDITIONS];\n\nexport interface ExcludeInternalReferrersOptions {\n /*\n * The condition on which to exclude internal referrers for campaign attribution.\n * @defaultValue `\"always\"`\n */\n condition?: ExcludeInternalReferrersCondition;\n}\n\nexport interface RemoteConfigOptions {\n /**\n * Whether to fetch remote configuration. The remote configuration can be updated in the Amplitude platform here:\n * https://app.amplitude.com/data/amplitude/{your_org_name}/settings/autocapture\n * @defaultValue `true`\n */\n fetchRemoteConfig?: boolean;\n /**\n * Custom server URL for remote configuration requests. If not provided, defaults to the standard\n * Amplitude remote config endpoint based on serverZone (US or EU).\n * Use this to proxy remote config requests through your own server.\n * @defaultValue `undefined` (uses standard Amplitude remote config endpoint)\n */\n serverUrl?: string;\n}\n\nexport interface CookieOptions {\n /**\n * The domain property of cookies created.\n * @defaultValue `Your top level domain`\n */\n domain?: string;\n /**\n * The expiration of cookies created in days.\n * @defaultValue `365`\n */\n expiration?: number;\n /**\n * How cookies are sent with cross-site requests.\n * @defaultValue `\"Lax\"`\n */\n sameSite?: 'Strict' | 'Lax' | 'None';\n /**\n * The flag of if send cookies over secure protocols.\n * @defaultValue `false`\n */\n secure?: boolean;\n /**\n * The flag of if upgrade the cookies created by maintenance Browser SDK.\n * @defaultValue `true`\n */\n upgrade?: boolean;\n}\n\ntype HiddenOptions = 'apiKey' | 'transportProvider' | 'requestMetadata' | '_enableRequestBodyCompressionExperimental';\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface BrowserOptions extends Omit<Partial<ExternalBrowserConfig>, HiddenOptions> {}\n"]}
@@ -61,6 +61,22 @@ export interface IConfig {
61
61
  * Amplitude internal use.
62
62
  */
63
63
  ingestionMetadata?: IngestionMetadata;
64
+ /**
65
+ * Compress network request body payloads with gzip.
66
+ *
67
+ * For custom `serverUrl` values, this option controls whether compression is attempted.
68
+ * For default Amplitude endpoints, compression remains enabled.
69
+ * Compression is best-effort and only applies when the platform supports it,
70
+ * the payload meets the minimum size threshold, and the transport can set request headers.
71
+ * @defaultValue `false`
72
+ */
73
+ enableRequestBodyCompression?: boolean;
74
+ /**
75
+ * @experimental
76
+ * WARNING: This config is for internal testing only and is not part of the public API.
77
+ * It may be changed or removed at any time without notice.
78
+ */
79
+ _enableRequestBodyCompressionExperimental?: boolean;
64
80
  /**
65
81
  * The URL where events are upload to.
66
82
  */
@@ -1 +1 @@
1
- {"version":3,"file":"core-config.d.ts","sourceRoot":"","sources":["../../../../src/types/config/core-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,MAAM,WAAW,OAAO;IACtB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,mBAAmB,EAAE,MAAM,CAAC;IAC5B;;OAEG;IACH,eAAe,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,QAAQ,EAAE,QAAQ,CAAC;IACnB;;OAEG;IACH,cAAc,EAAE,OAAO,CAAC;IACxB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,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AE,cAAc,CAAC;IAC5B;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC;IACnC;;OAEG;IACH,iBAAiB,EAAE,SAAS,CAAC;IAC7B;;OAEG;IACH,QAAQ,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,eAAe,CAAC,EAAE,gBAAgB,CAAC;IACnC;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE;QACH,OAAO,EAAE;YACP,SAAS,EAAE,iBAAiB,CAAC;SAC9B,CAAC;KACH,CAAC;IAEF,eAAe,CAAC,CAAC,SAAS,YAAY,EAAE,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,iBAAiB,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;CACpF;AAED,MAAM,WAAW,iBAAiB;IAChC,4BAA4B,CAAC,EAAE,MAAM,CAAC;IACtC,oCAAoC,CAAC,EAAE,MAAM,CAAC;IAC9C,iCAAiC,CAAC,EAAE,MAAM,CAAC;CAC5C;AAED,MAAM,MAAM,YAAY,GAAG,MAAM,iBAAiB,CAAC;AAEnD,MAAM,WAAW,aAAc,SAAQ,OAAO,CAAC,OAAO,CAAC;IACrD,MAAM,EAAE,MAAM,CAAC;IACf,iBAAiB,EAAE,SAAS,CAAC;CAC9B"}
@@ -1 +1 @@
1
- {"version":3,"file":"core-config.js","sourceRoot":"","sources":["../../../../src/types/config/core-config.ts"],"names":[],"mappings":"","sourcesContent":["import { LogLevel } from '../loglevel';\nimport { ILogger } from '../../logger';\nimport { OfflineDisabled } from '../offline';\nimport { Plan } from '../event/plan';\nimport { IngestionMetadata } from '../event/ingestion-metadata';\nimport { ServerZoneType } from '../server-zone';\nimport { Transport } from '../transport';\nimport { Storage } from '../storage';\nimport { Event } from '../event/event';\nimport { IIdentify } from '../../identify';\n\nexport interface IConfig {\n /**\n * Your Amplitude Project API key.\n */\n apiKey: string;\n /**\n * The interval of uploading events to Amplitude in milliseconds.\n */\n flushIntervalMillis: number;\n /**\n * The maximum number of retries for failed upload attempts. This is only applicable to retryable errors.\n */\n flushMaxRetries: number;\n /**\n * The maximum number of events that are batched in a single upload attempt.\n */\n flushQueueSize: number;\n /**\n * The instance name. For tracking events to multiple Amplitude projects in your application.\n */\n instanceName?: string;\n /**\n * Level of logs to be printed in the developer console.\n * Valid values are `LogLevel.None`, `LogLevel.Error`, `LogLevel.Warn`, `LogLevel.Verbose`, `LogLevel.Debug`\n */\n logLevel: LogLevel;\n /**\n * A custom Logger class to emit log messages to desired destination.\n */\n loggerProvider: ILogger;\n /**\n * The minimum length for the value of userId and deviceId properties.\n */\n minIdLength?: number;\n /**\n * Whether the SDK is connected to network.\n */\n offline?: boolean | typeof OfflineDisabled;\n /**\n * The flag to opt this device out of Amplitude tracking.\n * If this flag is set, no additional information will be stored for the user.\n */\n optOut: boolean;\n /**\n * Tracking plan properties.\n * Amplitude internal use.\n */\n plan?: Plan;\n /**\n * Ingestion metadata.\n * Amplitude internal use.\n */\n ingestionMetadata?: IngestionMetadata;\n /**\n * The URL where events are upload to.\n */\n serverUrl?: string;\n /**\n * The Amplitude server zone.\n * Set this to EU for Amplitude projects created in EU data center.\n */\n serverZone?: ServerZoneType;\n /**\n * The storage provider to persist unsent events.\n */\n storageProvider?: Storage<Event[]>;\n /**\n * A customer Transport Class for sending data to a server.\n */\n transportProvider: Transport;\n /**\n * The flag of whether to upload events to Batch API instead of the default HTTP V2 API.\n */\n useBatch: boolean;\n /**\n * Metrics of the SDK.\n */\n requestMetadata?: IRequestMetadata;\n /**\n * Invokes identify on this Identify object prior to initializing the SDK.\n */\n identify?: IIdentify;\n}\n\nexport interface IRequestMetadata {\n sdk: {\n metrics: {\n histogram: IHistogramOptions;\n };\n };\n\n recordHistogram<T extends HistogramKey>(key: T, value: IHistogramOptions[T]): void;\n}\n\nexport interface IHistogramOptions {\n remote_config_fetch_time_IDB?: number;\n remote_config_fetch_time_API_success?: number;\n remote_config_fetch_time_API_fail?: number;\n}\n\nexport type HistogramKey = keyof IHistogramOptions;\n\nexport interface ConfigOptions extends Partial<IConfig> {\n apiKey: string;\n transportProvider: Transport;\n}\n"]}
1
+ {"version":3,"file":"core-config.js","sourceRoot":"","sources":["../../../../src/types/config/core-config.ts"],"names":[],"mappings":"","sourcesContent":["import { LogLevel } from '../loglevel';\nimport { ILogger } from '../../logger';\nimport { OfflineDisabled } from '../offline';\nimport { Plan } from '../event/plan';\nimport { IngestionMetadata } from '../event/ingestion-metadata';\nimport { ServerZoneType } from '../server-zone';\nimport { Transport } from '../transport';\nimport { Storage } from '../storage';\nimport { Event } from '../event/event';\nimport { IIdentify } from '../../identify';\n\nexport interface IConfig {\n /**\n * Your Amplitude Project API key.\n */\n apiKey: string;\n /**\n * The interval of uploading events to Amplitude in milliseconds.\n */\n flushIntervalMillis: number;\n /**\n * The maximum number of retries for failed upload attempts. This is only applicable to retryable errors.\n */\n flushMaxRetries: number;\n /**\n * The maximum number of events that are batched in a single upload attempt.\n */\n flushQueueSize: number;\n /**\n * The instance name. For tracking events to multiple Amplitude projects in your application.\n */\n instanceName?: string;\n /**\n * Level of logs to be printed in the developer console.\n * Valid values are `LogLevel.None`, `LogLevel.Error`, `LogLevel.Warn`, `LogLevel.Verbose`, `LogLevel.Debug`\n */\n logLevel: LogLevel;\n /**\n * A custom Logger class to emit log messages to desired destination.\n */\n loggerProvider: ILogger;\n /**\n * The minimum length for the value of userId and deviceId properties.\n */\n minIdLength?: number;\n /**\n * Whether the SDK is connected to network.\n */\n offline?: boolean | typeof OfflineDisabled;\n /**\n * The flag to opt this device out of Amplitude tracking.\n * If this flag is set, no additional information will be stored for the user.\n */\n optOut: boolean;\n /**\n * Tracking plan properties.\n * Amplitude internal use.\n */\n plan?: Plan;\n /**\n * Ingestion metadata.\n * Amplitude internal use.\n */\n ingestionMetadata?: IngestionMetadata;\n /**\n * Compress network request body payloads with gzip.\n *\n * For custom `serverUrl` values, this option controls whether compression is attempted.\n * For default Amplitude endpoints, compression remains enabled.\n * Compression is best-effort and only applies when the platform supports it,\n * the payload meets the minimum size threshold, and the transport can set request headers.\n * @defaultValue `false`\n */\n enableRequestBodyCompression?: boolean;\n /**\n * @experimental\n * WARNING: This config is for internal testing only and is not part of the public API.\n * It may be changed or removed at any time without notice.\n */\n _enableRequestBodyCompressionExperimental?: boolean;\n /**\n * The URL where events are upload to.\n */\n serverUrl?: string;\n /**\n * The Amplitude server zone.\n * Set this to EU for Amplitude projects created in EU data center.\n */\n serverZone?: ServerZoneType;\n /**\n * The storage provider to persist unsent events.\n */\n storageProvider?: Storage<Event[]>;\n /**\n * A customer Transport Class for sending data to a server.\n */\n transportProvider: Transport;\n /**\n * The flag of whether to upload events to Batch API instead of the default HTTP V2 API.\n */\n useBatch: boolean;\n /**\n * Metrics of the SDK.\n */\n requestMetadata?: IRequestMetadata;\n /**\n * Invokes identify on this Identify object prior to initializing the SDK.\n */\n identify?: IIdentify;\n}\n\nexport interface IRequestMetadata {\n sdk: {\n metrics: {\n histogram: IHistogramOptions;\n };\n };\n\n recordHistogram<T extends HistogramKey>(key: T, value: IHistogramOptions[T]): void;\n}\n\nexport interface IHistogramOptions {\n remote_config_fetch_time_IDB?: number;\n remote_config_fetch_time_API_success?: number;\n remote_config_fetch_time_API_fail?: number;\n}\n\nexport type HistogramKey = keyof IHistogramOptions;\n\nexport interface ConfigOptions extends Partial<IConfig> {\n apiKey: string;\n transportProvider: Transport;\n}\n"]}
@@ -1,4 +1,4 @@
1
1
  import { IConfig } from './core-config';
2
2
  export type NodeConfig = IConfig;
3
- export type NodeOptions = Omit<Partial<NodeConfig>, 'apiKey'>;
3
+ export type NodeOptions = Omit<Partial<NodeConfig>, 'apiKey' | '_enableRequestBodyCompressionExperimental'>;
4
4
  //# sourceMappingURL=node-config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"node-config.d.ts","sourceRoot":"","sources":["../../../../src/types/config/node-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,MAAM,MAAM,UAAU,GAAG,OAAO,CAAC;AAEjC,MAAM,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,QAAQ,CAAC,CAAC"}
1
+ {"version":3,"file":"node-config.d.ts","sourceRoot":"","sources":["../../../../src/types/config/node-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,MAAM,MAAM,UAAU,GAAG,OAAO,CAAC;AAEjC,MAAM,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,QAAQ,GAAG,2CAA2C,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"node-config.js","sourceRoot":"","sources":["../../../../src/types/config/node-config.ts"],"names":[],"mappings":"","sourcesContent":["import { IConfig } from './core-config';\n\nexport type NodeConfig = IConfig;\n\nexport type NodeOptions = Omit<Partial<NodeConfig>, 'apiKey'>;\n"]}
1
+ {"version":3,"file":"node-config.js","sourceRoot":"","sources":["../../../../src/types/config/node-config.ts"],"names":[],"mappings":"","sourcesContent":["import { IConfig } from './core-config';\n\nexport type NodeConfig = IConfig;\n\nexport type NodeOptions = Omit<Partial<NodeConfig>, 'apiKey' | '_enableRequestBodyCompressionExperimental'>;\n"]}
@@ -1,7 +1,7 @@
1
1
  import { IConfig } from './core-config';
2
2
  import { Storage } from '../storage';
3
3
  import { UserSession } from '../user-session';
4
- type HiddenOptions = 'apiKey' | 'lastEventId';
4
+ type HiddenOptions = 'apiKey' | 'lastEventId' | '_enableRequestBodyCompressionExperimental';
5
5
  export type ReactNativeOptions = Omit<Partial<ReactNativeConfig>, HiddenOptions>;
6
6
  export interface ReactNativeConfig extends Omit<IConfig, 'offline' | 'requestMetadata'> {
7
7
  trackingOptions: ReactNativeTrackingOptions;
@@ -1 +1 @@
1
- {"version":3,"file":"react-native-config.d.ts","sourceRoot":"","s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AC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;CACpC"}
@@ -1 +1 @@
1
- {"version":3,"file":"react-native-config.js","sourceRoot":"","sources":["../../../../src/types/config/react-native-config.ts"],"names":[],"mappings":"","sourcesContent":["import { IConfig } from './core-config';\nimport { Storage } from '../storage';\nimport { UserSession } from '../user-session';\n\ntype HiddenOptions = 'apiKey' | 'lastEventId';\n\nexport type ReactNativeOptions = Omit<Partial<ReactNativeConfig>, HiddenOptions>;\n\nexport interface ReactNativeConfig extends Omit<IConfig, 'offline' | 'requestMetadata'> {\n trackingOptions: ReactNativeTrackingOptions;\n trackingSessionEvents?: boolean;\n migrateLegacyData?: boolean;\n appVersion?: string;\n attribution?: ReactNativeAttributionOptions;\n deviceId?: string;\n cookieExpiration: number;\n cookieSameSite: string;\n cookieSecure: boolean;\n cookieStorage: Storage<UserSession>;\n cookieUpgrade: boolean;\n disableCookies: boolean;\n domain: string;\n lastEventTime?: number;\n lastEventId?: number;\n partnerId?: string;\n sessionId?: number;\n sessionTimeout: number;\n userId?: string;\n}\n\nexport interface ReactNativeAttributionOptions {\n disabled?: boolean;\n excludeReferrers?: string[];\n initialEmptyValue?: string;\n trackNewCampaigns?: boolean;\n trackPageViews?: boolean;\n resetSessionOnNewCampaign?: boolean;\n}\n\nexport interface ReactNativeTrackingOptions {\n adid?: boolean;\n carrier?: boolean;\n appSetId?: boolean;\n idfv?: boolean;\n country?: boolean;\n\n deviceManufacturer?: boolean;\n deviceModel?: boolean;\n ipAddress?: boolean;\n language?: boolean;\n osName?: boolean;\n osVersion?: boolean;\n platform?: boolean;\n [key: string]: boolean | undefined;\n}\n"]}
1
+ {"version":3,"file":"react-native-config.js","sourceRoot":"","sources":["../../../../src/types/config/react-native-config.ts"],"names":[],"mappings":"","sourcesContent":["import { IConfig } from './core-config';\nimport { Storage } from '../storage';\nimport { UserSession } from '../user-session';\n\ntype HiddenOptions = 'apiKey' | 'lastEventId' | '_enableRequestBodyCompressionExperimental';\n\nexport type ReactNativeOptions = Omit<Partial<ReactNativeConfig>, HiddenOptions>;\n\nexport interface ReactNativeConfig extends Omit<IConfig, 'offline' | 'requestMetadata'> {\n trackingOptions: ReactNativeTrackingOptions;\n trackingSessionEvents?: boolean;\n migrateLegacyData?: boolean;\n appVersion?: string;\n attribution?: ReactNativeAttributionOptions;\n deviceId?: string;\n cookieExpiration: number;\n cookieSameSite: string;\n cookieSecure: boolean;\n cookieStorage: Storage<UserSession>;\n cookieUpgrade: boolean;\n disableCookies: boolean;\n domain: string;\n lastEventTime?: number;\n lastEventId?: number;\n partnerId?: string;\n sessionId?: number;\n sessionTimeout: number;\n userId?: string;\n}\n\nexport interface ReactNativeAttributionOptions {\n disabled?: boolean;\n excludeReferrers?: string[];\n initialEmptyValue?: string;\n trackNewCampaigns?: boolean;\n trackPageViews?: boolean;\n resetSessionOnNewCampaign?: boolean;\n}\n\nexport interface ReactNativeTrackingOptions {\n adid?: boolean;\n carrier?: boolean;\n appSetId?: boolean;\n idfv?: boolean;\n country?: boolean;\n\n deviceManufacturer?: boolean;\n deviceModel?: boolean;\n ipAddress?: boolean;\n language?: boolean;\n osName?: boolean;\n osVersion?: boolean;\n platform?: boolean;\n [key: string]: boolean | undefined;\n}\n"]}
@@ -1,7 +1,7 @@
1
1
  import { Payload } from './payload';
2
2
  import { Response } from './response';
3
3
  export interface Transport {
4
- send(serverUrl: string, payload: Payload): Promise<Response | null>;
4
+ send(serverUrl: string, payload: Payload, enableRequestBodyCompression?: boolean): Promise<Response | null>;
5
5
  }
6
6
  export type TransportType = 'xhr' | 'beacon' | 'fetch';
7
7
  export interface TransportOptions {
@@ -1 +1 @@
1
- {"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../../../src/types/transport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,MAAM,WAAW,SAAS;IACxB,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAC;CACrE;AAED,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEvD,MAAM,WAAW,gBAAgB;IAC/B,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC;AAED,MAAM,MAAM,sBAAsB,GAAG,aAAa,GAAG,gBAAgB,CAAC"}
1
+ {"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../../../src/types/transport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,MAAM,WAAW,SAAS;IACxB,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,4BAA4B,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAC;CAC7G;AAED,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEvD,MAAM,WAAW,gBAAgB;IAC/B,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC;AAED,MAAM,MAAM,sBAAsB,GAAG,aAAa,GAAG,gBAAgB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"transport.js","sourceRoot":"","sources":["../../../src/types/transport.ts"],"names":[],"mappings":"","sourcesContent":["import { Payload } from './payload';\nimport { Response } from './response';\n\nexport interface Transport {\n send(serverUrl: string, payload: Payload): Promise<Response | null>;\n}\n\nexport type TransportType = 'xhr' | 'beacon' | 'fetch';\n\nexport interface TransportOptions {\n type?: TransportType;\n headers?: Record<string, string>;\n}\n\nexport type TransportTypeOrOptions = TransportType | TransportOptions;\n"]}
1
+ {"version":3,"file":"transport.js","sourceRoot":"","sources":["../../../src/types/transport.ts"],"names":[],"mappings":"","sourcesContent":["import { Payload } from './payload';\nimport { Response } from './response';\n\nexport interface Transport {\n send(serverUrl: string, payload: Payload, enableRequestBodyCompression?: boolean): Promise<Response | null>;\n}\n\nexport type TransportType = 'xhr' | 'beacon' | 'fetch';\n\nexport interface TransportOptions {\n type?: TransportType;\n headers?: Record<string, string>;\n}\n\nexport type TransportTypeOrOptions = TransportType | TransportOptions;\n"]}
@@ -29,6 +29,7 @@ export { DiagnosticsClient, IDiagnosticsClient } from './diagnostics/diagnostics
29
29
  export { registerSdkLoaderMetadata } from './diagnostics/uncaught-sdk-errors';
30
30
  export { BaseTransport } from './transports/base';
31
31
  export { FetchTransport } from './transports/fetch';
32
+ export { compressToGzipArrayBuffer, isCompressionStreamAvailable, MIN_GZIP_UPLOAD_BODY_SIZE_BYTES, } from './transports/gzip';
32
33
  export { RemoteConfigClient, IRemoteConfigClient, RemoteConfig, Source } from './remote-config/remote-config';
33
34
  export { LogLevel } from './types/loglevel';
34
35
  export { AMPLITUDE_PREFIX, STORAGE_PREFIX } from './types/constants';
@@ -73,4 +74,5 @@ export type { BaseWindowMessenger, ActionHandler } from './messenger/base-window
73
74
  export { getOrCreateWindowMessenger } from './messenger/base-window-messenger';
74
75
  export { enableBackgroundCapture } from './messenger/background-capture';
75
76
  export { AMPLITUDE_ORIGIN, AMPLITUDE_ORIGIN_EU, AMPLITUDE_ORIGIN_STAGING, AMPLITUDE_ORIGINS_MAP, AMPLITUDE_BACKGROUND_CAPTURE_SCRIPT_URL, } from './messenger/constants';
77
+ export { ExcludeInternalReferrersOptions, EXCLUDE_INTERNAL_REFERRERS_CONDITIONS } from './types/config/browser-config';
76
78
  //# sourceMapping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,MAAM,4BAA4B,CAAC;AAGrE,OAAO,EACL,iBAAiB,EACjB,0BAA0B,EAC1B,kBAAkB,EAClB,6BAA6B,GAC9B,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAEvE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAE5F,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAG3D,YAAY,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAC5F,OAAO,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAC;AAC/E,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AACzE,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACnB,wBAAwB,EACxB,qBAAqB,EACrB,uCAAuC,GACxC,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,+BAA+B,EAAE,qCAAqC,EAAE,MAAM,+BAA+B,CAAC"}
package/lib/esm/index.js CHANGED
@@ -25,6 +25,7 @@ export { DiagnosticsClient } from './diagnostics/diagnostics-client';
25
25
  export { registerSdkLoaderMetadata } from './diagnostics/uncaught-sdk-errors';
26
26
  export { BaseTransport } from './transports/base';
27
27
  export { FetchTransport } from './transports/fetch';
28
+ export { compressToGzipArrayBuffer, isCompressionStreamAvailable, MIN_GZIP_UPLOAD_BODY_SIZE_BYTES, } from './transports/gzip';
28
29
  export { RemoteConfigClient } from './remote-config/remote-config';
29
30
  export { LogLevel } from './types/loglevel';
30
31
  export { AMPLITUDE_PREFIX, STORAGE_PREFIX } from './types/constants';
@@ -46,4 +47,5 @@ export { safeJsonStringify } from './utils/safe-stringify';
46
47
  export { getOrCreateWindowMessenger } from './messenger/base-window-messenger';
47
48
  export { enableBackgroundCapture } from './messenger/background-capture';
48
49
  export { AMPLITUDE_ORIGIN, AMPLITUDE_ORIGIN_EU, AMPLITUDE_ORIGIN_STAGING, AMPLITUDE_ORIGINS_MAP, AMPLITUDE_BACKGROUND_CAPTURE_SCRIPT_URL, } from './messenger/constants';
50
+ export { EXCLUDE_INTERNAL_REFERRERS_CONDITIONS } from './types/config/browser-config';
49
51
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAI9C,OAAO,EAAE,QAAQ,EAAgC,MAAM,YAAY,CAAC;AACpE,OAAO,EAAE,OAAO,EAAY,eAAe,EAAE,MAAM,WAAW,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEnD,OAAO,EAAE,MAAM,EAAsB,MAAM,UAAU,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AACxG,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEhD,OAAO,EAAE,aAAa,EAAmB,MAAM,wBAAwB,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAClF,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,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kCAAkC,CAAC;AAG1C,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC5E,OAAO,EAAE,mBAAmB,EAAqD,MAAM,yBAAyB,CAAC;AAEjH,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAMpE,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,iBAAiB,EACjB,sBAAsB,EACtB,QAAQ,EACR,SAAS,EACT,WAAW,GACZ,MAAM,mBAAmB,CAAC;AA4B3B,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAkB,MAAM,oBAAoB,CAAC;AAG5F,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAI3D,OAAO,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAC;AAC/E,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AACzE,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACnB,wBAAwB,EACxB,qBAAqB,EACrB,uCAAuC,GACxC,MAAM,uBAAuB,CAAC","sourcesContent":["export { AmplitudeCore } from './core-client';\nexport { CoreClient, PluginHost } from './types/client/core-client';\nexport { AnalyticsClient } from './types/client/analytics-client';\nexport { AmplitudeContext } from './types/amplitude-context';\nexport { Identify, IIdentify, ValidPropertyType } from './identify';\nexport { Revenue, IRevenue, RevenueProperty } from './revenue';\nexport { Destination } from './plugins/destination';\nexport { IdentityEventSender } from './plugins/identity';\nexport { Config, RequestMetadata } from './config';\nexport { IConfig } from './types/config/core-config';\nexport { Logger, ILogger, LogConfig } from './logger';\nexport { getGlobalScope } from './global-scope';\nexport { getAnalyticsConnector, setConnectorDeviceId, setConnectorUserId } from './analytics-connector';\nexport { isNewSession } from './session';\nexport { getCookieName, getOldCookieName } from './cookie-name';\nexport { getLanguage } from './language';\nexport { getQueryParams } from './query-params';\n\nexport { returnWrapper, AmplitudeReturn } from './utils/return-wrapper';\nexport { debugWrapper, getClientLogConfig, getClientStates } from './utils/debug';\nexport { UUID } from './utils/uuid';\nexport { createIdentifyEvent } from './utils/event-builder';\nexport { isUrlMatchAllowlist, getDecodeURI } from './utils/url-utils';\nexport { generateHashCode, isTimestampInSample } from './utils/sampling';\n\nexport { MemoryStorage } from './storage/memory';\nexport { CookieStorage, isDomainEqual, decodeCookieValue } from './storage/cookie';\nexport { getStorageKey } from './storage/helpers';\n\nexport { BrowserStorage } from './storage/browser-storage';\n\nexport { DiagnosticsClient, IDiagnosticsClient } from './diagnostics/diagnostics-client';\nexport { registerSdkLoaderMetadata } from './diagnostics/uncaught-sdk-errors';\n\nexport { BaseTransport } from './transports/base';\nexport { FetchTransport } from './transports/fetch';\n\nexport { RemoteConfigClient, IRemoteConfigClient, RemoteConfig, Source } from './remote-config/remote-config';\n\nexport { LogLevel } from './types/loglevel';\nexport { AMPLITUDE_PREFIX, STORAGE_PREFIX } from './types/constants';\nexport { Storage, IdentityStorageType, CookieStorageConfig } from './types/storage';\nexport { consoleObserver } from './observers/console';\nexport {\n Event,\n IdentifyOperation,\n SpecialEventType,\n IdentifyEvent,\n GroupIdentifyEvent,\n IdentifyUserProperties,\n} from './types/event/event';\nexport { EventOptions, BaseEvent } from './types/event/base-event';\nexport { IngestionMetadata } from './types/event/ingestion-metadata';\nexport { ServerZoneType, ServerZone } from './types/server-zone';\nexport { OfflineDisabled } from './types/offline';\nexport { Plan } from './types/event/plan';\nexport { TransportType, Transport, TransportOptions, TransportTypeOrOptions } from './types/transport';\nexport { Payload } from './types/payload';\nexport { Response } from './types/response';\nexport { UserSession } from './types/user-session';\nexport {\n Plugin,\n BeforePlugin,\n DestinationPlugin,\n EnrichmentPlugin,\n PluginType,\n AnalyticsIdentity,\n} from './types/plugin';\nexport { Result } from './types/result';\nexport {\n ElementInteractionsOptions,\n Messenger,\n ActionType,\n DEFAULT_CSS_SELECTOR_ALLOWLIST,\n DEFAULT_DATA_ATTRIBUTE_PREFIX,\n DEFAULT_ACTION_CLICK_ALLOWLIST,\n LabeledEvent,\n Trigger,\n DataSource,\n} from './types/element-interactions';\n\nexport {\n FrustrationInteractionsOptions,\n DEFAULT_DEAD_CLICK_ALLOWLIST,\n DEFAULT_RAGE_CLICK_ALLOWLIST,\n DEFAULT_ERROR_CLICK_ALLOWLIST,\n DEFAULT_RAGE_CLICK_THRESHOLD,\n DEFAULT_RAGE_CLICK_WINDOW_MS,\n DEFAULT_RAGE_CLICK_OUT_OF_BOUNDS_THRESHOLD,\n DEFAULT_DEAD_CLICK_WINDOW_MS,\n} from './types/frustration-interactions';\nexport { PageTrackingOptions, PageTrackingTrackOn, PageTrackingHistoryChanges } from './types/page-view-tracking';\nexport { FormInteractionsOptions } from './types/form-interactions';\nexport { Status } from './types/status';\n\nexport { NetworkEventCallback, networkObserver } from './observers/network';\nexport { NetworkRequestEvent, IRequestWrapper, JsonObject, JsonValue, JsonArray } from './network-request-event';\nexport { NetworkTrackingOptions, NetworkCaptureRule } from './types/network-tracking';\nexport { SAFE_HEADERS, FORBIDDEN_HEADERS } from './types/constants';\n\nexport { PageUrlEnrichmentOptions } from './types/page-url-enrichment';\n\n// Campaign\nexport { Campaign, UTMParameters, ReferrerParameters, ClickIdParameters, ICampaignParser } from './types/campaign';\nexport { EMPTY_VALUE, BASE_CAMPAIGN, MKTG } from './types/constants';\nexport { CampaignParser } from './campaign/campaign-parser';\nexport {\n getPageTitle,\n TEXT_MASK_ATTRIBUTE,\n MASKED_TEXT_VALUE,\n replaceSensitiveString,\n CC_REGEX,\n SSN_REGEX,\n EMAIL_REGEX,\n} from './plugins/helpers';\n\n// Browser\nexport {\n BrowserConfig,\n BrowserOptions,\n DefaultTrackingOptions,\n TrackingOptions,\n AutocaptureOptions,\n CookieOptions,\n AttributionOptions,\n RemoteConfigOptions,\n} from './types/config/browser-config';\nexport { BrowserClient } from './types/client/browser-client';\n\n// Node\nexport { NodeClient } from './types/client/node-client';\nexport { NodeConfig, NodeOptions } from './types/config/node-config';\n\n// React Native\nexport {\n ReactNativeConfig,\n ReactNativeTrackingOptions,\n ReactNativeOptions,\n ReactNativeAttributionOptions,\n} from './types/config/react-native-config';\nexport { ReactNativeClient } from './types/client/react-native-client';\n\nexport { Observable, asyncMap, merge, multicast, Unsubscribable } from './utils/observable';\n\nexport { InstanceProxy } from './types/proxy';\nexport { safeJsonStringify } from './utils/safe-stringify';\n\n// Messenger (cross-window communication)\nexport type { BaseWindowMessenger, ActionHandler } from './messenger/base-window-messenger';\nexport { getOrCreateWindowMessenger } from './messenger/base-window-messenger';\nexport { enableBackgroundCapture } from './messenger/background-capture';\nexport {\n AMPLITUDE_ORIGIN,\n AMPLITUDE_ORIGIN_EU,\n AMPLITUDE_ORIGIN_STAGING,\n AMPLITUDE_ORIGINS_MAP,\n AMPLITUDE_BACKGROUND_CAPTURE_SCRIPT_URL,\n} from './messenger/constants';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAI9C,OAAO,EAAE,QAAQ,EAAgC,MAAM,YAAY,CAAC;AACpE,OAAO,EAAE,OAAO,EAAY,eAAe,EAAE,MAAM,WAAW,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEnD,OAAO,EAAE,MAAM,EAAsB,MAAM,UAAU,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,qBAAq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AAmC,CAAC;AAC/E,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AACzE,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACnB,wBAAwB,EACxB,qBAAqB,EACrB,uCAAuC,GACxC,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAmC,qCAAqC,EAAE,MAAM,+BAA+B,CAAC","sourcesContent":["export { AmplitudeCore } from './core-client';\nexport { CoreClient, PluginHost } from './types/client/core-client';\nexport { AnalyticsClient } from './types/client/analytics-client';\nexport { AmplitudeContext } from './types/amplitude-context';\nexport { Identify, IIdentify, ValidPropertyType } from './identify';\nexport { Revenue, IRevenue, RevenueProperty } from './revenue';\nexport { Destination } from './plugins/destination';\nexport { IdentityEventSender } from './plugins/identity';\nexport { Config, RequestMetadata } from './config';\nexport { IConfig } from './types/config/core-config';\nexport { Logger, ILogger, LogConfig } from './logger';\nexport { getGlobalScope } from './global-scope';\nexport { getAnalyticsConnector, setConnectorDeviceId, setConnectorUserId } from './analytics-connector';\nexport { isNewSession } from './session';\nexport { getCookieName, getOldCookieName } from './cookie-name';\nexport { getLanguage } from './language';\nexport { getQueryParams } from './query-params';\n\nexport { returnWrapper, AmplitudeReturn } from './utils/return-wrapper';\nexport { debugWrapper, getClientLogConfig, getClientStates } from './utils/debug';\nexport { UUID } from './utils/uuid';\nexport { createIdentifyEvent } from './utils/event-builder';\nexport { isUrlMatchAllowlist, getDecodeURI } from './utils/url-utils';\nexport { generateHashCode, isTimestampInSample } from './utils/sampling';\n\nexport { MemoryStorage } from './storage/memory';\nexport { CookieStorage, isDomainEqual, decodeCookieValue } from './storage/cookie';\nexport { getStorageKey } from './storage/helpers';\n\nexport { BrowserStorage } from './storage/browser-storage';\n\nexport { DiagnosticsClient, IDiagnosticsClient } from './diagnostics/diagnostics-client';\nexport { registerSdkLoaderMetadata } from './diagnostics/uncaught-sdk-errors';\n\nexport { BaseTransport } from './transports/base';\nexport { FetchTransport } from './transports/fetch';\nexport {\n compressToGzipArrayBuffer,\n isCompressionStreamAvailable,\n MIN_GZIP_UPLOAD_BODY_SIZE_BYTES,\n} from './transports/gzip';\n\nexport { RemoteConfigClient, IRemoteConfigClient, RemoteConfig, Source } from './remote-config/remote-config';\n\nexport { LogLevel } from './types/loglevel';\nexport { AMPLITUDE_PREFIX, STORAGE_PREFIX } from './types/constants';\nexport { Storage, IdentityStorageType, CookieStorageConfig } from './types/storage';\nexport { consoleObserver } from './observers/console';\nexport {\n Event,\n IdentifyOperation,\n SpecialEventType,\n IdentifyEvent,\n GroupIdentifyEvent,\n IdentifyUserProperties,\n} from './types/event/event';\nexport { EventOptions, BaseEvent } from './types/event/base-event';\nexport { IngestionMetadata } from './types/event/ingestion-metadata';\nexport { ServerZoneType, ServerZone } from './types/server-zone';\nexport { OfflineDisabled } from './types/offline';\nexport { Plan } from './types/event/plan';\nexport { TransportType, Transport, TransportOptions, TransportTypeOrOptions } from './types/transport';\nexport { Payload } from './types/payload';\nexport { Response } from './types/response';\nexport { UserSession } from './types/user-session';\nexport {\n Plugin,\n BeforePlugin,\n DestinationPlugin,\n EnrichmentPlugin,\n PluginType,\n AnalyticsIdentity,\n} from './types/plugin';\nexport { Result } from './types/result';\nexport {\n ElementInteractionsOptions,\n Messenger,\n ActionType,\n DEFAULT_CSS_SELECTOR_ALLOWLIST,\n DEFAULT_DATA_ATTRIBUTE_PREFIX,\n DEFAULT_ACTION_CLICK_ALLOWLIST,\n LabeledEvent,\n Trigger,\n DataSource,\n} from './types/element-interactions';\n\nexport {\n FrustrationInteractionsOptions,\n DEFAULT_DEAD_CLICK_ALLOWLIST,\n DEFAULT_RAGE_CLICK_ALLOWLIST,\n DEFAULT_ERROR_CLICK_ALLOWLIST,\n DEFAULT_RAGE_CLICK_THRESHOLD,\n DEFAULT_RAGE_CLICK_WINDOW_MS,\n DEFAULT_RAGE_CLICK_OUT_OF_BOUNDS_THRESHOLD,\n DEFAULT_DEAD_CLICK_WINDOW_MS,\n} from './types/frustration-interactions';\nexport { PageTrackingOptions, PageTrackingTrackOn, PageTrackingHistoryChanges } from './types/page-view-tracking';\nexport { FormInteractionsOptions } from './types/form-interactions';\nexport { Status } from './types/status';\n\nexport { NetworkEventCallback, networkObserver } from './observers/network';\nexport { NetworkRequestEvent, IRequestWrapper, JsonObject, JsonValue, JsonArray } from './network-request-event';\nexport { NetworkTrackingOptions, NetworkCaptureRule } from './types/network-tracking';\nexport { SAFE_HEADERS, FORBIDDEN_HEADERS } from './types/constants';\n\nexport { PageUrlEnrichmentOptions } from './types/page-url-enrichment';\n\n// Campaign\nexport { Campaign, UTMParameters, ReferrerParameters, ClickIdParameters, ICampaignParser } from './types/campaign';\nexport { EMPTY_VALUE, BASE_CAMPAIGN, MKTG } from './types/constants';\nexport { CampaignParser } from './campaign/campaign-parser';\nexport {\n getPageTitle,\n TEXT_MASK_ATTRIBUTE,\n MASKED_TEXT_VALUE,\n replaceSensitiveString,\n CC_REGEX,\n SSN_REGEX,\n EMAIL_REGEX,\n} from './plugins/helpers';\n\n// Browser\nexport {\n BrowserConfig,\n BrowserOptions,\n DefaultTrackingOptions,\n TrackingOptions,\n AutocaptureOptions,\n CookieOptions,\n AttributionOptions,\n RemoteConfigOptions,\n} from './types/config/browser-config';\nexport { BrowserClient } from './types/client/browser-client';\n\n// Node\nexport { NodeClient } from './types/client/node-client';\nexport { NodeConfig, NodeOptions } from './types/config/node-config';\n\n// React Native\nexport {\n ReactNativeConfig,\n ReactNativeTrackingOptions,\n ReactNativeOptions,\n ReactNativeAttributionOptions,\n} from './types/config/react-native-config';\nexport { ReactNativeClient } from './types/client/react-native-client';\n\nexport { Observable, asyncMap, merge, multicast, Unsubscribable } from './utils/observable';\n\nexport { InstanceProxy } from './types/proxy';\nexport { safeJsonStringify } from './utils/safe-stringify';\n\n// Messenger (cross-window communication)\nexport type { BaseWindowMessenger, ActionHandler } from './messenger/base-window-messenger';\nexport { getOrCreateWindowMessenger } from './messenger/base-window-messenger';\nexport { enableBackgroundCapture } from './messenger/background-capture';\nexport {\n AMPLITUDE_ORIGIN,\n AMPLITUDE_ORIGIN_EU,\n AMPLITUDE_ORIGIN_STAGING,\n AMPLITUDE_ORIGINS_MAP,\n AMPLITUDE_BACKGROUND_CAPTURE_SCRIPT_URL,\n} from './messenger/constants';\n\nexport { ExcludeInternalReferrersOptions, EXCLUDE_INTERNAL_REFERRERS_CONDITIONS } from './types/config/browser-config';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"destination.d.ts","sourceRoot":"","sources":["../../../src/plugins/destination.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC,OAAO,EACL,QAAQ,EACR,eAAe,EACf,uBAAuB,EACvB,iBAAiB,EACjB,eAAe,EAChB,MAAM,mBAAmB,CAAC;AAa3B,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAIvE,MAAM,WAAW,OAAO;IACtB,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,aAAa,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;CACjB;AAOD,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,QAAQ,UAUlD;AAED,qBAAa,WAAY,YAAW,iBAAiB;IACnD,IAAI,SAAe;IACnB,IAAI,gBAA0B;IAE9B,YAAY,SAAQ;IACpB,eAAe,SAAS;IACxB,UAAU,SAAM;IAIhB,MAAM,EAAE,OAAO,CAAC;IAKhB,UAAU,EAAE,UAAU,CAAC,OAAO,UAAU,CAAC,GAAG,IAAI,CAAQ;IAExD,gBAAgB,SAAK;IAGrB,OAAO,EAAE,UAA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C,iCAAiC,CAAC,IAAI,EAAE,OAAO,EAAE;IAWjD,cAAc,CAAC,IAAI,EAAE,OAAO,EAAE;IAU9B,QAAQ,CAAC,OAAO,EAAE,MAAM;IAsBxB,aAAa;IAMP,KAAK,CAAC,QAAQ,UAAQ;IAoCtB,IAAI,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,QAAQ,UAAO;IA0D3C,cAAc,CAAC,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE;IAuC7C,qBAAqB,CAAC,GAAG,EAAE,eAAe,EAAE,IAAI,EAAE,OAAO,EAAE;IAI3D,qBAAqB,CAAC,GAAG,EAAE,eAAe,EAAE,IAAI,EAAE,OAAO,EAAE;IA+B3D,6BAA6B,CAAC,GAAG,EAAE,uBAAuB,EAAE,IAAI,EAAE,OAAO,EAAE;IAe3E,uBAAuB,CAAC,GAAG,EAAE,iBAAiB,EAAE,IAAI,EAAE,OAAO,EAAE;IA+B/D,mBAAmB,CAAC,IAAI,EAAE,OAAO,EAAE;IAUnC,cAAc,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;IAiB7D;;;;;;OAMG;IACH,UAAU;IASV;;OAEG;IACH,YAAY,CAAC,cAAc,EAAE,OAAO,EAAE;CAOvC"}
@@ -1,13 +1,26 @@
1
1
  import { __awaiter, __generator, __read, __rest, __spreadArray } from "tslib";
2
2
  import { Status } from '../types/status';
3
3
  import { INVALID_API_KEY, MAX_RETRIES_EXCEEDED_MESSAGE, MISSING_API_KEY_MESSAGE, SUCCESS_MESSAGE, UNEXPECTED_ERROR_MESSAGE, } from '../types/messages';
4
- import { STORAGE_PREFIX } from '../types/constants';
4
+ import { AMPLITUDE_BATCH_SERVER_URL, AMPLITUDE_SERVER_URL, EU_AMPLITUDE_BATCH_SERVER_URL, EU_AMPLITUDE_SERVER_URL, STORAGE_PREFIX, } from '../types/constants';
5
5
  import { chunk } from '../utils/chunk';
6
6
  import { buildResult } from '../utils/result-builder';
7
7
  import { createServerConfig, RequestMetadata } from '../config';
8
8
  import { UUID } from '../utils/uuid';
9
9
  import { isSuccessStatusCode } from '../utils/status-code';
10
10
  import { getStacktrace } from '../utils/debug';
11
+ var DEFAULT_AMPLITUDE_SERVER_URLS = new Set([
12
+ AMPLITUDE_SERVER_URL,
13
+ EU_AMPLITUDE_SERVER_URL,
14
+ AMPLITUDE_BATCH_SERVER_URL,
15
+ EU_AMPLITUDE_BATCH_SERVER_URL,
16
+ ]);
17
+ var shouldCompressUploadBodyForRequest = function (serverUrl, enableRequestBodyCompression) {
18
+ if (enableRequestBodyCompression === void 0) { enableRequestBodyCompression = false; }
19
+ if (DEFAULT_AMPLITUDE_SERVER_URLS.has(serverUrl)) {
20
+ return true;
21
+ }
22
+ return enableRequestBodyCompression;
23
+ };
11
24
  function getErrorMessage(error) {
12
25
  if (error instanceof Error)
13
26
  return error.message;
@@ -185,7 +198,7 @@ var Destination = /** @class */ (function () {
185
198
  var _a;
186
199
  if (useRetry === void 0) { useRetry = true; }
187
200
  return __awaiter(this, void 0, void 0, function () {
188
- var payload, serverUrl, res, e_1, errorMessage;
201
+ var payload, serverUrl, shouldCompressUploadBody, res, e_1, errorMessage;
189
202
  return __generator(this, function (_b) {
190
203
  switch (_b.label) {
191
204
  case 0:
@@ -210,7 +223,8 @@ var Destination = /** @class */ (function () {
210
223
  case 1:
211
224
  _b.trys.push([1, 3, , 4]);
212
225
  serverUrl = createServerConfig(this.config.serverUrl, this.config.serverZone, this.config.useBatch).serverUrl;
213
- return [4 /*yield*/, this.config.transportProvider.send(serverUrl, payload)];
226
+ shouldCompressUploadBody = shouldCompressUploadBodyForRequest(serverUrl, this.config.enableRequestBodyCompression);
227
+ return [4 /*yield*/, this.config.transportProvider.send(serverUrl, payload, this.config._enableRequestBodyCompressionExperimental && shouldCompressUploadBody)];
214
228
  case 2:
215
229
  res = _b.sent();
216
230
  if (res === null) {