@amplitude/analytics-core 2.34.0 → 2.35.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 (39) hide show
  1. package/lib/cjs/index.d.ts +1 -1
  2. package/lib/cjs/index.d.ts.map +1 -1
  3. package/lib/cjs/index.js.map +1 -1
  4. package/lib/cjs/transports/fetch.d.ts +2 -0
  5. package/lib/cjs/transports/fetch.d.ts.map +1 -1
  6. package/lib/cjs/transports/fetch.js +6 -6
  7. package/lib/cjs/transports/fetch.js.map +1 -1
  8. package/lib/cjs/types/client/browser-client.d.ts +5 -2
  9. package/lib/cjs/types/client/browser-client.d.ts.map +1 -1
  10. package/lib/cjs/types/client/browser-client.js.map +1 -1
  11. package/lib/cjs/types/config/browser-config.d.ts +2 -2
  12. package/lib/cjs/types/config/browser-config.d.ts.map +1 -1
  13. package/lib/cjs/types/config/browser-config.js.map +1 -1
  14. package/lib/cjs/types/page-url-enrichment.d.ts +3 -2
  15. package/lib/cjs/types/page-url-enrichment.d.ts.map +1 -1
  16. package/lib/cjs/types/page-url-enrichment.js.map +1 -1
  17. package/lib/cjs/types/transport.d.ts +5 -0
  18. package/lib/cjs/types/transport.d.ts.map +1 -1
  19. package/lib/cjs/types/transport.js.map +1 -1
  20. package/lib/esm/index.d.ts +1 -1
  21. package/lib/esm/index.d.ts.map +1 -1
  22. package/lib/esm/index.js.map +1 -1
  23. package/lib/esm/transports/fetch.d.ts +2 -0
  24. package/lib/esm/transports/fetch.d.ts.map +1 -1
  25. package/lib/esm/transports/fetch.js +7 -7
  26. package/lib/esm/transports/fetch.js.map +1 -1
  27. package/lib/esm/types/client/browser-client.d.ts +5 -2
  28. package/lib/esm/types/client/browser-client.d.ts.map +1 -1
  29. package/lib/esm/types/client/browser-client.js.map +1 -1
  30. package/lib/esm/types/config/browser-config.d.ts +2 -2
  31. package/lib/esm/types/config/browser-config.d.ts.map +1 -1
  32. package/lib/esm/types/config/browser-config.js.map +1 -1
  33. package/lib/esm/types/page-url-enrichment.d.ts +3 -2
  34. package/lib/esm/types/page-url-enrichment.d.ts.map +1 -1
  35. package/lib/esm/types/page-url-enrichment.js.map +1 -1
  36. package/lib/esm/types/transport.d.ts +5 -0
  37. package/lib/esm/types/transport.d.ts.map +1 -1
  38. package/lib/esm/types/transport.js.map +1 -1
  39. package/package.json +2 -2
@@ -39,7 +39,7 @@ export { IngestionMetadata } from './types/event/ingestion-metadata';
39
39
  export { ServerZoneType, ServerZone } from './types/server-zone';
40
40
  export { OfflineDisabled } from './types/offline';
41
41
  export { Plan } from './types/event/plan';
42
- export { TransportType, Transport } from './types/transport';
42
+ export { TransportType, Transport, TransportOptions, TransportTypeOrOptions } from './types/transport';
43
43
  export { Payload } from './types/payload';
44
44
  export { Response } from './types/response';
45
45
  export { UserSession } from './types/user-session';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,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;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,C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,OAAA;AACtB,mGAAA,QAAQ,OAAA;AACR,oGAAA,SAAS,OAAA;AACT,sGAAA,WAAW,OAAA;AA6Bb,iDAA4F;AAAnF,wGAAA,UAAU,OAAA;AAAE,sGAAA,QAAQ,OAAA;AAAE,mGAAA,KAAK,OAAA;AAAE,uGAAA,SAAS,OAAA","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 } 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 } 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 } from './types/storage';\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 } 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_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 { Status } from './types/status';\n\nexport { NetworkEventCallback, networkObserver } from './network-observer';\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"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAAA,6CAA8C;AAArC,4GAAA,aAAa,OAAA;AAItB,uCAAiD;AAAxC,oGAAA,QAAQ,OAAA;AACjB,qCAA+D;AAAtD,kGAAA,OAAO,OAAA;AAAY,0GAAA,eAAe,OAAA;AAC3C,qDAAoD;AAA3C,0GAAA,WAAW,OAAA;AACpB,+CAAyD;AAAhD,+GAAA,mBAAmB,OAAA;AAC5B,mCAAmD;AAA1C,gGAAA,MAAM,OAAA;AAAE,yGAAA,eAAe,OAAA;AAEhC,mCAAsD;AAA7C,gGAAA,MAAM,OAAA;AACf,+CAAgD;AAAvC,8GAAA,cAAc,OAAA;AACvB,6DAAwG;AA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U,OAAA;AACnC,2CAAkD;AAAzC,0GAAA,eAAe,OAAA;AAexB,qEAUsC;AANpC,sIAAA,8BAA8B,OAAA;AAC9B,qIAAA,6BAA6B,OAAA;AAC7B,sIAAA,8BAA8B,OAAA;AAMhC,6EAQ0C;AANxC,wIAAA,4BAA4B,OAAA;AAC5B,wIAAA,4BAA4B,OAAA;AAC5B,wIAAA,4BAA4B,OAAA;AAC5B,wIAAA,4BAA4B,OAAA;AAC5B,sJAAA,0CAA0C,OAAA;AAC1C,wIAAA,4BAA4B,OAAA;AAG9B,yCAAwC;AAA/B,gGAAA,MAAM,OAAA;AAEf,uDAA2E;AAAlE,wHAAA,oBAAoB,OAAA;AAAE,mHAAA,eAAe,OAAA;AAC9C,iEAAiH;AAAxG,4HAAA,mBAAmB,OAAA;AAE5B,+CAAoE;AAA3D,yGAAA,YAAY,OAAA;AAAE,8GAAA,iBAAiB,OAAA;AAMxC,+CAAqE;AAA5D,wGAAA,WAAW,OAAA;AAAE,0GAAA,aAAa,OAAA;AAAE,iGAAA,IAAI,OAAA;AACzC,8DAA4D;AAAnD,iHAAA,cAAc,OAAA;AACvB,6CAQ2B;AAPzB,uGAAA,YAAY,OAAA;AACZ,8GAAA,mBAAmB,OAAA;AACnB,4GAAA,iBAAiB,OAAA;AACjB,iHAAA,sBAAsB,OAAA;AACtB,mGAAA,QAAQ,OAAA;AACR,oGAAA,SAAS,OAAA;AACT,sGAAA,WAAW,OAAA;AA6Bb,iDAA4F;AAAnF,wGAAA,UAAU,OAAA;AAAE,sGAAA,QAAQ,OAAA;AAAE,mGAAA,KAAK,OAAA;AAAE,uGAAA,SAAS,OAAA","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 } 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 } 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 } from './types/storage';\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_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 { Status } from './types/status';\n\nexport { NetworkEventCallback, networkObserver } from './network-observer';\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"]}
@@ -3,6 +3,8 @@ import { Transport } from '../types/transport';
3
3
  import { Payload } from '../types/payload';
4
4
  import { Response } from '../types/response';
5
5
  export declare class FetchTransport extends BaseTransport implements Transport {
6
+ private customHeaders;
7
+ constructor(customHeaders?: Record<string, string>);
6
8
  send(serverUrl: string, payload: Payload): Promise<Response | null>;
7
9
  }
8
10
  //# sourceMappingURL=fetch.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../../src/transports/fetch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,qBAAa,cAAe,SAAQ,aAAc,YAAW,SAAS;IAC9D,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC;CAsB1E"}
1
+ {"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../../src/transports/fetch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,qBAAa,cAAe,SAAQ,aAAc,YAAW,SAAS;IACpE,OAAO,CAAC,aAAa,CAAyB;gBAElC,aAAa,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM;IAKhD,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC;CAuB1E"}
@@ -5,8 +5,11 @@ var tslib_1 = require("tslib");
5
5
  var base_1 = require("./base");
6
6
  var FetchTransport = /** @class */ (function (_super) {
7
7
  tslib_1.__extends(FetchTransport, _super);
8
- function FetchTransport() {
9
- return _super !== null && _super.apply(this, arguments) || this;
8
+ function FetchTransport(customHeaders) {
9
+ if (customHeaders === void 0) { customHeaders = {}; }
10
+ var _this = _super.call(this) || this;
11
+ _this.customHeaders = customHeaders;
12
+ return _this;
10
13
  }
11
14
  FetchTransport.prototype.send = function (serverUrl, payload) {
12
15
  return tslib_1.__awaiter(this, void 0, void 0, function () {
@@ -19,10 +22,7 @@ var FetchTransport = /** @class */ (function (_super) {
19
22
  throw new Error('FetchTransport is not supported');
20
23
  }
21
24
  options = {
22
- headers: {
23
- 'Content-Type': 'application/json',
24
- Accept: '*/*',
25
- },
25
+ headers: tslib_1.__assign({ 'Content-Type': 'application/json', Accept: '*/*' }, this.customHeaders),
26
26
  body: JSON.stringify(payload),
27
27
  method: 'POST',
28
28
  };
@@ -1 +1 @@
1
- {"version":3,"file":"fetch.js","sourceRoot":"","sources":["../../../src/transports/fetch.ts"],"names":[],"mappings":";;;;AAAA,+BAAuC;AAKvC;IAAoC,0CAAa;IAAjD;;IAuBA,CAAC;IAtBO,6BAAI,GAAV,UAAW,SAAiB,EAAE,OAAgB;;;;;;wBAC5C,wBAAwB;wBACxB,IAAI,OAAO,KAAK,KAAK,WAAW,EAAE;4BAChC,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;yBACpD;wBACK,OAAO,GAAgB;4BAC3B,OAAO,EAAE;gCACP,cAAc,EAAE,kBAAkB;gCAClC,MAAM,EAAE,KAAK;6BACd;4BACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC;4BAC7B,MAAM,EAAE,MAAM;yBACf,CAAC;wBACe,qBAAM,KAAK,CAAC,SAAS,EAAE,OAAO,CAAC,EAAA;;wBAA1C,QAAQ,GAAG,SAA+B;wBAC3B,qBAAM,QAAQ,CAAC,IAAI,EAAE,EAAA;;wBAApC,YAAY,GAAG,SAAqB;wBAC1C,IAAI;4BACF,iEAAiE;4BACjE,sBAAO,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,EAAC;yBACrD;wBAAC,WAAM;4BACN,sBAAO,IAAI,CAAC,aAAa,CAAC,EAAE,IAAI,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAC;yBACtD;;;;;KACF;IACH,qBAAC;AAAD,CAAC,AAvBD,CAAoC,oBAAa,GAuBhD;AAvBY,wCAAc","sourcesContent":["import { BaseTransport } from './base';\nimport { Transport } from '../types/transport';\nimport { Payload } from '../types/payload';\nimport { Response } from '../types/response';\n\nexport class FetchTransport extends BaseTransport implements Transport {\n async send(serverUrl: string, payload: Payload): Promise<Response | null> {\n /* istanbul ignore if */\n if (typeof fetch === 'undefined') {\n throw new Error('FetchTransport is not supported');\n }\n const options: RequestInit = {\n headers: {\n 'Content-Type': 'application/json',\n Accept: '*/*',\n },\n body: JSON.stringify(payload),\n method: 'POST',\n };\n const response = await fetch(serverUrl, options);\n const responseText = await response.text();\n try {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n return this.buildResponse(JSON.parse(responseText));\n } catch {\n return this.buildResponse({ code: response.status });\n }\n }\n}\n"]}
1
+ {"version":3,"file":"fetch.js","sourceRoot":"","sources":["../../../src/transports/fetch.ts"],"names":[],"mappings":";;;;AAAA,+BAAuC;AAKvC;IAAoC,0CAAa;IAG/C,wBAAY,aAA0C;QAA1C,8BAAA,EAAA,kBAA0C;QAAtD,YACE,iBAAO,SAER;QADC,KAAI,CAAC,aAAa,GAAG,aAAa,CAAC;;IACrC,CAAC;IAEK,6BAAI,GAAV,UAAW,SAAiB,EAAE,OAAgB;;;;;;wBAC5C,wBAAwB;wBACxB,IAAI,OAAO,KAAK,KAAK,WAAW,EAAE;4BAChC,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;yBACpD;wBACK,OAAO,GAAgB;4BAC3B,OAAO,qBACL,cAAc,EAAE,kBAAkB,EAClC,MAAM,EAAE,KAAK,IACV,IAAI,CAAC,aAAa,CACtB;4BACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC;4BAC7B,MAAM,EAAE,MAAM;yBACf,CAAC;wBACe,qBAAM,KAAK,CAAC,SAAS,EAAE,OAAO,CAAC,EAAA;;wBAA1C,QAAQ,GAAG,SAA+B;wBAC3B,qBAAM,QAAQ,CAAC,IAAI,EAAE,EAAA;;wBAApC,YAAY,GAAG,SAAqB;wBAC1C,IAAI;4BACF,iEAAiE;4BACjE,sBAAO,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,EAAC;yBACrD;wBAAC,WAAM;4BACN,sBAAO,IAAI,CAAC,aAAa,CAAC,EAAE,IAAI,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAC;yBACtD;;;;;KACF;IACH,qBAAC;AAAD,CAAC,AA/BD,CAAoC,oBAAa,GA+BhD;AA/BY,wCAAc","sourcesContent":["import { BaseTransport } from './base';\nimport { Transport } from '../types/transport';\nimport { Payload } from '../types/payload';\nimport { Response } from '../types/response';\n\nexport class FetchTransport extends BaseTransport implements Transport {\n private customHeaders: Record<string, string>;\n\n constructor(customHeaders: Record<string, string> = {}) {\n super();\n this.customHeaders = customHeaders;\n }\n\n async send(serverUrl: string, payload: Payload): Promise<Response | null> {\n /* istanbul ignore if */\n if (typeof fetch === 'undefined') {\n throw new Error('FetchTransport is not supported');\n }\n const options: RequestInit = {\n headers: {\n 'Content-Type': 'application/json',\n Accept: '*/*',\n ...this.customHeaders,\n },\n body: JSON.stringify(payload),\n method: 'POST',\n };\n const response = await fetch(serverUrl, options);\n const responseText = await response.text();\n try {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n return this.buildResponse(JSON.parse(responseText));\n } catch {\n return this.buildResponse({ code: response.status });\n }\n }\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { TransportType } from '../transport';
1
+ import { TransportTypeOrOptions } from '../transport';
2
2
  import { Client } from './core-client';
3
3
  import { AnalyticsIdentity, Plugin } from '../plugin';
4
4
  import { AmplitudeReturn } from '../../utils/return-wrapper';
@@ -26,9 +26,12 @@ export interface BrowserClient extends Client {
26
26
  *
27
27
  * // Use navigator.sendBeacon API
28
28
  * setTransport('beacon');
29
+ *
30
+ * // Use Fetch API with custom headers
31
+ * setTransport({ type: 'fetch', headers: { 'X-Custom-Header': 'value' } });
29
32
  * ```
30
33
  */
31
- setTransport(transport: TransportType): void;
34
+ setTransport(transport: TransportTypeOrOptions): void;
32
35
  /**
33
36
  * Adds a new plugin.
34
37
  *
@@ -1 +1 @@
1
- {"version":3,"file":"browser-client.d.ts","sourceRoot":"","sources":["../../../../src/types/client/browser-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,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,MAA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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,CAAC,MAAM,EAAE,MAAM,CAAC,aAAa,EAAE,aAAa,CAAC,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC;IAEzE;;;;;;OAMG;IACH,WAAW,IAAI,iBAAiB,CAAC;IAEjC;;;;;;OAMG;IACH,SAAS,IAAI,OAAO,GAAG,SAAS,CAAC;IAEjC;;;;;;;OAOG;IACH,yBAAyB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CACrD"}
@@ -1 +1 @@
1
- {"version":3,"file":"browser-client.js","sourceRoot":"","sources":["../../../../src/types/client/browser-client.ts"],"names":[],"mappings":"","sourcesContent":["import { TransportType } 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 */\n setTransport(transport: TransportType): 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 * 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 * 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,6 +1,6 @@
1
1
  import { UserSession } from '../user-session';
2
2
  import { IdentityStorageType, Storage } from '../storage';
3
- import { Transport } from '../transport';
3
+ import { Transport, TransportTypeOrOptions } from '../transport';
4
4
  import { IConfig } from './core-config';
5
5
  import { ElementInteractionsOptions } from '../element-interactions';
6
6
  import { PageTrackingOptions } from '../page-view-tracking';
@@ -67,7 +67,7 @@ export interface ExternalBrowserConfig extends IConfig {
67
67
  * Network transport mechanism used to send events.
68
68
  * @defaultValue `"fetch"`
69
69
  */
70
- transport?: 'fetch' | 'xhr' | 'beacon';
70
+ transport?: TransportTypeOrOptions;
71
71
  /**
72
72
  * The identifier for the user being tracked.
73
73
  * @defaultValue `undefined`
@@ -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,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,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QAAQ,GAAG,mBAAmB,GAAG,iBAAiB,CAAC;AAGxE,MAAM,WAAW,cAAe,SAAQ,IAAI,CAAC,OAAO,CAAC,qBAAqB,CAAC,EAAE,aAAa,CAAC;CAAG"}
@@ -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 } from '../transport';\nimport { IConfig } from './core-config';\nimport { ElementInteractionsOptions } from '../element-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?: 'fetch' | 'xhr' | 'beacon';\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}\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.\n * @defaultValue `true`\n */\n formInteractions?: boolean;\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.\n * @defaultValue `true`\n */\n formInteractions?: boolean;\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":"","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 { 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}\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.\n * @defaultValue `true`\n */\n formInteractions?: boolean;\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.\n * @defaultValue `true`\n */\n formInteractions?: boolean;\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,6 +1,7 @@
1
1
  /**
2
2
  * @experimental this feature is experimental and may not be stable
3
- * Using an empty object for now until we have actual options
4
3
  */
5
- export type PageUrlEnrichmentOptions = Record<string, never>;
4
+ export type PageUrlEnrichmentOptions = {
5
+ internalDomains?: string[];
6
+ };
6
7
  //# sourceMappingURL=page-url-enrichment.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"page-url-enrichment.d.ts","sourceRoot":"","sources":["../../../src/types/page-url-enrichment.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,MAAM,wBAAwB,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC"}
1
+ {"version":3,"file":"page-url-enrichment.d.ts","sourceRoot":"","sources":["../../../src/types/page-url-enrichment.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG;IAIrC,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;CAC5B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"page-url-enrichment.js","sourceRoot":"","sources":["../../../src/types/page-url-enrichment.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * @experimental this feature is experimental and may not be stable\n * Using an empty object for now until we have actual options\n */\nexport type PageUrlEnrichmentOptions = Record<string, never>;\n"]}
1
+ {"version":3,"file":"page-url-enrichment.js","sourceRoot":"","sources":["../../../src/types/page-url-enrichment.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * @experimental this feature is experimental and may not be stable\n */\nexport type PageUrlEnrichmentOptions = {\n // a list of domains that are to be considered internal, e.g. 'example.com', 'example.co.uk'.\n // Previous Page URLs will be matched to these strings to determine the Previous Page URL type.\n // Adding the domain is sufficient, there is no need to add the subdomain.\n internalDomains?: string[];\n};\n"]}
@@ -4,4 +4,9 @@ export interface Transport {
4
4
  send(serverUrl: string, payload: Payload): Promise<Response | null>;
5
5
  }
6
6
  export type TransportType = 'xhr' | 'beacon' | 'fetch';
7
+ export interface TransportOptions {
8
+ type?: TransportType;
9
+ headers?: Record<string, string>;
10
+ }
11
+ export type TransportTypeOrOptions = TransportType | TransportOptions;
7
12
  //# sourceMappingURL=transport.d.ts.map
@@ -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"}
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 +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"]}
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"]}
@@ -39,7 +39,7 @@ export { IngestionMetadata } from './types/event/ingestion-metadata';
39
39
  export { ServerZoneType, ServerZone } from './types/server-zone';
40
40
  export { OfflineDisabled } from './types/offline';
41
41
  export { Plan } from './types/event/plan';
42
- export { TransportType, Transport } from './types/transport';
42
+ export { TransportType, Transport, TransportOptions, TransportTypeOrOptions } from './types/transport';
43
43
  export { Payload } from './types/payload';
44
44
  export { Response } from './types/response';
45
45
  export { UserSession } from './types/user-session';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceR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B,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAelD,OAAO,EAIL,8BAA8B,EAC9B,6BAA6B,EAC7B,8BAA8B,GAI/B,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAEL,4BAA4B,EAC5B,4BAA4B,EAC5B,4BAA4B,EAC5B,4BAA4B,EAC5B,0CAA0C,EAC1C,4BAA4B,GAC7B,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC3E,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","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 } 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 } 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 } from './types/storage';\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 } 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_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 { Status } from './types/status';\n\nexport { NetworkEventCallback, networkObserver } from './network-observer';\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"]}
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,EAAa,MAAM,YAAY,CAAC;AACjD,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,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EA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D,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","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 } 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 } 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 } from './types/storage';\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_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 { Status } from './types/status';\n\nexport { NetworkEventCallback, networkObserver } from './network-observer';\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"]}
@@ -3,6 +3,8 @@ import { Transport } from '../types/transport';
3
3
  import { Payload } from '../types/payload';
4
4
  import { Response } from '../types/response';
5
5
  export declare class FetchTransport extends BaseTransport implements Transport {
6
+ private customHeaders;
7
+ constructor(customHeaders?: Record<string, string>);
6
8
  send(serverUrl: string, payload: Payload): Promise<Response | null>;
7
9
  }
8
10
  //# sourceMappingURL=fetch.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../../src/transports/fetch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,qBAAa,cAAe,SAAQ,aAAc,YAAW,SAAS;IAC9D,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC;CAsB1E"}
1
+ {"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../../src/transports/fetch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,qBAAa,cAAe,SAAQ,aAAc,YAAW,SAAS;IACpE,OAAO,CAAC,aAAa,CAAyB;gBAElC,aAAa,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM;IAKhD,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC;CAuB1E"}
@@ -1,9 +1,12 @@
1
- import { __awaiter, __extends, __generator } from "tslib";
1
+ import { __assign, __awaiter, __extends, __generator } from "tslib";
2
2
  import { BaseTransport } from './base';
3
3
  var FetchTransport = /** @class */ (function (_super) {
4
4
  __extends(FetchTransport, _super);
5
- function FetchTransport() {
6
- return _super !== null && _super.apply(this, arguments) || this;
5
+ function FetchTransport(customHeaders) {
6
+ if (customHeaders === void 0) { customHeaders = {}; }
7
+ var _this = _super.call(this) || this;
8
+ _this.customHeaders = customHeaders;
9
+ return _this;
7
10
  }
8
11
  FetchTransport.prototype.send = function (serverUrl, payload) {
9
12
  return __awaiter(this, void 0, void 0, function () {
@@ -16,10 +19,7 @@ var FetchTransport = /** @class */ (function (_super) {
16
19
  throw new Error('FetchTransport is not supported');
17
20
  }
18
21
  options = {
19
- headers: {
20
- 'Content-Type': 'application/json',
21
- Accept: '*/*',
22
- },
22
+ headers: __assign({ 'Content-Type': 'application/json', Accept: '*/*' }, this.customHeaders),
23
23
  body: JSON.stringify(payload),
24
24
  method: 'POST',
25
25
  };
@@ -1 +1 @@
1
- {"version":3,"file":"fetch.js","sourceRoot":"","sources":["../../../src/transports/fetch.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAKvC;IAAoC,kCAAa;IAAjD;;IAuBA,CAAC;IAtBO,6BAAI,GAAV,UAAW,SAAiB,EAAE,OAAgB;;;;;;wBAC5C,wBAAwB;wBACxB,IAAI,OAAO,KAAK,KAAK,WAAW,EAAE;4BAChC,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;yBACpD;wBACK,OAAO,GAAgB;4BAC3B,OAAO,EAAE;gCACP,cAAc,EAAE,kBAAkB;gCAClC,MAAM,EAAE,KAAK;6BACd;4BACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC;4BAC7B,MAAM,EAAE,MAAM;yBACf,CAAC;wBACe,qBAAM,KAAK,CAAC,SAAS,EAAE,OAAO,CAAC,EAAA;;wBAA1C,QAAQ,GAAG,SAA+B;wBAC3B,qBAAM,QAAQ,CAAC,IAAI,EAAE,EAAA;;wBAApC,YAAY,GAAG,SAAqB;wBAC1C,IAAI;4BACF,iEAAiE;4BACjE,sBAAO,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,EAAC;yBACrD;wBAAC,WAAM;4BACN,sBAAO,IAAI,CAAC,aAAa,CAAC,EAAE,IAAI,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAC;yBACtD;;;;;KACF;IACH,qBAAC;AAAD,CAAC,AAvBD,CAAoC,aAAa,GAuBhD","sourcesContent":["import { BaseTransport } from './base';\nimport { Transport } from '../types/transport';\nimport { Payload } from '../types/payload';\nimport { Response } from '../types/response';\n\nexport class FetchTransport extends BaseTransport implements Transport {\n async send(serverUrl: string, payload: Payload): Promise<Response | null> {\n /* istanbul ignore if */\n if (typeof fetch === 'undefined') {\n throw new Error('FetchTransport is not supported');\n }\n const options: RequestInit = {\n headers: {\n 'Content-Type': 'application/json',\n Accept: '*/*',\n },\n body: JSON.stringify(payload),\n method: 'POST',\n };\n const response = await fetch(serverUrl, options);\n const responseText = await response.text();\n try {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n return this.buildResponse(JSON.parse(responseText));\n } catch {\n return this.buildResponse({ code: response.status });\n }\n }\n}\n"]}
1
+ {"version":3,"file":"fetch.js","sourceRoot":"","sources":["../../../src/transports/fetch.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAKvC;IAAoC,kCAAa;IAG/C,wBAAY,aAA0C;QAA1C,8BAAA,EAAA,kBAA0C;QAAtD,YACE,iBAAO,SAER;QADC,KAAI,CAAC,aAAa,GAAG,aAAa,CAAC;;IACrC,CAAC;IAEK,6BAAI,GAAV,UAAW,SAAiB,EAAE,OAAgB;;;;;;wBAC5C,wBAAwB;wBACxB,IAAI,OAAO,KAAK,KAAK,WAAW,EAAE;4BAChC,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;yBACpD;wBACK,OAAO,GAAgB;4BAC3B,OAAO,aACL,cAAc,EAAE,kBAAkB,EAClC,MAAM,EAAE,KAAK,IACV,IAAI,CAAC,aAAa,CACtB;4BACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC;4BAC7B,MAAM,EAAE,MAAM;yBACf,CAAC;wBACe,qBAAM,KAAK,CAAC,SAAS,EAAE,OAAO,CAAC,EAAA;;wBAA1C,QAAQ,GAAG,SAA+B;wBAC3B,qBAAM,QAAQ,CAAC,IAAI,EAAE,EAAA;;wBAApC,YAAY,GAAG,SAAqB;wBAC1C,IAAI;4BACF,iEAAiE;4BACjE,sBAAO,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,EAAC;yBACrD;wBAAC,WAAM;4BACN,sBAAO,IAAI,CAAC,aAAa,CAAC,EAAE,IAAI,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAC;yBACtD;;;;;KACF;IACH,qBAAC;AAAD,CAAC,AA/BD,CAAoC,aAAa,GA+BhD","sourcesContent":["import { BaseTransport } from './base';\nimport { Transport } from '../types/transport';\nimport { Payload } from '../types/payload';\nimport { Response } from '../types/response';\n\nexport class FetchTransport extends BaseTransport implements Transport {\n private customHeaders: Record<string, string>;\n\n constructor(customHeaders: Record<string, string> = {}) {\n super();\n this.customHeaders = customHeaders;\n }\n\n async send(serverUrl: string, payload: Payload): Promise<Response | null> {\n /* istanbul ignore if */\n if (typeof fetch === 'undefined') {\n throw new Error('FetchTransport is not supported');\n }\n const options: RequestInit = {\n headers: {\n 'Content-Type': 'application/json',\n Accept: '*/*',\n ...this.customHeaders,\n },\n body: JSON.stringify(payload),\n method: 'POST',\n };\n const response = await fetch(serverUrl, options);\n const responseText = await response.text();\n try {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n return this.buildResponse(JSON.parse(responseText));\n } catch {\n return this.buildResponse({ code: response.status });\n }\n }\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { TransportType } from '../transport';
1
+ import { TransportTypeOrOptions } from '../transport';
2
2
  import { Client } from './core-client';
3
3
  import { AnalyticsIdentity, Plugin } from '../plugin';
4
4
  import { AmplitudeReturn } from '../../utils/return-wrapper';
@@ -26,9 +26,12 @@ export interface BrowserClient extends Client {
26
26
  *
27
27
  * // Use navigator.sendBeacon API
28
28
  * setTransport('beacon');
29
+ *
30
+ * // Use Fetch API with custom headers
31
+ * setTransport({ type: 'fetch', headers: { 'X-Custom-Header': 'value' } });
29
32
  * ```
30
33
  */
31
- setTransport(transport: TransportType): void;
34
+ setTransport(transport: TransportTypeOrOptions): void;
32
35
  /**
33
36
  * Adds a new plugin.
34
37
  *
@@ -1 +1 @@
1
- {"version":3,"file":"browser-client.d.ts","sourceRoot":"","sources":["../../../../src/types/client/browser-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,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;;;;;;;;;;;;;OAaG;IACH,YAAY,CAAC,SAAS,EAAE,aAAa,GAAG,IAAI,CAAC;IAE7C;;;;;;;;;;;;;;;;OAgBG;IACH,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,aAAa,EAAE,aAAa,CAAC,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC;IAEzE;;;;;;OAMG;IACH,WAAW,IAAI,iBAAiB,CAA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"version":3,"file":"browser-client.js","sourceRoot":"","sources":["../../../../src/types/client/browser-client.ts"],"names":[],"mappings":"","sourcesContent":["import { TransportType } 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 */\n setTransport(transport: TransportType): 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 * 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 * 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,6 +1,6 @@
1
1
  import { UserSession } from '../user-session';
2
2
  import { IdentityStorageType, Storage } from '../storage';
3
- import { Transport } from '../transport';
3
+ import { Transport, TransportTypeOrOptions } from '../transport';
4
4
  import { IConfig } from './core-config';
5
5
  import { ElementInteractionsOptions } from '../element-interactions';
6
6
  import { PageTrackingOptions } from '../page-view-tracking';
@@ -67,7 +67,7 @@ export interface ExternalBrowserConfig extends IConfig {
67
67
  * Network transport mechanism used to send events.
68
68
  * @defaultValue `"fetch"`
69
69
  */
70
- transport?: 'fetch' | 'xhr' | 'beacon';
70
+ transport?: TransportTypeOrOptions;
71
71
  /**
72
72
  * The identifier for the user being tracked.
73
73
  * @defaultValue `undefined`
@@ -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,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,8BAA8B,EAAE,MAAM,6BAA6B,CAAC;AAC7E,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAC1E,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAExE,MAAM,WAAW,aAAc,SAAQ,qBAAqB,EAAE,qBAAqB;CAAG;AAEtF,MAAM,WAAW,qBAAsB,SAAQ,OAAO;IACpD;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;;OAKG;IACH,eAAe,CAAC,E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,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,gBAAgB,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;IACvC;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;;OAGG;IACH,yBAAyB,CAAC,EAAE,OAAO,CAAC;CACrC;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,CAAC;AAGxE,MAAM,WAAW,cAAe,SAAQ,IAAI,CAAC,OAAO,CAAC,qBAAqB,CAAC,EAAE,aAAa,CAAC;CAAG"}
@@ -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 } from '../transport';\nimport { IConfig } from './core-config';\nimport { ElementInteractionsOptions } from '../element-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?: 'fetch' | 'xhr' | 'beacon';\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}\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.\n * @defaultValue `true`\n */\n formInteractions?: boolean;\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.\n * @defaultValue `true`\n */\n formInteractions?: boolean;\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":"","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 { 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}\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.\n * @defaultValue `true`\n */\n formInteractions?: boolean;\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.\n * @defaultValue `true`\n */\n formInteractions?: boolean;\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,6 +1,7 @@
1
1
  /**
2
2
  * @experimental this feature is experimental and may not be stable
3
- * Using an empty object for now until we have actual options
4
3
  */
5
- export type PageUrlEnrichmentOptions = Record<string, never>;
4
+ export type PageUrlEnrichmentOptions = {
5
+ internalDomains?: string[];
6
+ };
6
7
  //# sourceMappingURL=page-url-enrichment.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"page-url-enrichment.d.ts","sourceRoot":"","sources":["../../../src/types/page-url-enrichment.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,MAAM,wBAAwB,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC"}
1
+ {"version":3,"file":"page-url-enrichment.d.ts","sourceRoot":"","sources":["../../../src/types/page-url-enrichment.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG;IAIrC,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;CAC5B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"page-url-enrichment.js","sourceRoot":"","sources":["../../../src/types/page-url-enrichment.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * @experimental this feature is experimental and may not be stable\n * Using an empty object for now until we have actual options\n */\nexport type PageUrlEnrichmentOptions = Record<string, never>;\n"]}
1
+ {"version":3,"file":"page-url-enrichment.js","sourceRoot":"","sources":["../../../src/types/page-url-enrichment.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * @experimental this feature is experimental and may not be stable\n */\nexport type PageUrlEnrichmentOptions = {\n // a list of domains that are to be considered internal, e.g. 'example.com', 'example.co.uk'.\n // Previous Page URLs will be matched to these strings to determine the Previous Page URL type.\n // Adding the domain is sufficient, there is no need to add the subdomain.\n internalDomains?: string[];\n};\n"]}
@@ -4,4 +4,9 @@ export interface Transport {
4
4
  send(serverUrl: string, payload: Payload): Promise<Response | null>;
5
5
  }
6
6
  export type TransportType = 'xhr' | 'beacon' | 'fetch';
7
+ export interface TransportOptions {
8
+ type?: TransportType;
9
+ headers?: Record<string, string>;
10
+ }
11
+ export type TransportTypeOrOptions = TransportType | TransportOptions;
7
12
  //# sourceMappingURL=transport.d.ts.map
@@ -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"}
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 +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"]}
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"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amplitude/analytics-core",
3
- "version": "2.34.0",
3
+ "version": "2.35.0",
4
4
  "description": "",
5
5
  "author": "Amplitude Inc",
6
6
  "homepage": "https://github.com/amplitude/Amplitude-TypeScript",
@@ -43,5 +43,5 @@
43
43
  "files": [
44
44
  "lib"
45
45
  ],
46
- "gitHead": "943117bdca14e1fee4e5d37d8f1932cac2b0f39b"
46
+ "gitHead": "9b4b123bd1dfed030e6a5857de7a8ee7d52d6f40"
47
47
  }