@amplitude/analytics-types 2.6.0 → 2.7.0-featureremoteconfig.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 (41) hide show
  1. package/lib/cjs/config/browser.d.ts +53 -1
  2. package/lib/cjs/config/browser.d.ts.map +1 -1
  3. package/lib/cjs/config/browser.js.map +1 -1
  4. package/lib/cjs/config/core.d.ts +18 -0
  5. package/lib/cjs/config/core.d.ts.map +1 -1
  6. package/lib/cjs/config/core.js.map +1 -1
  7. package/lib/cjs/config/index.d.ts +2 -2
  8. package/lib/cjs/config/index.d.ts.map +1 -1
  9. package/lib/cjs/config/index.js.map +1 -1
  10. package/lib/cjs/element-interactions.d.ts +61 -0
  11. package/lib/cjs/element-interactions.d.ts.map +1 -0
  12. package/lib/cjs/element-interactions.js +26 -0
  13. package/lib/cjs/element-interactions.js.map +1 -0
  14. package/lib/cjs/index.d.ts +2 -1
  15. package/lib/cjs/index.d.ts.map +1 -1
  16. package/lib/cjs/index.js +4 -1
  17. package/lib/cjs/index.js.map +1 -1
  18. package/lib/cjs/payload.d.ts +2 -0
  19. package/lib/cjs/payload.d.ts.map +1 -1
  20. package/lib/cjs/payload.js.map +1 -1
  21. package/lib/esm/config/browser.d.ts +53 -1
  22. package/lib/esm/config/browser.d.ts.map +1 -1
  23. package/lib/esm/config/browser.js.map +1 -1
  24. package/lib/esm/config/core.d.ts +18 -0
  25. package/lib/esm/config/core.d.ts.map +1 -1
  26. package/lib/esm/config/core.js.map +1 -1
  27. package/lib/esm/config/index.d.ts +2 -2
  28. package/lib/esm/config/index.d.ts.map +1 -1
  29. package/lib/esm/config/index.js.map +1 -1
  30. package/lib/esm/element-interactions.d.ts +61 -0
  31. package/lib/esm/element-interactions.d.ts.map +1 -0
  32. package/lib/esm/element-interactions.js +24 -0
  33. package/lib/esm/element-interactions.js.map +1 -0
  34. package/lib/esm/index.d.ts +2 -1
  35. package/lib/esm/index.d.ts.map +1 -1
  36. package/lib/esm/index.js +1 -0
  37. package/lib/esm/index.js.map +1 -1
  38. package/lib/esm/payload.d.ts +2 -0
  39. package/lib/esm/payload.d.ts.map +1 -1
  40. package/lib/esm/payload.js.map +1 -1
  41. package/package.json +2 -2
@@ -3,6 +3,7 @@ import { IdentityStorageType, Storage } from '../storage';
3
3
  import { Transport } from '../transport';
4
4
  import { Config } from './core';
5
5
  import { PageTrackingOptions } from '../page-view-tracking';
6
+ import { ElementInteractionsOptions } from '../element-interactions';
6
7
  export interface BrowserConfig extends ExternalBrowserConfig, InternalBrowserConfig {
7
8
  }
8
9
  export interface ExternalBrowserConfig extends Config {
@@ -12,11 +13,17 @@ export interface ExternalBrowserConfig extends Config {
12
13
  */
13
14
  appVersion?: string;
14
15
  /**
16
+ * @deprecated This property is deprecated and will be removed in future versions. Please migrate to using `autocapture` instead.
15
17
  * The default event tracking configuration.
16
18
  * See {@link https://www.docs.developers.amplitude.com/data/sdks/browser-2/#tracking-default-events}.
17
19
  * @defaultValue `true`
18
20
  */
19
21
  defaultTracking?: boolean | DefaultTrackingOptions;
22
+ /**
23
+ * The configurations for auto-captured events.
24
+ * See {@link https://www.docs.developers.amplitude.com/data/sdks/browser-2/autocapture/}.
25
+ */
26
+ autocapture?: boolean | AutocaptureOptions;
20
27
  /**
21
28
  * The identifier for the device running your application.
22
29
  * @defaultValue `UUID()`
@@ -67,6 +74,11 @@ export interface ExternalBrowserConfig extends Config {
67
74
  * Used for landing page analysis.
68
75
  */
69
76
  pageCounter?: number;
77
+ /**
78
+ * Whether to fetch remote configuration.
79
+ * @defaultValue `false`
80
+ */
81
+ fetchRemoteConfig?: boolean;
70
82
  }
71
83
  interface InternalBrowserConfig {
72
84
  cookieStorage: Storage<UserSession>;
@@ -74,6 +86,9 @@ interface InternalBrowserConfig {
74
86
  lastEventId?: number;
75
87
  transportProvider: Transport;
76
88
  }
89
+ /**
90
+ * @deprecated This interface is deprecated and will be removed in future versions. Please migrate to using `AutocaptureOptions` instead.
91
+ */
77
92
  export interface DefaultTrackingOptions {
78
93
  /**
79
94
  * Enables/disables marketing attribution tracking or config with detailed attribution options.
@@ -101,6 +116,38 @@ export interface DefaultTrackingOptions {
101
116
  */
102
117
  sessions?: boolean;
103
118
  }
119
+ export interface AutocaptureOptions {
120
+ /**
121
+ * Enables/disables marketing attribution tracking or config with detailed attribution options.
122
+ * @defaultValue `true`
123
+ */
124
+ attribution?: boolean | AttributionOptions;
125
+ /**
126
+ * Enables/disables form downloads tracking.
127
+ * @defaultValue `true`
128
+ */
129
+ fileDownloads?: boolean;
130
+ /**
131
+ * Enables/disables form interaction tracking.
132
+ * @defaultValue `true`
133
+ */
134
+ formInteractions?: boolean;
135
+ /**
136
+ * Enables/disables default page view tracking.
137
+ * @defaultValue `true`
138
+ */
139
+ pageViews?: boolean | PageTrackingOptions;
140
+ /**
141
+ * Enables/disables session tracking.
142
+ * @defaultValue `true`
143
+ */
144
+ sessions?: boolean;
145
+ /**
146
+ * Enables/disables user interactions tracking.
147
+ * @defaultValue `false`
148
+ */
149
+ elementInteractions?: boolean | ElementInteractionsOptions;
150
+ }
104
151
  export interface TrackingOptions {
105
152
  /**
106
153
  * Enables/disables ip address tracking.
@@ -162,8 +209,13 @@ export interface CookieOptions {
162
209
  */
163
210
  upgrade?: boolean;
164
211
  }
165
- type HiddenOptions = 'apiKey' | 'transportProvider';
212
+ type HiddenOptions = 'apiKey' | 'transportProvider' | 'requestMetadata';
166
213
  export interface BrowserOptions extends Omit<Partial<ExternalBrowserConfig>, HiddenOptions> {
167
214
  }
215
+ export type BrowserRemoteConfig = {
216
+ browserSDK: {
217
+ autocapture?: AutocaptureOptions | boolean;
218
+ };
219
+ };
168
220
  export {};
169
221
  //# sourceMappingURL=browser.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../../src/config/browser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAA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;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;AAE9F,MAAM,MAAM,mBAAmB,GAAG;IAChC,UAAU,EAAE;QACV,WAAW,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC;KAC5C,CAAC;CACH,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"browser.js","sourceRoot":"","sources":["../../../src/config/browser.ts"],"names":[],"mappings":"","sourcesContent":["import { UserSession } from '../user-session';\nimport { IdentityStorageType, Storage } from '../storage';\nimport { Transport } from '../transport';\nimport { Config } from './core';\nimport { PageTrackingOptions } from '../page-view-tracking';\n\nexport interface BrowserConfig extends ExternalBrowserConfig, InternalBrowserConfig {}\n\nexport interface ExternalBrowserConfig extends Config {\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 * 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 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\ninterface InternalBrowserConfig {\n cookieStorage: Storage<UserSession>;\n lastEventTime?: number;\n lastEventId?: number;\n transportProvider: Transport;\n}\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 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 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';\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.js","sourceRoot":"","sources":["../../../src/config/browser.ts"],"names":[],"mappings":"","sourcesContent":["import { UserSession } from '../user-session';\nimport { IdentityStorageType, Storage } from '../storage';\nimport { Transport } from '../transport';\nimport { Config } from './core';\nimport { PageTrackingOptions } from '../page-view-tracking';\nimport { ElementInteractionsOptions } from '../element-interactions';\n\nexport interface BrowserConfig extends ExternalBrowserConfig, InternalBrowserConfig {}\n\nexport interface ExternalBrowserConfig extends Config {\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.\n * @defaultValue `false`\n */\n fetchRemoteConfig?: boolean;\n}\n\ninterface InternalBrowserConfig {\n cookieStorage: Storage<UserSession>;\n lastEventTime?: number;\n lastEventId?: number;\n transportProvider: Transport;\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\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 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\nexport type BrowserRemoteConfig = {\n browserSDK: {\n autocapture?: AutocaptureOptions | boolean;\n };\n};\n"]}
@@ -80,7 +80,25 @@ export interface Config {
80
80
  * The flag of whether to upload events to Batch API instead of the default HTTP V2 API.
81
81
  */
82
82
  useBatch: boolean;
83
+ /**
84
+ * Metrics of the SDK.
85
+ */
86
+ requestMetadata?: RequestMetadata;
87
+ }
88
+ export interface RequestMetadata {
89
+ sdk: {
90
+ metrics: {
91
+ histogram: {
92
+ remote_config_fetch_time?: number;
93
+ };
94
+ };
95
+ };
96
+ recordHistogram<T extends HistogramKey>(key: T, value: HistogramOptions[T]): void;
97
+ }
98
+ export interface HistogramOptions {
99
+ remote_config_fetch_time?: number;
83
100
  }
101
+ export type HistogramKey = keyof HistogramOptions;
84
102
  export interface Options extends Partial<Config> {
85
103
  apiKey: string;
86
104
  transportProvider: Transport;
@@ -1 +1 @@
1
- {"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../src/config/core.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C,MAAM,WAAW,MAAM;IACrB;;OAEG;IACH,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AAC;KACH,CAAC;IAEF,eAAe,CAAC,CAAC,SAAS,YAAY,EAAE,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,gBAAgB,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;CACnF;AAED,MAAM,WAAW,gBAAgB;IAC/B,wBAAwB,CAAC,EAAE,MAAM,CAAC;CACnC;AAED,MAAM,MAAM,YAAY,GAAG,MAAM,gBAAgB,CAAC;AAElD,MAAM,WAAW,OAAQ,SAAQ,OAAO,CAAC,MAAM,CAAC;IAC9C,MAAM,EAAE,MAAM,CAAC;IACf,iBAAiB,EAAE,SAAS,CAAC;CAC9B"}
@@ -1 +1 @@
1
- {"version":3,"file":"core.js","sourceRoot":"","sources":["../../../src/config/core.ts"],"names":[],"mappings":"","sourcesContent":["import { Event } from '../event';\nimport { IngestionMetadata } from '../ingestion-metadata';\nimport { Plan } from '../plan';\nimport { ServerZoneType } from '../server-zone';\nimport { Storage } from '../storage';\nimport { Transport } from '../transport';\nimport { Logger, LogLevel } from '../logger';\nimport { OfflineDisabled } from '../offline';\n\nexport interface Config {\n /**\n * Your Amplitude Project API key.\n */\n apiKey: string;\n /**\n * The interval of uploading events to Amplitude in milliseconds.\n */\n flushIntervalMillis: number;\n /**\n * The maximum number of retries for failed upload attempts. This is only applicable to retryable errors.\n */\n flushMaxRetries: number;\n /**\n * The maximum number of events that are batched in a single upload attempt.\n */\n flushQueueSize: number;\n /**\n * The instance name. For tracking events to multiple Amplitude projects in your application.\n */\n instanceName?: string;\n /**\n * Level of logs to be printed in the developer console.\n * Valid values are `LogLevel.None`, `LogLevel.Error`, `LogLevel.Warn`, `LogLevel.Verbose`, `LogLevel.Debug`\n */\n logLevel: LogLevel;\n /**\n * A custom Logger class to emit log messages to desired destination.\n */\n loggerProvider: Logger;\n /**\n * The minimum length for the value of userId and deviceId properties.\n */\n minIdLength?: number;\n /**\n * Whether the SDK is connected to network.\n */\n offline?: boolean | typeof OfflineDisabled;\n /**\n * The flag to opt this device out of Amplitude tracking.\n * If this flag is set, no additional information will be stored for the user.\n */\n optOut: boolean;\n /**\n * Tracking plan properties.\n * Amplitude internal use.\n */\n plan?: Plan;\n /**\n * Ingestion metadata.\n * Amplitude internal use.\n */\n ingestionMetadata?: IngestionMetadata;\n /**\n * The URL where events are upload to.\n */\n serverUrl?: string;\n /**\n * The Amplitude server zone.\n * Set this to EU for Amplitude projects created in EU data center.\n */\n serverZone?: ServerZoneType;\n /**\n * The storage provider to persist unsent events.\n */\n storageProvider?: Storage<Event[]>;\n /**\n * A customer Transport Class for sending data to a server.\n */\n transportProvider: Transport;\n /**\n * The flag of whether to upload events to Batch API instead of the default HTTP V2 API.\n */\n useBatch: boolean;\n}\n\nexport interface Options extends Partial<Config> {\n apiKey: string;\n transportProvider: Transport;\n}\n"]}
1
+ {"version":3,"file":"core.js","sourceRoot":"","sources":["../../../src/config/core.ts"],"names":[],"mappings":"","sourcesContent":["import { Event } from '../event';\nimport { IngestionMetadata } from '../ingestion-metadata';\nimport { Plan } from '../plan';\nimport { ServerZoneType } from '../server-zone';\nimport { Storage } from '../storage';\nimport { Transport } from '../transport';\nimport { Logger, LogLevel } from '../logger';\nimport { OfflineDisabled } from '../offline';\n\nexport interface Config {\n /**\n * Your Amplitude Project API key.\n */\n apiKey: string;\n /**\n * The interval of uploading events to Amplitude in milliseconds.\n */\n flushIntervalMillis: number;\n /**\n * The maximum number of retries for failed upload attempts. This is only applicable to retryable errors.\n */\n flushMaxRetries: number;\n /**\n * The maximum number of events that are batched in a single upload attempt.\n */\n flushQueueSize: number;\n /**\n * The instance name. For tracking events to multiple Amplitude projects in your application.\n */\n instanceName?: string;\n /**\n * Level of logs to be printed in the developer console.\n * Valid values are `LogLevel.None`, `LogLevel.Error`, `LogLevel.Warn`, `LogLevel.Verbose`, `LogLevel.Debug`\n */\n logLevel: LogLevel;\n /**\n * A custom Logger class to emit log messages to desired destination.\n */\n loggerProvider: Logger;\n /**\n * The minimum length for the value of userId and deviceId properties.\n */\n minIdLength?: number;\n /**\n * Whether the SDK is connected to network.\n */\n offline?: boolean | typeof OfflineDisabled;\n /**\n * The flag to opt this device out of Amplitude tracking.\n * If this flag is set, no additional information will be stored for the user.\n */\n optOut: boolean;\n /**\n * Tracking plan properties.\n * Amplitude internal use.\n */\n plan?: Plan;\n /**\n * Ingestion metadata.\n * Amplitude internal use.\n */\n ingestionMetadata?: IngestionMetadata;\n /**\n * The URL where events are upload to.\n */\n serverUrl?: string;\n /**\n * The Amplitude server zone.\n * Set this to EU for Amplitude projects created in EU data center.\n */\n serverZone?: ServerZoneType;\n /**\n * The storage provider to persist unsent events.\n */\n storageProvider?: Storage<Event[]>;\n /**\n * A customer Transport Class for sending data to a server.\n */\n transportProvider: Transport;\n /**\n * The flag of whether to upload events to Batch API instead of the default HTTP V2 API.\n */\n useBatch: boolean;\n /**\n * Metrics of the SDK.\n */\n requestMetadata?: RequestMetadata;\n}\n\nexport interface RequestMetadata {\n sdk: {\n metrics: {\n histogram: {\n remote_config_fetch_time?: number;\n };\n };\n };\n\n recordHistogram<T extends HistogramKey>(key: T, value: HistogramOptions[T]): void;\n}\n\nexport interface HistogramOptions {\n remote_config_fetch_time?: number;\n}\n\nexport type HistogramKey = keyof HistogramOptions;\n\nexport interface Options extends Partial<Config> {\n apiKey: string;\n transportProvider: Transport;\n}\n"]}
@@ -1,5 +1,5 @@
1
- export { Config, Options } from './core';
2
- export { BrowserConfig, DefaultTrackingOptions, TrackingOptions, AttributionOptions, BrowserOptions } from './browser';
1
+ export { Config, Options, RequestMetadata, HistogramOptions, HistogramKey } from './core';
2
+ export { BrowserConfig, DefaultTrackingOptions, TrackingOptions, AttributionOptions, BrowserOptions, AutocaptureOptions, BrowserRemoteConfig, } from './browser';
3
3
  export { NodeConfig, NodeOptions } from './node';
4
4
  export { ReactNativeAttributionOptions, ReactNativeConfig, ReactNativeTrackingOptions, ReactNativeOptions, } from './react-native';
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/config/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,sBAAsB,EAAE,eAAe,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AACvH,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AACjD,OAAO,EACL,6BAA6B,EAC7B,iBAAiB,EACjB,0BAA0B,EAC1B,kBAAkB,GACnB,MAAM,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/config/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAC1F,OAAO,EACL,aAAa,EACb,sBAAsB,EACtB,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AACjD,OAAO,EACL,6BAA6B,EAC7B,iBAAiB,EACjB,0BAA0B,EAC1B,kBAAkB,GACnB,MAAM,gBAAgB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/config/index.ts"],"names":[],"mappings":"","sourcesContent":["export { Config, Options } from './core';\nexport { BrowserConfig, DefaultTrackingOptions, TrackingOptions, AttributionOptions, BrowserOptions } from './browser';\nexport { NodeConfig, NodeOptions } from './node';\nexport {\n ReactNativeAttributionOptions,\n ReactNativeConfig,\n ReactNativeTrackingOptions,\n ReactNativeOptions,\n} from './react-native';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/config/index.ts"],"names":[],"mappings":"","sourcesContent":["export { Config, Options, RequestMetadata, HistogramOptions, HistogramKey } from './core';\nexport {\n BrowserConfig,\n DefaultTrackingOptions,\n TrackingOptions,\n AttributionOptions,\n BrowserOptions,\n AutocaptureOptions,\n BrowserRemoteConfig,\n} from './browser';\nexport { NodeConfig, NodeOptions } from './node';\nexport {\n ReactNativeAttributionOptions,\n ReactNativeConfig,\n ReactNativeTrackingOptions,\n ReactNativeOptions,\n} from './react-native';\n"]}
@@ -0,0 +1,61 @@
1
+ import { Logger } from './logger';
2
+ export type ActionType = 'click' | 'change';
3
+ /**
4
+ * Default CSS selectors to define which elements on the page to track.
5
+ * Extend this list to include additional elements to track. For example:
6
+ * ```
7
+ * autocapturePlugin({
8
+ * cssSelectorAllowlist: [...DEFAULT_CSS_SELECTOR_ALLOWLIST, ".my-class"],
9
+ * })
10
+ * ```
11
+ */
12
+ export declare const DEFAULT_CSS_SELECTOR_ALLOWLIST: string[];
13
+ /**
14
+ * Default prefix to allo the plugin to capture data attributes as an event property.
15
+ */
16
+ export declare const DEFAULT_DATA_ATTRIBUTE_PREFIX = "data-amp-track-";
17
+ export interface ElementInteractionsOptions {
18
+ /**
19
+ * List of CSS selectors to allow auto tracking on.
20
+ * When provided, allow elements matching any selector to be tracked.
21
+ * Default is ['a', 'button', 'input', 'select', 'textarea', 'label', '[data-amp-default-track]', '.amp-default-track'].
22
+ */
23
+ cssSelectorAllowlist?: string[];
24
+ /**
25
+ * List of page URLs to allow auto tracking on.
26
+ * When provided, only allow tracking on these URLs.
27
+ * Both full URLs and regex are supported.
28
+ */
29
+ pageUrlAllowlist?: (string | RegExp)[];
30
+ /**
31
+ * Function to determine whether an event should be tracked.
32
+ * When provided, this function overwrites all other allowlists and configurations.
33
+ * If the function returns true, the event will be tracked.
34
+ * If the function returns false, the event will not be tracked.
35
+ * @param actionType - The type of action that triggered the event.
36
+ * @param element - The [Element](https://developer.mozilla.org/en-US/docs/Web/API/Element) that triggered the event.
37
+ */
38
+ shouldTrackEventResolver?: (actionType: ActionType, element: Element) => boolean;
39
+ /**
40
+ * Prefix for data attributes to allow auto collecting.
41
+ * Default is 'data-amp-track-'.
42
+ */
43
+ dataAttributePrefix?: string;
44
+ /**
45
+ * Options for integrating visual tagging selector.
46
+ */
47
+ visualTaggingOptions?: {
48
+ enabled?: boolean;
49
+ messenger?: Messenger;
50
+ };
51
+ }
52
+ export interface Messenger {
53
+ logger?: Logger;
54
+ setup: () => void;
55
+ }
56
+ interface Element {
57
+ id: string;
58
+ className: string;
59
+ }
60
+ export {};
61
+ //# sourceMappingURL=element-interactions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"element-interactions.d.ts","sourceRoot":"","sources":["../../src/element-interactions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,QAAQ,CAAC;AAE5C;;;;;;;;GAQG;AACH,eAAO,MAAM,8BAA8B,UAS1C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,6BAA6B,oBAAoB,CAAC;AAE/D,MAAM,WAAW,0BAA0B;IACzC;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;IAEhC;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;IAEvC;;;;;;;OAOG;IACH,wBAAwB,CAAC,EAAE,CAAC,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC;IAEjF;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAE7B;;OAEG;IACH,oBAAoB,CAAC,EAAE;QACrB,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,SAAS,CAAC,EAAE,SAAS,CAAC;KACvB,CAAC;CACH;AAED,MAAM,WAAW,SAAS;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAED,UAAU,OAAO;IACf,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;CACnB"}
@@ -0,0 +1,26 @@
1
+ Object.defineProperty(exports, "__esModule", { value: true });
2
+ exports.DEFAULT_DATA_ATTRIBUTE_PREFIX = exports.DEFAULT_CSS_SELECTOR_ALLOWLIST = void 0;
3
+ /**
4
+ * Default CSS selectors to define which elements on the page to track.
5
+ * Extend this list to include additional elements to track. For example:
6
+ * ```
7
+ * autocapturePlugin({
8
+ * cssSelectorAllowlist: [...DEFAULT_CSS_SELECTOR_ALLOWLIST, ".my-class"],
9
+ * })
10
+ * ```
11
+ */
12
+ exports.DEFAULT_CSS_SELECTOR_ALLOWLIST = [
13
+ 'a',
14
+ 'button',
15
+ 'input',
16
+ 'select',
17
+ 'textarea',
18
+ 'label',
19
+ '[data-amp-default-track]',
20
+ '.amp-default-track',
21
+ ];
22
+ /**
23
+ * Default prefix to allo the plugin to capture data attributes as an event property.
24
+ */
25
+ exports.DEFAULT_DATA_ATTRIBUTE_PREFIX = 'data-amp-track-';
26
+ //# sourceMappingURL=element-interactions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"element-interactions.js","sourceRoot":"","sources":["../../src/element-interactions.ts"],"names":[],"mappings":";;AAIA;;;;;;;;GAQG;AACU,QAAA,8BAA8B,GAAG;IAC5C,GAAG;IACH,QAAQ;IACR,OAAO;IACP,QAAQ;IACR,UAAU;IACV,OAAO;IACP,0BAA0B;IAC1B,oBAAoB;CACrB,CAAC;AAEF;;GAEG;AACU,QAAA,6BAA6B,GAAG,iBAAiB,CAAC","sourcesContent":["import { Logger } from './logger';\n\nexport type ActionType = 'click' | 'change';\n\n/**\n * Default CSS selectors to define which elements on the page to track.\n * Extend this list to include additional elements to track. For example:\n * ```\n * autocapturePlugin({\n * cssSelectorAllowlist: [...DEFAULT_CSS_SELECTOR_ALLOWLIST, \".my-class\"],\n * })\n * ```\n */\nexport const DEFAULT_CSS_SELECTOR_ALLOWLIST = [\n 'a',\n 'button',\n 'input',\n 'select',\n 'textarea',\n 'label',\n '[data-amp-default-track]',\n '.amp-default-track',\n];\n\n/**\n * Default prefix to allo the plugin to capture data attributes as an event property.\n */\nexport const DEFAULT_DATA_ATTRIBUTE_PREFIX = 'data-amp-track-';\n\nexport interface ElementInteractionsOptions {\n /**\n * List of CSS selectors to allow auto tracking on.\n * When provided, allow elements matching any selector to be tracked.\n * Default is ['a', 'button', 'input', 'select', 'textarea', 'label', '[data-amp-default-track]', '.amp-default-track'].\n */\n cssSelectorAllowlist?: string[];\n\n /**\n * List of page URLs to allow auto tracking on.\n * When provided, only allow tracking on these URLs.\n * Both full URLs and regex are supported.\n */\n pageUrlAllowlist?: (string | RegExp)[];\n\n /**\n * Function to determine whether an event should be tracked.\n * When provided, this function overwrites all other allowlists and configurations.\n * If the function returns true, the event will be tracked.\n * If the function returns false, the event will not be tracked.\n * @param actionType - The type of action that triggered the event.\n * @param element - The [Element](https://developer.mozilla.org/en-US/docs/Web/API/Element) that triggered the event.\n */\n shouldTrackEventResolver?: (actionType: ActionType, element: Element) => boolean;\n\n /**\n * Prefix for data attributes to allow auto collecting.\n * Default is 'data-amp-track-'.\n */\n dataAttributePrefix?: string;\n\n /**\n * Options for integrating visual tagging selector.\n */\n visualTaggingOptions?: {\n enabled?: boolean;\n messenger?: Messenger;\n };\n}\n\nexport interface Messenger {\n logger?: Logger;\n setup: () => void;\n}\n\ninterface Element {\n id: string;\n className: string;\n}\n"]}
@@ -2,7 +2,7 @@ export { AmplitudeReturn } from './amplitude-promise';
2
2
  export { BaseEvent, EventOptions } from './base-event';
3
3
  export { Campaign, CampaignParser, CampaignTracker, CampaignTrackerOptions, CampaignTrackFunction, ClickIdParameters, ReferrerParameters, UTMParameters, } from './campaign';
4
4
  export { BrowserClient, ReactNativeClient, NodeClient } from './client';
5
- export { AttributionOptions, BrowserConfig, BrowserOptions, Config, DefaultTrackingOptions, Options, NodeConfig, NodeOptions, ReactNativeConfig, ReactNativeOptions, ReactNativeTrackingOptions, TrackingOptions, } from './config';
5
+ export { AttributionOptions, AutocaptureOptions, BrowserConfig, BrowserOptions, Config, DefaultTrackingOptions, Options, NodeConfig, NodeOptions, ReactNativeConfig, ReactNativeOptions, ReactNativeTrackingOptions, TrackingOptions, RequestMetadata, HistogramOptions, HistogramKey, BrowserRemoteConfig, } from './config';
6
6
  export { CoreClient } from './client/core-client';
7
7
  export { DestinationContext } from './destination-context';
8
8
  export { Event, TrackEvent, IdentifyEvent, GroupIdentifyEvent, SpecialEventType, IdentifyOperation, IdentifyUserProperties, ValidPropertyType, Identify, Revenue, RevenueEvent, RevenueProperty, RevenueEventProperties, } from './event';
@@ -24,4 +24,5 @@ export { UserSession } from './user-session';
24
24
  export { UTMData } from './utm';
25
25
  export { PageTrackingOptions, PageTrackingTrackOn, PageTrackingHistoryChanges } from './page-view-tracking';
26
26
  export { OfflineDisabled } from './offline';
27
+ export { Messenger, ElementInteractionsOptions, ActionType, DEFAULT_CSS_SELECTOR_ALLOWLIST, DEFAULT_DATA_ATTRIBUTE_PREFIX, } from './element-interactions';
27
28
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EACL,QAAQ,EACR,cAAc,EACd,eAAe,EACf,sBAAsB,EACtB,qBAAqB,EACrB,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,GACd,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACxE,OAAO,EACL,kBAAkB,EAClB,aAAa,EACb,cAAc,EACd,MAAM,EACN,sBAAsB,EACtB,OAAO,EACP,UAAU,EACV,WAAW,EACX,iBAAiB,EACjB,kBAAkB,EAClB,0BAA0B,EAC1B,eAAe,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6B,GAC9B,MAAM,wBAAwB,CAAC"}
package/lib/cjs/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, "__esModule", { value: true });
2
- exports.OfflineDisabled = exports.Status = exports.ServerZone = exports.LogLevel = exports.RevenueProperty = exports.IdentifyOperation = exports.SpecialEventType = void 0;
2
+ exports.DEFAULT_DATA_ATTRIBUTE_PREFIX = exports.DEFAULT_CSS_SELECTOR_ALLOWLIST = exports.OfflineDisabled = exports.Status = exports.ServerZone = exports.LogLevel = exports.RevenueProperty = exports.IdentifyOperation = exports.SpecialEventType = void 0;
3
3
  var event_1 = require("./event");
4
4
  Object.defineProperty(exports, "SpecialEventType", { enumerable: true, get: function () { return event_1.SpecialEventType; } });
5
5
  Object.defineProperty(exports, "IdentifyOperation", { enumerable: true, get: function () { return event_1.IdentifyOperation; } });
@@ -12,4 +12,7 @@ var status_1 = require("./status");
12
12
  Object.defineProperty(exports, "Status", { enumerable: true, get: function () { return status_1.Status; } });
13
13
  var offline_1 = require("./offline");
14
14
  Object.defineProperty(exports, "OfflineDisabled", { enumerable: true, get: function () { return offline_1.OfflineDisabled; } });
15
+ var element_interactions_1 = require("./element-interactions");
16
+ Object.defineProperty(exports, "DEFAULT_CSS_SELECTOR_ALLOWLIST", { enumerable: true, get: function () { return element_interactions_1.DEFAULT_CSS_SELECTOR_ALLOWLIST; } });
17
+ Object.defineProperty(exports, "DEFAULT_DATA_ATTRIBUTE_PREFIX", { enumerable: true, get: function () { return element_interactions_1.DEFAULT_DATA_ATTRIBUTE_PREFIX; } });
15
18
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;AA6BA,iCAciB;AATf,yGAAA,gBAAgB,OAAA;AAChB,0GAAA,iBAAiB,OAAA;AAMjB,wGAAA,eAAe,OAAA;AAKjB,mCAAqE;AAApD,kGAAA,QAAQ,OAAA;AAQzB,6CAA2D;AAAlD,yGAAA,UAAU,OAAA;AACnB,mCAAkC;AAAzB,gGAAA,MAAM,OAAA;AAMf,qCAA4C;AAAnC,0GAAA,eAAe,OAAA","sourcesContent":["export { AmplitudeReturn } from './amplitude-promise';\nexport { BaseEvent, EventOptions } from './base-event';\nexport {\n Campaign,\n CampaignParser,\n CampaignTracker,\n CampaignTrackerOptions,\n CampaignTrackFunction,\n ClickIdParameters,\n ReferrerParameters,\n UTMParameters,\n} from './campaign';\nexport { BrowserClient, ReactNativeClient, NodeClient } from './client';\nexport {\n AttributionOptions,\n BrowserConfig,\n BrowserOptions,\n Config,\n DefaultTrackingOptions,\n Options,\n NodeConfig,\n NodeOptions,\n ReactNativeConfig,\n ReactNativeOptions,\n ReactNativeTrackingOptions,\n TrackingOptions,\n} from './config';\nexport { CoreClient } from './client/core-client';\nexport { DestinationContext } from './destination-context';\nexport {\n Event,\n TrackEvent,\n IdentifyEvent,\n GroupIdentifyEvent,\n SpecialEventType,\n IdentifyOperation,\n IdentifyUserProperties,\n ValidPropertyType,\n Identify,\n Revenue,\n RevenueEvent,\n RevenueProperty,\n RevenueEventProperties,\n} from './event';\nexport { EventCallback } from './event-callback';\nexport { EventBridge, EventBridgeChannel, EventBridgeContainer, EventBridgeReceiver } from './event-bridge';\nexport { Logger, LogLevel, LogConfig, DebugContext } from './logger';\nexport { Payload } from './payload';\nexport { Plan } from './plan';\nexport { IngestionMetadata } from './ingestion-metadata';\nexport { Plugin, BeforePlugin, EnrichmentPlugin, DestinationPlugin, PluginType } from './plugin';\nexport { Result } from './result';\nexport { Response, SuccessResponse, InvalidResponse, PayloadTooLargeResponse, RateLimitResponse } from './response';\nexport { QueueProxy, InstanceProxy } from './proxy';\nexport { ServerZone, ServerZoneType } from './server-zone';\nexport { Status } from './status';\nexport { CookieStorageOptions, IdentityStorageType, Storage } from './storage';\nexport { Transport, TransportType } from './transport';\nexport { UserSession } from './user-session';\nexport { UTMData } from './utm';\nexport { PageTrackingOptions, PageTrackingTrackOn, PageTrackingHistoryChanges } from './page-view-tracking';\nexport { OfflineDisabled } from './offline';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;AAkCA,iCAciB;AATf,yGAAA,gBAAgB,OAAA;AAChB,0GAAA,iBAAiB,OAAA;AAMjB,wGAAA,eAAe,OAAA;AAKjB,mCAAqE;AAApD,kGAAA,QAAQ,OAAA;AAQzB,6CAA2D;AAAlD,yGAAA,UAAU,OAAA;AACnB,mCAAkC;AAAzB,gGAAA,MAAM,OAAA;AAMf,qCAA4C;AAAnC,0GAAA,eAAe,OAAA;AACxB,+DAMgC;AAF9B,sIAAA,8BAA8B,OAAA;AAC9B,qIAAA,6BAA6B,OAAA","sourcesContent":["export { AmplitudeReturn } from './amplitude-promise';\nexport { BaseEvent, EventOptions } from './base-event';\nexport {\n Campaign,\n CampaignParser,\n CampaignTracker,\n CampaignTrackerOptions,\n CampaignTrackFunction,\n ClickIdParameters,\n ReferrerParameters,\n UTMParameters,\n} from './campaign';\nexport { BrowserClient, ReactNativeClient, NodeClient } from './client';\nexport {\n AttributionOptions,\n AutocaptureOptions,\n BrowserConfig,\n BrowserOptions,\n Config,\n DefaultTrackingOptions,\n Options,\n NodeConfig,\n NodeOptions,\n ReactNativeConfig,\n ReactNativeOptions,\n ReactNativeTrackingOptions,\n TrackingOptions,\n RequestMetadata,\n HistogramOptions,\n HistogramKey,\n BrowserRemoteConfig,\n} from './config';\nexport { CoreClient } from './client/core-client';\nexport { DestinationContext } from './destination-context';\nexport {\n Event,\n TrackEvent,\n IdentifyEvent,\n GroupIdentifyEvent,\n SpecialEventType,\n IdentifyOperation,\n IdentifyUserProperties,\n ValidPropertyType,\n Identify,\n Revenue,\n RevenueEvent,\n RevenueProperty,\n RevenueEventProperties,\n} from './event';\nexport { EventCallback } from './event-callback';\nexport { EventBridge, EventBridgeChannel, EventBridgeContainer, EventBridgeReceiver } from './event-bridge';\nexport { Logger, LogLevel, LogConfig, DebugContext } from './logger';\nexport { Payload } from './payload';\nexport { Plan } from './plan';\nexport { IngestionMetadata } from './ingestion-metadata';\nexport { Plugin, BeforePlugin, EnrichmentPlugin, DestinationPlugin, PluginType } from './plugin';\nexport { Result } from './result';\nexport { Response, SuccessResponse, InvalidResponse, PayloadTooLargeResponse, RateLimitResponse } from './response';\nexport { QueueProxy, InstanceProxy } from './proxy';\nexport { ServerZone, ServerZoneType } from './server-zone';\nexport { Status } from './status';\nexport { CookieStorageOptions, IdentityStorageType, Storage } from './storage';\nexport { Transport, TransportType } from './transport';\nexport { UserSession } from './user-session';\nexport { UTMData } from './utm';\nexport { PageTrackingOptions, PageTrackingTrackOn, PageTrackingHistoryChanges } from './page-view-tracking';\nexport { OfflineDisabled } from './offline';\nexport {\n Messenger,\n ElementInteractionsOptions,\n ActionType,\n DEFAULT_CSS_SELECTOR_ALLOWLIST,\n DEFAULT_DATA_ATTRIBUTE_PREFIX,\n} from './element-interactions';\n"]}
@@ -1,4 +1,5 @@
1
1
  import { Event } from './event';
2
+ import { RequestMetadata } from './config';
2
3
  export interface PayloadOptions {
3
4
  min_id_length?: number;
4
5
  }
@@ -7,5 +8,6 @@ export interface Payload {
7
8
  events: readonly Event[];
8
9
  options?: PayloadOptions;
9
10
  client_upload_time?: string;
11
+ request_metadata?: RequestMetadata;
10
12
  }
11
13
  //# sourceMappingURL=payload.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"payload.d.ts","sourceRoot":"","sources":["../../src/payload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,MAAM,WAAW,cAAc;IAC7B,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,OAAO;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,SAAS,KAAK,EAAE,CAAC;IACzB,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B"}
1
+ {"version":3,"file":"payload.d.ts","sourceRoot":"","sources":["../../src/payload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAE3C,MAAM,WAAW,cAAc;IAC7B,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,OAAO;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,SAAS,KAAK,EAAE,CAAC;IACzB,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,gBAAgB,CAAC,EAAE,eAAe,CAAC;CACpC"}
@@ -1 +1 @@
1
- {"version":3,"file":"payload.js","sourceRoot":"","sources":["../../src/payload.ts"],"names":[],"mappings":"","sourcesContent":["import { Event } from './event';\n\nexport interface PayloadOptions {\n min_id_length?: number;\n}\n\nexport interface Payload {\n api_key: string;\n events: readonly Event[];\n options?: PayloadOptions;\n client_upload_time?: string;\n}\n"]}
1
+ {"version":3,"file":"payload.js","sourceRoot":"","sources":["../../src/payload.ts"],"names":[],"mappings":"","sourcesContent":["import { Event } from './event';\nimport { RequestMetadata } from './config';\n\nexport interface PayloadOptions {\n min_id_length?: number;\n}\n\nexport interface Payload {\n api_key: string;\n events: readonly Event[];\n options?: PayloadOptions;\n client_upload_time?: string;\n request_metadata?: RequestMetadata;\n}\n"]}
@@ -3,6 +3,7 @@ import { IdentityStorageType, Storage } from '../storage';
3
3
  import { Transport } from '../transport';
4
4
  import { Config } from './core';
5
5
  import { PageTrackingOptions } from '../page-view-tracking';
6
+ import { ElementInteractionsOptions } from '../element-interactions';
6
7
  export interface BrowserConfig extends ExternalBrowserConfig, InternalBrowserConfig {
7
8
  }
8
9
  export interface ExternalBrowserConfig extends Config {
@@ -12,11 +13,17 @@ export interface ExternalBrowserConfig extends Config {
12
13
  */
13
14
  appVersion?: string;
14
15
  /**
16
+ * @deprecated This property is deprecated and will be removed in future versions. Please migrate to using `autocapture` instead.
15
17
  * The default event tracking configuration.
16
18
  * See {@link https://www.docs.developers.amplitude.com/data/sdks/browser-2/#tracking-default-events}.
17
19
  * @defaultValue `true`
18
20
  */
19
21
  defaultTracking?: boolean | DefaultTrackingOptions;
22
+ /**
23
+ * The configurations for auto-captured events.
24
+ * See {@link https://www.docs.developers.amplitude.com/data/sdks/browser-2/autocapture/}.
25
+ */
26
+ autocapture?: boolean | AutocaptureOptions;
20
27
  /**
21
28
  * The identifier for the device running your application.
22
29
  * @defaultValue `UUID()`
@@ -67,6 +74,11 @@ export interface ExternalBrowserConfig extends Config {
67
74
  * Used for landing page analysis.
68
75
  */
69
76
  pageCounter?: number;
77
+ /**
78
+ * Whether to fetch remote configuration.
79
+ * @defaultValue `false`
80
+ */
81
+ fetchRemoteConfig?: boolean;
70
82
  }
71
83
  interface InternalBrowserConfig {
72
84
  cookieStorage: Storage<UserSession>;
@@ -74,6 +86,9 @@ interface InternalBrowserConfig {
74
86
  lastEventId?: number;
75
87
  transportProvider: Transport;
76
88
  }
89
+ /**
90
+ * @deprecated This interface is deprecated and will be removed in future versions. Please migrate to using `AutocaptureOptions` instead.
91
+ */
77
92
  export interface DefaultTrackingOptions {
78
93
  /**
79
94
  * Enables/disables marketing attribution tracking or config with detailed attribution options.
@@ -101,6 +116,38 @@ export interface DefaultTrackingOptions {
101
116
  */
102
117
  sessions?: boolean;
103
118
  }
119
+ export interface AutocaptureOptions {
120
+ /**
121
+ * Enables/disables marketing attribution tracking or config with detailed attribution options.
122
+ * @defaultValue `true`
123
+ */
124
+ attribution?: boolean | AttributionOptions;
125
+ /**
126
+ * Enables/disables form downloads tracking.
127
+ * @defaultValue `true`
128
+ */
129
+ fileDownloads?: boolean;
130
+ /**
131
+ * Enables/disables form interaction tracking.
132
+ * @defaultValue `true`
133
+ */
134
+ formInteractions?: boolean;
135
+ /**
136
+ * Enables/disables default page view tracking.
137
+ * @defaultValue `true`
138
+ */
139
+ pageViews?: boolean | PageTrackingOptions;
140
+ /**
141
+ * Enables/disables session tracking.
142
+ * @defaultValue `true`
143
+ */
144
+ sessions?: boolean;
145
+ /**
146
+ * Enables/disables user interactions tracking.
147
+ * @defaultValue `false`
148
+ */
149
+ elementInteractions?: boolean | ElementInteractionsOptions;
150
+ }
104
151
  export interface TrackingOptions {
105
152
  /**
106
153
  * Enables/disables ip address tracking.
@@ -162,8 +209,13 @@ export interface CookieOptions {
162
209
  */
163
210
  upgrade?: boolean;
164
211
  }
165
- type HiddenOptions = 'apiKey' | 'transportProvider';
212
+ type HiddenOptions = 'apiKey' | 'transportProvider' | 'requestMetadata';
166
213
  export interface BrowserOptions extends Omit<Partial<ExternalBrowserConfig>, HiddenOptions> {
167
214
  }
215
+ export type BrowserRemoteConfig = {
216
+ browserSDK: {
217
+ autocapture?: AutocaptureOptions | boolean;
218
+ };
219
+ };
168
220
  export {};
169
221
  //# sourceMappingURL=browser.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../../src/config/browser.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,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,MAAM,WAAW,aAAc,SAAQ,qBAAqB,EAAE,qBAAqB;CAAG;AAEtF,MAAM,WAAW,qBAAsB,SAAQ,MAAM;IACnD;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,eAAe,CAAC,EAAE,OAAO,GAAG,sBAAsB,CAAC;IACnD;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,aAAa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"version":3,"file":"browser.js","sourceRoot":"","sources":["../../../src/config/browser.ts"],"names":[],"mappings":"","sourcesContent":["import { UserSession } from '../user-session';\nimport { IdentityStorageType, Storage } from '../storage';\nimport { Transport } from '../transport';\nimport { Config } from './core';\nimport { PageTrackingOptions } from '../page-view-tracking';\n\nexport interface BrowserConfig extends ExternalBrowserConfig, InternalBrowserConfig {}\n\nexport interface ExternalBrowserConfig extends Config {\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 * 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 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\ninterface InternalBrowserConfig {\n cookieStorage: Storage<UserSession>;\n lastEventTime?: number;\n lastEventId?: number;\n transportProvider: Transport;\n}\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 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 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';\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.js","sourceRoot":"","sources":["../../../src/config/browser.ts"],"names":[],"mappings":"","sourcesContent":["import { UserSession } from '../user-session';\nimport { IdentityStorageType, Storage } from '../storage';\nimport { Transport } from '../transport';\nimport { Config } from './core';\nimport { PageTrackingOptions } from '../page-view-tracking';\nimport { ElementInteractionsOptions } from '../element-interactions';\n\nexport interface BrowserConfig extends ExternalBrowserConfig, InternalBrowserConfig {}\n\nexport interface ExternalBrowserConfig extends Config {\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.\n * @defaultValue `false`\n */\n fetchRemoteConfig?: boolean;\n}\n\ninterface InternalBrowserConfig {\n cookieStorage: Storage<UserSession>;\n lastEventTime?: number;\n lastEventId?: number;\n transportProvider: Transport;\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\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 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\nexport type BrowserRemoteConfig = {\n browserSDK: {\n autocapture?: AutocaptureOptions | boolean;\n };\n};\n"]}
@@ -80,7 +80,25 @@ export interface Config {
80
80
  * The flag of whether to upload events to Batch API instead of the default HTTP V2 API.
81
81
  */
82
82
  useBatch: boolean;
83
+ /**
84
+ * Metrics of the SDK.
85
+ */
86
+ requestMetadata?: RequestMetadata;
87
+ }
88
+ export interface RequestMetadata {
89
+ sdk: {
90
+ metrics: {
91
+ histogram: {
92
+ remote_config_fetch_time?: number;
93
+ };
94
+ };
95
+ };
96
+ recordHistogram<T extends HistogramKey>(key: T, value: HistogramOptions[T]): void;
97
+ }
98
+ export interface HistogramOptions {
99
+ remote_config_fetch_time?: number;
83
100
  }
101
+ export type HistogramKey = keyof HistogramOptions;
84
102
  export interface Options extends Partial<Config> {
85
103
  apiKey: string;
86
104
  transportProvider: Transport;
@@ -1 +1 @@
1
- {"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../src/config/core.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C,MAAM,WAAW,MAAM;IACrB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,mBAAmB,EAAE,MAAM,CAAC;IAC5B;;OAEG;IACH,eAAe,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,QAAQ,EAAE,QAAQ,CAAC;IACnB;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,eAAe,CAAC;IAC3C;;;OAGG;IACH,MAAM,EAAE,OAAO,CAAC;IAChB;;;OAGG;IACH,IAAI,CAAC,EAAE,IAA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OAEG;IACH,cAAc,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,eAAe,CAAC;IAC3C;;;OAGG;IACH,MAAM,EAAE,OAAO,CAAC;IAChB;;;OAGG;IACH,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ;;;OAGG;IACH,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,UAAU,CAAC,EAAE,cAAc,CAAC;IAC5B;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC;IACnC;;OAEG;IACH,iBAAiB,EAAE,SAAS,CAAC;IAC7B;;OAEG;IACH,QAAQ,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,eAAe,CAAC,EAAE,eAAe,CAAC;CACnC;AAED,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE;QACH,OAAO,EAAE;YACP,SAAS,EAAE;gBACT,wBAAwB,CAAC,EAAE,MAAM,CAAC;aACnC,CAAC;SACH,CAAC;KACH,CAAC;IAEF,eAAe,CAAC,CAAC,SAAS,YAAY,EAAE,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,gBAAgB,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;CACnF;AAED,MAAM,WAAW,gBAAgB;IAC/B,wBAAwB,CAAC,EAAE,MAAM,CAAC;CACnC;AAED,MAAM,MAAM,YAAY,GAAG,MAAM,gBAAgB,CAAC;AAElD,MAAM,WAAW,OAAQ,SAAQ,OAAO,CAAC,MAAM,CAAC;IAC9C,MAAM,EAAE,MAAM,CAAC;IACf,iBAAiB,EAAE,SAAS,CAAC;CAC9B"}
@@ -1 +1 @@
1
- {"version":3,"file":"core.js","sourceRoot":"","sources":["../../../src/config/core.ts"],"names":[],"mappings":"","sourcesContent":["import { Event } from '../event';\nimport { IngestionMetadata } from '../ingestion-metadata';\nimport { Plan } from '../plan';\nimport { ServerZoneType } from '../server-zone';\nimport { Storage } from '../storage';\nimport { Transport } from '../transport';\nimport { Logger, LogLevel } from '../logger';\nimport { OfflineDisabled } from '../offline';\n\nexport interface Config {\n /**\n * Your Amplitude Project API key.\n */\n apiKey: string;\n /**\n * The interval of uploading events to Amplitude in milliseconds.\n */\n flushIntervalMillis: number;\n /**\n * The maximum number of retries for failed upload attempts. This is only applicable to retryable errors.\n */\n flushMaxRetries: number;\n /**\n * The maximum number of events that are batched in a single upload attempt.\n */\n flushQueueSize: number;\n /**\n * The instance name. For tracking events to multiple Amplitude projects in your application.\n */\n instanceName?: string;\n /**\n * Level of logs to be printed in the developer console.\n * Valid values are `LogLevel.None`, `LogLevel.Error`, `LogLevel.Warn`, `LogLevel.Verbose`, `LogLevel.Debug`\n */\n logLevel: LogLevel;\n /**\n * A custom Logger class to emit log messages to desired destination.\n */\n loggerProvider: Logger;\n /**\n * The minimum length for the value of userId and deviceId properties.\n */\n minIdLength?: number;\n /**\n * Whether the SDK is connected to network.\n */\n offline?: boolean | typeof OfflineDisabled;\n /**\n * The flag to opt this device out of Amplitude tracking.\n * If this flag is set, no additional information will be stored for the user.\n */\n optOut: boolean;\n /**\n * Tracking plan properties.\n * Amplitude internal use.\n */\n plan?: Plan;\n /**\n * Ingestion metadata.\n * Amplitude internal use.\n */\n ingestionMetadata?: IngestionMetadata;\n /**\n * The URL where events are upload to.\n */\n serverUrl?: string;\n /**\n * The Amplitude server zone.\n * Set this to EU for Amplitude projects created in EU data center.\n */\n serverZone?: ServerZoneType;\n /**\n * The storage provider to persist unsent events.\n */\n storageProvider?: Storage<Event[]>;\n /**\n * A customer Transport Class for sending data to a server.\n */\n transportProvider: Transport;\n /**\n * The flag of whether to upload events to Batch API instead of the default HTTP V2 API.\n */\n useBatch: boolean;\n}\n\nexport interface Options extends Partial<Config> {\n apiKey: string;\n transportProvider: Transport;\n}\n"]}
1
+ {"version":3,"file":"core.js","sourceRoot":"","sources":["../../../src/config/core.ts"],"names":[],"mappings":"","sourcesContent":["import { Event } from '../event';\nimport { IngestionMetadata } from '../ingestion-metadata';\nimport { Plan } from '../plan';\nimport { ServerZoneType } from '../server-zone';\nimport { Storage } from '../storage';\nimport { Transport } from '../transport';\nimport { Logger, LogLevel } from '../logger';\nimport { OfflineDisabled } from '../offline';\n\nexport interface Config {\n /**\n * Your Amplitude Project API key.\n */\n apiKey: string;\n /**\n * The interval of uploading events to Amplitude in milliseconds.\n */\n flushIntervalMillis: number;\n /**\n * The maximum number of retries for failed upload attempts. This is only applicable to retryable errors.\n */\n flushMaxRetries: number;\n /**\n * The maximum number of events that are batched in a single upload attempt.\n */\n flushQueueSize: number;\n /**\n * The instance name. For tracking events to multiple Amplitude projects in your application.\n */\n instanceName?: string;\n /**\n * Level of logs to be printed in the developer console.\n * Valid values are `LogLevel.None`, `LogLevel.Error`, `LogLevel.Warn`, `LogLevel.Verbose`, `LogLevel.Debug`\n */\n logLevel: LogLevel;\n /**\n * A custom Logger class to emit log messages to desired destination.\n */\n loggerProvider: Logger;\n /**\n * The minimum length for the value of userId and deviceId properties.\n */\n minIdLength?: number;\n /**\n * Whether the SDK is connected to network.\n */\n offline?: boolean | typeof OfflineDisabled;\n /**\n * The flag to opt this device out of Amplitude tracking.\n * If this flag is set, no additional information will be stored for the user.\n */\n optOut: boolean;\n /**\n * Tracking plan properties.\n * Amplitude internal use.\n */\n plan?: Plan;\n /**\n * Ingestion metadata.\n * Amplitude internal use.\n */\n ingestionMetadata?: IngestionMetadata;\n /**\n * The URL where events are upload to.\n */\n serverUrl?: string;\n /**\n * The Amplitude server zone.\n * Set this to EU for Amplitude projects created in EU data center.\n */\n serverZone?: ServerZoneType;\n /**\n * The storage provider to persist unsent events.\n */\n storageProvider?: Storage<Event[]>;\n /**\n * A customer Transport Class for sending data to a server.\n */\n transportProvider: Transport;\n /**\n * The flag of whether to upload events to Batch API instead of the default HTTP V2 API.\n */\n useBatch: boolean;\n /**\n * Metrics of the SDK.\n */\n requestMetadata?: RequestMetadata;\n}\n\nexport interface RequestMetadata {\n sdk: {\n metrics: {\n histogram: {\n remote_config_fetch_time?: number;\n };\n };\n };\n\n recordHistogram<T extends HistogramKey>(key: T, value: HistogramOptions[T]): void;\n}\n\nexport interface HistogramOptions {\n remote_config_fetch_time?: number;\n}\n\nexport type HistogramKey = keyof HistogramOptions;\n\nexport interface Options extends Partial<Config> {\n apiKey: string;\n transportProvider: Transport;\n}\n"]}
@@ -1,5 +1,5 @@
1
- export { Config, Options } from './core';
2
- export { BrowserConfig, DefaultTrackingOptions, TrackingOptions, AttributionOptions, BrowserOptions } from './browser';
1
+ export { Config, Options, RequestMetadata, HistogramOptions, HistogramKey } from './core';
2
+ export { BrowserConfig, DefaultTrackingOptions, TrackingOptions, AttributionOptions, BrowserOptions, AutocaptureOptions, BrowserRemoteConfig, } from './browser';
3
3
  export { NodeConfig, NodeOptions } from './node';
4
4
  export { ReactNativeAttributionOptions, ReactNativeConfig, ReactNativeTrackingOptions, ReactNativeOptions, } from './react-native';
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/config/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,sBAAsB,EAAE,eAAe,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AACvH,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AACjD,OAAO,EACL,6BAA6B,EAC7B,iBAAiB,EACjB,0BAA0B,EAC1B,kBAAkB,GACnB,MAAM,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/config/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAC1F,OAAO,EACL,aAAa,EACb,sBAAsB,EACtB,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AACjD,OAAO,EACL,6BAA6B,EAC7B,iBAAiB,EACjB,0BAA0B,EAC1B,kBAAkB,GACnB,MAAM,gBAAgB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/config/index.ts"],"names":[],"mappings":"","sourcesContent":["export { Config, Options } from './core';\nexport { BrowserConfig, DefaultTrackingOptions, TrackingOptions, AttributionOptions, BrowserOptions } from './browser';\nexport { NodeConfig, NodeOptions } from './node';\nexport {\n ReactNativeAttributionOptions,\n ReactNativeConfig,\n ReactNativeTrackingOptions,\n ReactNativeOptions,\n} from './react-native';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/config/index.ts"],"names":[],"mappings":"","sourcesContent":["export { Config, Options, RequestMetadata, HistogramOptions, HistogramKey } from './core';\nexport {\n BrowserConfig,\n DefaultTrackingOptions,\n TrackingOptions,\n AttributionOptions,\n BrowserOptions,\n AutocaptureOptions,\n BrowserRemoteConfig,\n} from './browser';\nexport { NodeConfig, NodeOptions } from './node';\nexport {\n ReactNativeAttributionOptions,\n ReactNativeConfig,\n ReactNativeTrackingOptions,\n ReactNativeOptions,\n} from './react-native';\n"]}
@@ -0,0 +1,61 @@
1
+ import { Logger } from './logger';
2
+ export type ActionType = 'click' | 'change';
3
+ /**
4
+ * Default CSS selectors to define which elements on the page to track.
5
+ * Extend this list to include additional elements to track. For example:
6
+ * ```
7
+ * autocapturePlugin({
8
+ * cssSelectorAllowlist: [...DEFAULT_CSS_SELECTOR_ALLOWLIST, ".my-class"],
9
+ * })
10
+ * ```
11
+ */
12
+ export declare const DEFAULT_CSS_SELECTOR_ALLOWLIST: string[];
13
+ /**
14
+ * Default prefix to allo the plugin to capture data attributes as an event property.
15
+ */
16
+ export declare const DEFAULT_DATA_ATTRIBUTE_PREFIX = "data-amp-track-";
17
+ export interface ElementInteractionsOptions {
18
+ /**
19
+ * List of CSS selectors to allow auto tracking on.
20
+ * When provided, allow elements matching any selector to be tracked.
21
+ * Default is ['a', 'button', 'input', 'select', 'textarea', 'label', '[data-amp-default-track]', '.amp-default-track'].
22
+ */
23
+ cssSelectorAllowlist?: string[];
24
+ /**
25
+ * List of page URLs to allow auto tracking on.
26
+ * When provided, only allow tracking on these URLs.
27
+ * Both full URLs and regex are supported.
28
+ */
29
+ pageUrlAllowlist?: (string | RegExp)[];
30
+ /**
31
+ * Function to determine whether an event should be tracked.
32
+ * When provided, this function overwrites all other allowlists and configurations.
33
+ * If the function returns true, the event will be tracked.
34
+ * If the function returns false, the event will not be tracked.
35
+ * @param actionType - The type of action that triggered the event.
36
+ * @param element - The [Element](https://developer.mozilla.org/en-US/docs/Web/API/Element) that triggered the event.
37
+ */
38
+ shouldTrackEventResolver?: (actionType: ActionType, element: Element) => boolean;
39
+ /**
40
+ * Prefix for data attributes to allow auto collecting.
41
+ * Default is 'data-amp-track-'.
42
+ */
43
+ dataAttributePrefix?: string;
44
+ /**
45
+ * Options for integrating visual tagging selector.
46
+ */
47
+ visualTaggingOptions?: {
48
+ enabled?: boolean;
49
+ messenger?: Messenger;
50
+ };
51
+ }
52
+ export interface Messenger {
53
+ logger?: Logger;
54
+ setup: () => void;
55
+ }
56
+ interface Element {
57
+ id: string;
58
+ className: string;
59
+ }
60
+ export {};
61
+ //# sourceMappingURL=element-interactions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"element-interactions.d.ts","sourceRoot":"","sources":["../../src/element-interactions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,QAAQ,CAAC;AAE5C;;;;;;;;GAQG;AACH,eAAO,MAAM,8BAA8B,UAS1C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,6BAA6B,oBAAoB,CAAC;AAE/D,MAAM,WAAW,0BAA0B;IACzC;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;IAEhC;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;IAEvC;;;;;;;OAOG;IACH,wBAAwB,CAAC,EAAE,CAAC,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC;IAEjF;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAE7B;;OAEG;IACH,oBAAoB,CAAC,EAAE;QACrB,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,SAAS,CAAC,EAAE,SAAS,CAAC;KACvB,CAAC;CACH;AAED,MAAM,WAAW,SAAS;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAED,UAAU,OAAO;IACf,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;CACnB"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Default CSS selectors to define which elements on the page to track.
3
+ * Extend this list to include additional elements to track. For example:
4
+ * ```
5
+ * autocapturePlugin({
6
+ * cssSelectorAllowlist: [...DEFAULT_CSS_SELECTOR_ALLOWLIST, ".my-class"],
7
+ * })
8
+ * ```
9
+ */
10
+ export var DEFAULT_CSS_SELECTOR_ALLOWLIST = [
11
+ 'a',
12
+ 'button',
13
+ 'input',
14
+ 'select',
15
+ 'textarea',
16
+ 'label',
17
+ '[data-amp-default-track]',
18
+ '.amp-default-track',
19
+ ];
20
+ /**
21
+ * Default prefix to allo the plugin to capture data attributes as an event property.
22
+ */
23
+ export var DEFAULT_DATA_ATTRIBUTE_PREFIX = 'data-amp-track-';
24
+ //# sourceMappingURL=element-interactions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"element-interactions.js","sourceRoot":"","sources":["../../src/element-interactions.ts"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AACH,MAAM,CAAC,IAAM,8BAA8B,GAAG;IAC5C,GAAG;IACH,QAAQ;IACR,OAAO;IACP,QAAQ;IACR,UAAU;IACV,OAAO;IACP,0BAA0B;IAC1B,oBAAoB;CACrB,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,IAAM,6BAA6B,GAAG,iBAAiB,CAAC","sourcesContent":["import { Logger } from './logger';\n\nexport type ActionType = 'click' | 'change';\n\n/**\n * Default CSS selectors to define which elements on the page to track.\n * Extend this list to include additional elements to track. For example:\n * ```\n * autocapturePlugin({\n * cssSelectorAllowlist: [...DEFAULT_CSS_SELECTOR_ALLOWLIST, \".my-class\"],\n * })\n * ```\n */\nexport const DEFAULT_CSS_SELECTOR_ALLOWLIST = [\n 'a',\n 'button',\n 'input',\n 'select',\n 'textarea',\n 'label',\n '[data-amp-default-track]',\n '.amp-default-track',\n];\n\n/**\n * Default prefix to allo the plugin to capture data attributes as an event property.\n */\nexport const DEFAULT_DATA_ATTRIBUTE_PREFIX = 'data-amp-track-';\n\nexport interface ElementInteractionsOptions {\n /**\n * List of CSS selectors to allow auto tracking on.\n * When provided, allow elements matching any selector to be tracked.\n * Default is ['a', 'button', 'input', 'select', 'textarea', 'label', '[data-amp-default-track]', '.amp-default-track'].\n */\n cssSelectorAllowlist?: string[];\n\n /**\n * List of page URLs to allow auto tracking on.\n * When provided, only allow tracking on these URLs.\n * Both full URLs and regex are supported.\n */\n pageUrlAllowlist?: (string | RegExp)[];\n\n /**\n * Function to determine whether an event should be tracked.\n * When provided, this function overwrites all other allowlists and configurations.\n * If the function returns true, the event will be tracked.\n * If the function returns false, the event will not be tracked.\n * @param actionType - The type of action that triggered the event.\n * @param element - The [Element](https://developer.mozilla.org/en-US/docs/Web/API/Element) that triggered the event.\n */\n shouldTrackEventResolver?: (actionType: ActionType, element: Element) => boolean;\n\n /**\n * Prefix for data attributes to allow auto collecting.\n * Default is 'data-amp-track-'.\n */\n dataAttributePrefix?: string;\n\n /**\n * Options for integrating visual tagging selector.\n */\n visualTaggingOptions?: {\n enabled?: boolean;\n messenger?: Messenger;\n };\n}\n\nexport interface Messenger {\n logger?: Logger;\n setup: () => void;\n}\n\ninterface Element {\n id: string;\n className: string;\n}\n"]}
@@ -2,7 +2,7 @@ export { AmplitudeReturn } from './amplitude-promise';
2
2
  export { BaseEvent, EventOptions } from './base-event';
3
3
  export { Campaign, CampaignParser, CampaignTracker, CampaignTrackerOptions, CampaignTrackFunction, ClickIdParameters, ReferrerParameters, UTMParameters, } from './campaign';
4
4
  export { BrowserClient, ReactNativeClient, NodeClient } from './client';
5
- export { AttributionOptions, BrowserConfig, BrowserOptions, Config, DefaultTrackingOptions, Options, NodeConfig, NodeOptions, ReactNativeConfig, ReactNativeOptions, ReactNativeTrackingOptions, TrackingOptions, } from './config';
5
+ export { AttributionOptions, AutocaptureOptions, BrowserConfig, BrowserOptions, Config, DefaultTrackingOptions, Options, NodeConfig, NodeOptions, ReactNativeConfig, ReactNativeOptions, ReactNativeTrackingOptions, TrackingOptions, RequestMetadata, HistogramOptions, HistogramKey, BrowserRemoteConfig, } from './config';
6
6
  export { CoreClient } from './client/core-client';
7
7
  export { DestinationContext } from './destination-context';
8
8
  export { Event, TrackEvent, IdentifyEvent, GroupIdentifyEvent, SpecialEventType, IdentifyOperation, IdentifyUserProperties, ValidPropertyType, Identify, Revenue, RevenueEvent, RevenueProperty, RevenueEventProperties, } from './event';
@@ -24,4 +24,5 @@ export { UserSession } from './user-session';
24
24
  export { UTMData } from './utm';
25
25
  export { PageTrackingOptions, PageTrackingTrackOn, PageTrackingHistoryChanges } from './page-view-tracking';
26
26
  export { OfflineDisabled } from './offline';
27
+ export { Messenger, ElementInteractionsOptions, ActionType, DEFAULT_CSS_SELECTOR_ALLOWLIST, DEFAULT_DATA_ATTRIBUTE_PREFIX, } from './element-interactions';
27
28
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EACL,QAAQ,EACR,cAAc,EACd,eAAe,EACf,sBAAsB,EACtB,qBAAqB,EACrB,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,GACd,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACxE,OAAO,EACL,kBAAkB,EAClB,aAAa,EACb,cAAc,EACd,MAAM,EACN,sBAAsB,EACtB,OAAO,EACP,UAAU,EACV,WAAW,EACX,iBAAiB,EACjB,kBAAkB,EAClB,0BAA0B,EAC1B,eAAe,GAChB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EACL,KAAK,EACL,UAAU,EACV,aAAa,EACb,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,EACtB,iBAAiB,EACjB,QAAQ,EACR,OAAO,EACP,YAAY,EACZ,eAAe,EACf,sBAAsB,GACvB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAC5G,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACrE,OAAO,EAAE,OAAO,E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iBAAiB,EAAE,MAAM,YAAY,CAAC;AACpH,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC/E,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AAC5G,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EACL,SAAS,EACT,0BAA0B,EAC1B,UAAU,EACV,8BAA8B,EAC9B,6BAA6B,GAC9B,MAAM,wBAAwB,CAAC"}
package/lib/esm/index.js CHANGED
@@ -3,4 +3,5 @@ export { LogLevel } from './logger';
3
3
  export { ServerZone } from './server-zone';
4
4
  export { Status } from './status';
5
5
  export { OfflineDisabled } from './offline';
6
+ export { DEFAULT_CSS_SELECTOR_ALLOWLIST, DEFAULT_DATA_ATTRIBUTE_PREFIX, } from './element-interactions';
6
7
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AA6BA,OAAO,EAKL,gBAAgB,EAChB,iBAAiB,EAMjB,eAAe,GAEhB,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAU,QAAQ,EAA2B,MAAM,UAAU,CAAC;AAQrE,OAAO,EAAE,UAAU,EAAkB,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAMlC,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC","sourcesContent":["export { AmplitudeReturn } from './amplitude-promise';\nexport { BaseEvent, EventOptions } from './base-event';\nexport {\n Campaign,\n CampaignParser,\n CampaignTracker,\n CampaignTrackerOptions,\n CampaignTrackFunction,\n ClickIdParameters,\n ReferrerParameters,\n UTMParameters,\n} from './campaign';\nexport { BrowserClient, ReactNativeClient, NodeClient } from './client';\nexport {\n AttributionOptions,\n BrowserConfig,\n BrowserOptions,\n Config,\n DefaultTrackingOptions,\n Options,\n NodeConfig,\n NodeOptions,\n ReactNativeConfig,\n ReactNativeOptions,\n ReactNativeTrackingOptions,\n TrackingOptions,\n} from './config';\nexport { CoreClient } from './client/core-client';\nexport { DestinationContext } from './destination-context';\nexport {\n Event,\n TrackEvent,\n IdentifyEvent,\n GroupIdentifyEvent,\n SpecialEventType,\n IdentifyOperation,\n IdentifyUserProperties,\n ValidPropertyType,\n Identify,\n Revenue,\n RevenueEvent,\n RevenueProperty,\n RevenueEventProperties,\n} from './event';\nexport { EventCallback } from './event-callback';\nexport { EventBridge, EventBridgeChannel, EventBridgeContainer, EventBridgeReceiver } from './event-bridge';\nexport { Logger, LogLevel, LogConfig, DebugContext } from './logger';\nexport { Payload } from './payload';\nexport { Plan } from './plan';\nexport { IngestionMetadata } from './ingestion-metadata';\nexport { Plugin, BeforePlugin, EnrichmentPlugin, DestinationPlugin, PluginType } from './plugin';\nexport { Result } from './result';\nexport { Response, SuccessResponse, InvalidResponse, PayloadTooLargeResponse, RateLimitResponse } from './response';\nexport { QueueProxy, InstanceProxy } from './proxy';\nexport { ServerZone, ServerZoneType } from './server-zone';\nexport { Status } from './status';\nexport { CookieStorageOptions, IdentityStorageType, Storage } from './storage';\nexport { Transport, TransportType } from './transport';\nexport { UserSession } from './user-session';\nexport { UTMData } from './utm';\nexport { PageTrackingOptions, PageTrackingTrackOn, PageTrackingHistoryChanges } from './page-view-tracking';\nexport { OfflineDisabled } from './offline';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAkCA,OAAO,EAKL,gBAAgB,EAChB,iBAAiB,EAMjB,eAAe,GAEhB,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAU,QAAQ,EAA2B,MAAM,UAAU,CAAC;AAQrE,OAAO,EAAE,UAAU,EAAkB,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAMlC,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAIL,8BAA8B,EAC9B,6BAA6B,GAC9B,MAAM,wBAAwB,CAAC","sourcesContent":["export { AmplitudeReturn } from './amplitude-promise';\nexport { BaseEvent, EventOptions } from './base-event';\nexport {\n Campaign,\n CampaignParser,\n CampaignTracker,\n CampaignTrackerOptions,\n CampaignTrackFunction,\n ClickIdParameters,\n ReferrerParameters,\n UTMParameters,\n} from './campaign';\nexport { BrowserClient, ReactNativeClient, NodeClient } from './client';\nexport {\n AttributionOptions,\n AutocaptureOptions,\n BrowserConfig,\n BrowserOptions,\n Config,\n DefaultTrackingOptions,\n Options,\n NodeConfig,\n NodeOptions,\n ReactNativeConfig,\n ReactNativeOptions,\n ReactNativeTrackingOptions,\n TrackingOptions,\n RequestMetadata,\n HistogramOptions,\n HistogramKey,\n BrowserRemoteConfig,\n} from './config';\nexport { CoreClient } from './client/core-client';\nexport { DestinationContext } from './destination-context';\nexport {\n Event,\n TrackEvent,\n IdentifyEvent,\n GroupIdentifyEvent,\n SpecialEventType,\n IdentifyOperation,\n IdentifyUserProperties,\n ValidPropertyType,\n Identify,\n Revenue,\n RevenueEvent,\n RevenueProperty,\n RevenueEventProperties,\n} from './event';\nexport { EventCallback } from './event-callback';\nexport { EventBridge, EventBridgeChannel, EventBridgeContainer, EventBridgeReceiver } from './event-bridge';\nexport { Logger, LogLevel, LogConfig, DebugContext } from './logger';\nexport { Payload } from './payload';\nexport { Plan } from './plan';\nexport { IngestionMetadata } from './ingestion-metadata';\nexport { Plugin, BeforePlugin, EnrichmentPlugin, DestinationPlugin, PluginType } from './plugin';\nexport { Result } from './result';\nexport { Response, SuccessResponse, InvalidResponse, PayloadTooLargeResponse, RateLimitResponse } from './response';\nexport { QueueProxy, InstanceProxy } from './proxy';\nexport { ServerZone, ServerZoneType } from './server-zone';\nexport { Status } from './status';\nexport { CookieStorageOptions, IdentityStorageType, Storage } from './storage';\nexport { Transport, TransportType } from './transport';\nexport { UserSession } from './user-session';\nexport { UTMData } from './utm';\nexport { PageTrackingOptions, PageTrackingTrackOn, PageTrackingHistoryChanges } from './page-view-tracking';\nexport { OfflineDisabled } from './offline';\nexport {\n Messenger,\n ElementInteractionsOptions,\n ActionType,\n DEFAULT_CSS_SELECTOR_ALLOWLIST,\n DEFAULT_DATA_ATTRIBUTE_PREFIX,\n} from './element-interactions';\n"]}
@@ -1,4 +1,5 @@
1
1
  import { Event } from './event';
2
+ import { RequestMetadata } from './config';
2
3
  export interface PayloadOptions {
3
4
  min_id_length?: number;
4
5
  }
@@ -7,5 +8,6 @@ export interface Payload {
7
8
  events: readonly Event[];
8
9
  options?: PayloadOptions;
9
10
  client_upload_time?: string;
11
+ request_metadata?: RequestMetadata;
10
12
  }
11
13
  //# sourceMappingURL=payload.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"payload.d.ts","sourceRoot":"","sources":["../../src/payload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,MAAM,WAAW,cAAc;IAC7B,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,OAAO;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,SAAS,KAAK,EAAE,CAAC;IACzB,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B"}
1
+ {"version":3,"file":"payload.d.ts","sourceRoot":"","sources":["../../src/payload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAE3C,MAAM,WAAW,cAAc;IAC7B,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,OAAO;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,SAAS,KAAK,EAAE,CAAC;IACzB,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,gBAAgB,CAAC,EAAE,eAAe,CAAC;CACpC"}
@@ -1 +1 @@
1
- {"version":3,"file":"payload.js","sourceRoot":"","sources":["../../src/payload.ts"],"names":[],"mappings":"","sourcesContent":["import { Event } from './event';\n\nexport interface PayloadOptions {\n min_id_length?: number;\n}\n\nexport interface Payload {\n api_key: string;\n events: readonly Event[];\n options?: PayloadOptions;\n client_upload_time?: string;\n}\n"]}
1
+ {"version":3,"file":"payload.js","sourceRoot":"","sources":["../../src/payload.ts"],"names":[],"mappings":"","sourcesContent":["import { Event } from './event';\nimport { RequestMetadata } from './config';\n\nexport interface PayloadOptions {\n min_id_length?: number;\n}\n\nexport interface Payload {\n api_key: string;\n events: readonly Event[];\n options?: PayloadOptions;\n client_upload_time?: string;\n request_metadata?: RequestMetadata;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amplitude/analytics-types",
3
- "version": "2.6.0",
3
+ "version": "2.7.0-featureremoteconfig.0",
4
4
  "description": "",
5
5
  "author": "Amplitude Inc",
6
6
  "homepage": "https://github.com/amplitude/Amplitude-TypeScript",
@@ -35,5 +35,5 @@
35
35
  "files": [
36
36
  "lib"
37
37
  ],
38
- "gitHead": "79b78f3a3c810012825defd513488bdf3390ac0c"
38
+ "gitHead": "bb0d8e6aadf87baa76ba5b1c3a7268d13d1d2978"
39
39
  }