@amplitude/analytics-types 0.16.0 → 0.17.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/client/{base-client.d.ts → core-client.d.ts} +2 -2
- package/lib/cjs/client/{base-client.d.ts.map → core-client.d.ts.map} +1 -1
- package/lib/cjs/client/core-client.js.map +1 -0
- package/lib/cjs/client/index.d.ts +1 -0
- package/lib/cjs/client/index.d.ts.map +1 -1
- package/lib/cjs/client/index.js.map +1 -1
- package/lib/cjs/client/node-client.d.ts +2 -2
- package/lib/cjs/client/node-client.js.map +1 -1
- package/lib/cjs/client/web-client.d.ts +2 -2
- package/lib/cjs/client/web-client.js.map +1 -1
- package/lib/cjs/config/browser.d.ts +9 -0
- package/lib/cjs/config/browser.d.ts.map +1 -1
- package/lib/cjs/config/browser.js.map +1 -1
- package/lib/cjs/config/index.d.ts +1 -1
- package/lib/cjs/config/index.d.ts.map +1 -1
- package/lib/cjs/config/index.js.map +1 -1
- package/lib/cjs/index.d.ts +3 -2
- package/lib/cjs/index.d.ts.map +1 -1
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/page-view-tracking.d.ts +8 -0
- package/lib/cjs/page-view-tracking.d.ts.map +1 -0
- package/lib/cjs/{client/base-client.js → page-view-tracking.js} +1 -1
- package/lib/cjs/page-view-tracking.js.map +1 -0
- package/lib/cjs/plugin.d.ts +4 -4
- package/lib/cjs/plugin.js.map +1 -1
- package/lib/esm/client/{base-client.d.ts → core-client.d.ts} +2 -2
- package/lib/esm/client/{base-client.d.ts.map → core-client.d.ts.map} +1 -1
- package/lib/esm/client/core-client.js.map +1 -0
- package/lib/esm/client/index.d.ts +1 -0
- package/lib/esm/client/index.d.ts.map +1 -1
- package/lib/esm/client/index.js.map +1 -1
- package/lib/esm/client/node-client.d.ts +2 -2
- package/lib/esm/client/node-client.js.map +1 -1
- package/lib/esm/client/web-client.d.ts +2 -2
- package/lib/esm/client/web-client.js.map +1 -1
- package/lib/esm/config/browser.d.ts +9 -0
- package/lib/esm/config/browser.d.ts.map +1 -1
- package/lib/esm/config/browser.js.map +1 -1
- package/lib/esm/config/index.d.ts +1 -1
- package/lib/esm/config/index.d.ts.map +1 -1
- package/lib/esm/config/index.js.map +1 -1
- package/lib/esm/index.d.ts +3 -2
- package/lib/esm/index.d.ts.map +1 -1
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/page-view-tracking.d.ts +8 -0
- package/lib/esm/page-view-tracking.d.ts.map +1 -0
- package/lib/esm/page-view-tracking.js +2 -0
- package/lib/esm/page-view-tracking.js.map +1 -0
- package/lib/esm/plugin.d.ts +4 -4
- package/lib/esm/plugin.js.map +1 -1
- package/package.json +2 -2
- package/lib/cjs/client/base-client.js.map +0 -1
- package/lib/cjs/core-client.d.ts +0 -8
- package/lib/cjs/core-client.d.ts.map +0 -1
- package/lib/cjs/core-client.js.map +0 -1
- package/lib/esm/client/base-client.js +0 -2
- package/lib/esm/client/base-client.js.map +0 -1
- package/lib/esm/core-client.d.ts +0 -8
- package/lib/esm/core-client.d.ts.map +0 -1
- package/lib/esm/core-client.js.map +0 -1
- /package/lib/cjs/{core-client.js → client/core-client.js} +0 -0
- /package/lib/esm/{core-client.js → client/core-client.js} +0 -0
|
@@ -3,7 +3,7 @@ import { BaseEvent, EventOptions } from '../base-event';
|
|
|
3
3
|
import { Identify, Revenue } from '../event';
|
|
4
4
|
import { Plugin } from '../plugin';
|
|
5
5
|
import { Result } from '../result';
|
|
6
|
-
export interface
|
|
6
|
+
export interface CoreClient {
|
|
7
7
|
/**
|
|
8
8
|
* Adds a new plugin.
|
|
9
9
|
*
|
|
@@ -136,4 +136,4 @@ export interface BaseClient {
|
|
|
136
136
|
*/
|
|
137
137
|
flush(): AmplitudeReturn<void>;
|
|
138
138
|
}
|
|
139
|
-
//# sourceMappingURL=
|
|
139
|
+
//# sourceMappingURL=core-client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":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QAAQ,EAClB,YAAY,CAAC,EAAE,YAAY,GAC1B,eAAe,CAAC,MAAM,CAAC,CAAC;IAE3B;;;;;;;;OAQG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,YAAY,CAAC,EAAE,YAAY,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;IAEhH;;;;;;;;;;;;;;OAcG;IACH,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,YAAY,CAAC,EAAE,YAAY,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;IAEhF;;;;;;;;;;OAUG;IACH,SAAS,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;IAEjC;;;;;;OAMG;IACH,KAAK,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC;CAChC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core-client.js","sourceRoot":"","sources":["../../../src/client/core-client.ts"],"names":[],"mappings":"","sourcesContent":["// import { Config } from '../config';\nimport { AmplitudeReturn } from '../amplitude-promise';\nimport { BaseEvent, EventOptions } from '../base-event';\nimport { Identify, Revenue } from '../event';\nimport { Plugin } from '../plugin';\nimport { Result } from '../result';\n\nexport interface CoreClient {\n /**\n * Adds a new plugin.\n *\n * ```typescript\n * const plugin = {\n * name: 'myPlugin',\n * type: PluginType.ENRICHMENT,\n * setup(config: Config) {\n * return;\n * },\n * execute(context: Event) {\n * return context;\n * },\n * };\n * amplitude.add(plugin);\n * ```\n */\n add(plugin: Plugin): AmplitudeReturn<void>;\n\n /**\n * Removes a plugin.\n *\n * ```typescript\n * amplitude.remove('myPlugin');\n * ```\n */\n remove(pluginName: string): AmplitudeReturn<void>;\n\n /**\n * Tracks user-defined event, with specified type, optional event properties and optional overwrites.\n *\n * ```typescript\n * // event tracking with event type only\n * track('Page Load');\n *\n * // event tracking with event type and additional event properties\n * track('Page Load', { loadTime: 1000 });\n *\n * // event tracking with event type, additional event properties, and overwritten event options\n * track('Page Load', { loadTime: 1000 }, { sessionId: -1 });\n *\n * // alternatively, this tracking method is awaitable\n * const result = await track('Page Load').promise;\n * console.log(result.event); // {...}\n * console.log(result.code); // 200\n * console.log(result.message); // \"Event tracked successfully\"\n * ```\n */\n track(\n eventInput: BaseEvent | string,\n eventProperties?: Record<string, any>,\n eventOptions?: EventOptions,\n ): AmplitudeReturn<Result>;\n\n /**\n * Alias for track()\n */\n logEvent(\n eventInput: BaseEvent | string,\n eventProperties?: Record<string, any>,\n eventOptions?: EventOptions,\n ): AmplitudeReturn<Result>;\n\n /**\n * Sends an identify event containing user property operations\n *\n * ```typescript\n * const id = new Identify();\n * id.set('colors', ['rose', 'gold']);\n * identify(id);\n *\n * // alternatively, this tracking method is awaitable\n * const result = await identify(id).promise;\n * console.log(result.event); // {...}\n * console.log(result.code); // 200\n * console.log(result.message); // \"Event tracked successfully\"\n * ```\n */\n identify(identify: Identify, eventOptions?: EventOptions): AmplitudeReturn<Result>;\n\n /**\n * Sends a group identify event containing group property operations.\n *\n * ```typescript\n * const id = new Identify();\n * id.set('skills', ['js', 'ts']);\n * const groupType = 'org';\n * const groupName = 'engineering';\n * groupIdentify(groupType, groupName, id);\n *\n * // alternatively, this tracking method is awaitable\n * const result = await groupIdentify(groupType, groupName, id).promise;\n * console.log(result.event); // {...}\n * console.log(result.code); // 200\n * console.log(result.message); // \"Event tracked successfully\"\n * ```\n */\n groupIdentify(\n groupType: string,\n groupName: string | string[],\n identify: Identify,\n eventOptions?: EventOptions,\n ): AmplitudeReturn<Result>;\n\n /**\n * Assigns a user to group\n *\n * ```typescript\n * const groupType = 'orgId';\n * const groupName = '15';\n * setGroup(groupType, groupName, { user_id: '12345' })\n * ```\n */\n setGroup(groupType: string, groupName: string | string[], eventOptions?: EventOptions): AmplitudeReturn<Result>;\n\n /**\n * Sends a revenue event containing revenue property operations.\n *\n * ```typescript\n * const rev = new Revenue();\n * rev.setRevenue(100);\n * revenue(rev);\n *\n * // alternatively, this tracking method is awaitable\n * const result = await revenue(rev).promise;\n * console.log(result.event); // {...}\n * console.log(result.code); // 200\n * console.log(result.message); // \"Event tracked successfully\"\n * ```\n */\n revenue(revenue: Revenue, eventOptions?: EventOptions): AmplitudeReturn<Result>;\n\n /**\n * Sets a new optOut config value. This toggles event tracking on/off.\n *\n *```typescript\n * // Stops tracking\n * setOptOut(true);\n *\n * // Starts/resumes tracking\n * setOptOut(false);\n * ```\n */\n setOptOut(optOut: boolean): void;\n\n /**\n * Flush all unsent events.\n *\n *```typescript\n * flush();\n * ```\n */\n flush(): AmplitudeReturn<void>;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/client/index.ts"],"names":[],"mappings":"","sourcesContent":["export { BrowserClient, ReactNativeClient } from './web-client';\nexport { NodeClient } from './node-client';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/client/index.ts"],"names":[],"mappings":"","sourcesContent":["export { BrowserClient, ReactNativeClient } from './web-client';\nexport { NodeClient } from './node-client';\nexport { CoreClient } from './core-client';\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AmplitudeReturn } from '../amplitude-promise';
|
|
2
2
|
import { NodeOptions } from '../config';
|
|
3
|
-
import {
|
|
4
|
-
export interface NodeClient extends
|
|
3
|
+
import { CoreClient } from './core-client';
|
|
4
|
+
export interface NodeClient extends CoreClient {
|
|
5
5
|
/**
|
|
6
6
|
* Initializes the Amplitude SDK with your apiKey, optional configurations.
|
|
7
7
|
* This method must be called before any other operations.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-client.js","sourceRoot":"","sources":["../../../src/client/node-client.ts"],"names":[],"mappings":"","sourcesContent":["import { AmplitudeReturn } from '../amplitude-promise';\nimport { NodeOptions } from '../config';\nimport {
|
|
1
|
+
{"version":3,"file":"node-client.js","sourceRoot":"","sources":["../../../src/client/node-client.ts"],"names":[],"mappings":"","sourcesContent":["import { AmplitudeReturn } from '../amplitude-promise';\nimport { NodeOptions } from '../config';\nimport { CoreClient } from './core-client';\n\nexport interface NodeClient extends CoreClient {\n /**\n * Initializes the Amplitude SDK with your apiKey, optional configurations.\n * This method must be called before any other operations.\n *\n * ```typescript\n * await init(API_KEY, options).promise;\n * ```\n */\n init(apiKey: string, options?: NodeOptions): AmplitudeReturn<void>;\n}\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { AmplitudeReturn } from '../amplitude-promise';
|
|
2
2
|
import { BrowserOptions, ReactNativeOptions } from '../config';
|
|
3
3
|
import { TransportType } from '../transport';
|
|
4
|
-
import {
|
|
5
|
-
interface Client extends
|
|
4
|
+
import { CoreClient } from './core-client';
|
|
5
|
+
interface Client extends CoreClient {
|
|
6
6
|
/**
|
|
7
7
|
* Returns current user ID.
|
|
8
8
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web-client.js","sourceRoot":"","sources":["../../../src/client/web-client.ts"],"names":[],"mappings":"","sourcesContent":["import { AmplitudeReturn } from '../amplitude-promise';\nimport { BrowserOptions, ReactNativeOptions } from '../config';\nimport { TransportType } from '../transport';\nimport {
|
|
1
|
+
{"version":3,"file":"web-client.js","sourceRoot":"","sources":["../../../src/client/web-client.ts"],"names":[],"mappings":"","sourcesContent":["import { AmplitudeReturn } from '../amplitude-promise';\nimport { BrowserOptions, ReactNativeOptions } from '../config';\nimport { TransportType } from '../transport';\nimport { CoreClient } from './core-client';\n\ninterface Client extends CoreClient {\n /**\n * Returns current user ID.\n *\n * ```typescript\n * const userId = getUserId();\n * ```\n */\n getUserId(): string | undefined;\n\n /**\n * Sets a new user ID.\n *\n * ```typescript\n * setUserId('userId');\n * ```\n */\n setUserId(userId: string | undefined): void;\n\n /**\n * Returns current device ID.\n *\n * ```typescript\n * const deviceId = getDeviceId();\n * ```\n */\n getDeviceId(): string | undefined;\n\n /**\n * Sets a new device ID.\n * When setting a custom device ID, make sure the value is sufficiently unique.\n * A uuid is recommended.\n *\n * ```typescript\n * setDeviceId('deviceId');\n * ```\n */\n setDeviceId(deviceId: string): void;\n\n /**\n * Returns current session ID.\n *\n * ```typescript\n * const sessionId = getSessionId();\n * ```\n */\n getSessionId(): number | undefined;\n\n /**\n * Sets a new session ID.\n * When settign a custom session ID, make sure the value is in milliseconds since epoch (Unix Timestamp).\n *\n * ```typescript\n * setSessionId(Date.now());\n * ```\n */\n setSessionId(sessionId: number): void;\n\n /**\n * Anonymizes users after they log out, by:\n *\n * * setting userId to undefined\n * * setting deviceId to a new uuid value\n *\n * With an undefined userId and a completely new deviceId, the current user would appear as a brand new user in dashboard.\n *\n * ```typescript\n * import { reset } from '@amplitude/analytics-browser';\n *\n * reset();\n * ```\n */\n reset(): void;\n}\n\nexport interface BrowserClient extends Client {\n /**\n * Initializes the Amplitude SDK with your apiKey, optional configurations.\n * This method must be called before any other operations.\n *\n * ```typescript\n * await init(API_KEY, options).promise;\n * ```\n */\n init(apiKey: string, userId?: string, options?: BrowserOptions): AmplitudeReturn<void>;\n\n /**\n * Sets the network transport type for events.\n *\n * ```typescript\n * // Use Fetch API\n * setTransport('fetch');\n *\n * // Use XMLHttpRequest API\n * setTransport('xhr');\n *\n * // Use navigator.sendBeacon API\n * setTransport('beacon');\n * ```\n */\n setTransport(transport: TransportType): void;\n}\n\nexport interface ReactNativeClient extends Client {\n /**\n * Initializes the Amplitude SDK with your apiKey, optional configurations.\n * This method must be called before any other operations.\n *\n * ```typescript\n * await init(API_KEY, options).promise;\n * ```\n */\n init(apiKey: string, userId?: string, options?: ReactNativeOptions): AmplitudeReturn<void>;\n}\n"]}
|
|
@@ -2,9 +2,11 @@ import { UserSession } from '../user-session';
|
|
|
2
2
|
import { Storage } from '../storage';
|
|
3
3
|
import { TransportType } from '../transport';
|
|
4
4
|
import { Config } from './core';
|
|
5
|
+
import { PageTrackingOptions } from '../page-view-tracking';
|
|
5
6
|
export interface BrowserConfig extends Config {
|
|
6
7
|
appVersion?: string;
|
|
7
8
|
attribution?: AttributionOptions;
|
|
9
|
+
defaultTracking?: boolean | DefaultTrackingOptions;
|
|
8
10
|
deviceId?: string;
|
|
9
11
|
cookieExpiration: number;
|
|
10
12
|
cookieSameSite: string;
|
|
@@ -20,6 +22,12 @@ export interface BrowserConfig extends Config {
|
|
|
20
22
|
trackingOptions: TrackingOptions;
|
|
21
23
|
userId?: string;
|
|
22
24
|
}
|
|
25
|
+
export interface DefaultTrackingOptions {
|
|
26
|
+
fileDownloads?: boolean;
|
|
27
|
+
formInteractions?: boolean;
|
|
28
|
+
pageViews?: boolean | PageTrackingOptions;
|
|
29
|
+
sessions?: boolean;
|
|
30
|
+
}
|
|
23
31
|
export interface TrackingOptions {
|
|
24
32
|
deviceManufacturer?: boolean;
|
|
25
33
|
deviceModel?: boolean;
|
|
@@ -34,6 +42,7 @@ export interface AttributionOptions {
|
|
|
34
42
|
disabled?: boolean;
|
|
35
43
|
excludeReferrers?: string[];
|
|
36
44
|
initialEmptyValue?: string;
|
|
45
|
+
resetSessionOnNewCampaign?: boolean;
|
|
37
46
|
trackNewCampaigns?: boolean;
|
|
38
47
|
trackPageViews?: boolean;
|
|
39
48
|
}
|
|
@@ -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,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;
|
|
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,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,MAAM,WAAW,aAAc,SAAQ,MAAM;IAC3C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC,eAAe,CAAC,EAAE,OAAO,GAAG,sBAAsB,CAAC;IACnD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,MAAM,CAAC;IACzB,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,OAAO,CAAC;IACtB,aAAa,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;IACpC,aAAa,EAAE,OAAO,CAAC;IACvB,cAAc,EAAE,OAAO,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,eAAe,CAAC;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,sBAAsB;IACrC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,SAAS,CAAC,EAAE,OAAO,GAAG,mBAAmB,CAAC;IAC1C,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,eAAe;IAC9B,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;CACpC;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,MAAM,WAAW,cAAe,SAAQ,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE,QAAQ,CAAC;IAC5E,SAAS,CAAC,EAAE,aAAa,GAAG,MAAM,OAAO,aAAa,CAAC;CACxD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser.js","sourceRoot":"","sources":["../../../src/config/browser.ts"],"names":[],"mappings":"","sourcesContent":["import { UserSession } from '../user-session';\nimport { Storage } from '../storage';\nimport { TransportType } from '../transport';\nimport { Config } from './core';\n\nexport interface BrowserConfig extends Config {\n appVersion?: string;\n attribution?: AttributionOptions;\n deviceId?: string;\n cookieExpiration: number;\n cookieSameSite: string;\n cookieSecure: boolean;\n cookieStorage: Storage<UserSession>;\n cookieUpgrade: boolean;\n disableCookies: boolean;\n domain: string;\n lastEventTime?: number;\n partnerId?: string;\n sessionId?: number;\n sessionTimeout: number;\n trackingOptions: TrackingOptions;\n userId?: string;\n}\n\nexport interface TrackingOptions {\n deviceManufacturer?: boolean;\n deviceModel?: boolean;\n ipAddress?: boolean;\n language?: boolean;\n osName?: boolean;\n osVersion?: boolean;\n platform?: boolean;\n [key: string]: boolean | undefined;\n}\n\nexport interface AttributionOptions {\n disabled?: boolean;\n excludeReferrers?: string[];\n initialEmptyValue?: string;\n trackNewCampaigns?: boolean;\n trackPageViews?: boolean;\n}\n\nexport interface BrowserOptions extends Omit<Partial<BrowserConfig>, 'apiKey'> {\n transport?: TransportType | keyof typeof TransportType;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"browser.js","sourceRoot":"","sources":["../../../src/config/browser.ts"],"names":[],"mappings":"","sourcesContent":["import { UserSession } from '../user-session';\nimport { Storage } from '../storage';\nimport { TransportType } from '../transport';\nimport { Config } from './core';\nimport { PageTrackingOptions } from '../page-view-tracking';\n\nexport interface BrowserConfig extends Config {\n appVersion?: string;\n attribution?: AttributionOptions;\n defaultTracking?: boolean | DefaultTrackingOptions;\n deviceId?: string;\n cookieExpiration: number;\n cookieSameSite: string;\n cookieSecure: boolean;\n cookieStorage: Storage<UserSession>;\n cookieUpgrade: boolean;\n disableCookies: boolean;\n domain: string;\n lastEventTime?: number;\n partnerId?: string;\n sessionId?: number;\n sessionTimeout: number;\n trackingOptions: TrackingOptions;\n userId?: string;\n}\n\nexport interface DefaultTrackingOptions {\n fileDownloads?: boolean;\n formInteractions?: boolean;\n pageViews?: boolean | PageTrackingOptions;\n sessions?: boolean;\n}\n\nexport interface TrackingOptions {\n deviceManufacturer?: boolean;\n deviceModel?: boolean;\n ipAddress?: boolean;\n language?: boolean;\n osName?: boolean;\n osVersion?: boolean;\n platform?: boolean;\n [key: string]: boolean | undefined;\n}\n\nexport interface AttributionOptions {\n disabled?: boolean;\n excludeReferrers?: string[];\n initialEmptyValue?: string;\n resetSessionOnNewCampaign?: boolean;\n trackNewCampaigns?: boolean;\n trackPageViews?: boolean;\n}\n\nexport interface BrowserOptions extends Omit<Partial<BrowserConfig>, 'apiKey'> {\n transport?: TransportType | keyof typeof TransportType;\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { Config, Options } from './core';
|
|
2
|
-
export { BrowserConfig, TrackingOptions, AttributionOptions, BrowserOptions } from './browser';
|
|
2
|
+
export { BrowserConfig, DefaultTrackingOptions, TrackingOptions, AttributionOptions, BrowserOptions } from './browser';
|
|
3
3
|
export { NodeConfig, NodeOptions } from './node';
|
|
4
4
|
export { 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,eAAe,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;
|
|
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,EAAE,iBAAiB,EAAE,0BAA0B,EAAE,kBAAkB,EAAE,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, TrackingOptions, AttributionOptions, BrowserOptions } from './browser';\nexport { NodeConfig, NodeOptions } from './node';\nexport { ReactNativeConfig, ReactNativeTrackingOptions, ReactNativeOptions } from './react-native';\n"]}
|
|
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 { ReactNativeConfig, ReactNativeTrackingOptions, ReactNativeOptions } from './react-native';\n"]}
|
package/lib/cjs/index.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ 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, Options, NodeConfig, NodeOptions, ReactNativeConfig, ReactNativeOptions, ReactNativeTrackingOptions, TrackingOptions, } from './config';
|
|
6
|
-
export { CoreClient } from './core-client';
|
|
5
|
+
export { AttributionOptions, BrowserConfig, BrowserOptions, Config, DefaultTrackingOptions, Options, NodeConfig, NodeOptions, ReactNativeConfig, ReactNativeOptions, ReactNativeTrackingOptions, TrackingOptions, } from './config';
|
|
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';
|
|
9
9
|
export { EventCallback } from './event-callback';
|
|
@@ -22,4 +22,5 @@ export { CookieStorageOptions, Storage } from './storage';
|
|
|
22
22
|
export { Transport, TransportType } from './transport';
|
|
23
23
|
export { UserSession } from './user-session';
|
|
24
24
|
export { UTMData } from './utm';
|
|
25
|
+
export { PageTrackingOptions, PageTrackingTrackOn, PageTrackingHistoryChanges } from './page-view-tracking';
|
|
25
26
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/cjs/index.d.ts.map
CHANGED
|
@@ -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,OAAO,EACP,UAAU,EACV,WAAW,EACX,iBAAiB,EACjB,kBAAkB,EAClB,0BAA0B,EAC1B,eAAe,GAChB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,UAAU,EAAE,MAAM,
|
|
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,kBA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CAAC;AACpH,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,oBAAoB,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1D,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"}
|
package/lib/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;
|
|
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;AAIzB,mCAAiG;AAA7B,oGAAA,UAAU,OAAA;AAI9E,6CAA2C;AAAlC,yGAAA,UAAU,OAAA;AACnB,mCAAkC;AAAzB,gGAAA,MAAM,OAAA;AAEf,yCAAuD;AAAnC,0GAAA,aAAa,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 } from './server-zone';\nexport { Status } from './status';\nexport { CookieStorageOptions, 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';\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface PageTrackingOptions {
|
|
2
|
+
trackOn?: PageTrackingTrackOn;
|
|
3
|
+
trackHistoryChanges?: PageTrackingHistoryChanges;
|
|
4
|
+
eventType?: string;
|
|
5
|
+
}
|
|
6
|
+
export type PageTrackingTrackOn = 'attribution' | (() => boolean);
|
|
7
|
+
export type PageTrackingHistoryChanges = 'all' | 'pathOnly';
|
|
8
|
+
//# sourceMappingURL=page-view-tracking.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page-view-tracking.d.ts","sourceRoot":"","sources":["../../src/page-view-tracking.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,mBAAmB;IAClC,OAAO,CAAC,EAAE,mBAAmB,CAAC;IAC9B,mBAAmB,CAAC,EAAE,0BAA0B,CAAC;IACjD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,MAAM,mBAAmB,GAAG,aAAa,GAAG,CAAC,MAAM,OAAO,CAAC,CAAC;AAElE,MAAM,MAAM,0BAA0B,GAAG,KAAK,GAAG,UAAU,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
-
//# sourceMappingURL=
|
|
2
|
+
//# sourceMappingURL=page-view-tracking.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page-view-tracking.js","sourceRoot":"","sources":["../../src/page-view-tracking.ts"],"names":[],"mappings":"","sourcesContent":["export interface PageTrackingOptions {\n trackOn?: PageTrackingTrackOn;\n trackHistoryChanges?: PageTrackingHistoryChanges;\n eventType?: string;\n}\n\nexport type PageTrackingTrackOn = 'attribution' | (() => boolean);\n\nexport type PageTrackingHistoryChanges = 'all' | 'pathOnly';\n"]}
|
package/lib/cjs/plugin.d.ts
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { Event } from './event';
|
|
2
2
|
import { Config } from './config';
|
|
3
3
|
import { Result } from './result';
|
|
4
|
-
import {
|
|
4
|
+
import { CoreClient } from './client/core-client';
|
|
5
5
|
export declare enum PluginType {
|
|
6
6
|
BEFORE = "before",
|
|
7
7
|
ENRICHMENT = "enrichment",
|
|
8
8
|
DESTINATION = "destination"
|
|
9
9
|
}
|
|
10
|
-
export interface BeforePlugin<T =
|
|
10
|
+
export interface BeforePlugin<T = CoreClient> {
|
|
11
11
|
name: string;
|
|
12
12
|
type: PluginType.BEFORE;
|
|
13
13
|
setup(config: Config, client?: T): Promise<void>;
|
|
14
14
|
execute(context: Event): Promise<Event>;
|
|
15
15
|
}
|
|
16
|
-
export interface EnrichmentPlugin<T =
|
|
16
|
+
export interface EnrichmentPlugin<T = CoreClient> {
|
|
17
17
|
name: string;
|
|
18
18
|
type: PluginType.ENRICHMENT;
|
|
19
19
|
setup(config: Config, client?: T): Promise<void>;
|
|
20
20
|
execute(context: Event): Promise<Event>;
|
|
21
21
|
}
|
|
22
|
-
export interface DestinationPlugin<T =
|
|
22
|
+
export interface DestinationPlugin<T = CoreClient> {
|
|
23
23
|
name: string;
|
|
24
24
|
type: PluginType.DESTINATION;
|
|
25
25
|
setup(config: Config, client?: T): Promise<void>;
|
package/lib/cjs/plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../src/plugin.ts"],"names":[],"mappings":";;AAKA,IAAY,UAIX;AAJD,WAAY,UAAU;IACpB,+BAAiB,CAAA;IACjB,uCAAyB,CAAA;IACzB,yCAA2B,CAAA;AAC7B,CAAC,EAJW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAIrB","sourcesContent":["import { Event } from './event';\nimport { Config } from './config';\nimport { Result } from './result';\nimport {
|
|
1
|
+
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../src/plugin.ts"],"names":[],"mappings":";;AAKA,IAAY,UAIX;AAJD,WAAY,UAAU;IACpB,+BAAiB,CAAA;IACjB,uCAAyB,CAAA;IACzB,yCAA2B,CAAA;AAC7B,CAAC,EAJW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAIrB","sourcesContent":["import { Event } from './event';\nimport { Config } from './config';\nimport { Result } from './result';\nimport { CoreClient } from './client/core-client';\n\nexport enum PluginType {\n BEFORE = 'before',\n ENRICHMENT = 'enrichment',\n DESTINATION = 'destination',\n}\n\nexport interface BeforePlugin<T = CoreClient> {\n name: string;\n type: PluginType.BEFORE;\n setup(config: Config, client?: T): Promise<void>;\n execute(context: Event): Promise<Event>;\n}\n\nexport interface EnrichmentPlugin<T = CoreClient> {\n name: string;\n type: PluginType.ENRICHMENT;\n setup(config: Config, client?: T): Promise<void>;\n execute(context: Event): Promise<Event>;\n}\n\nexport interface DestinationPlugin<T = CoreClient> {\n name: string;\n type: PluginType.DESTINATION;\n setup(config: Config, client?: T): Promise<void>;\n execute(context: Event): Promise<Result>;\n flush?(): Promise<void>;\n}\n\nexport type Plugin = BeforePlugin | EnrichmentPlugin | DestinationPlugin;\n"]}
|
|
@@ -3,7 +3,7 @@ import { BaseEvent, EventOptions } from '../base-event';
|
|
|
3
3
|
import { Identify, Revenue } from '../event';
|
|
4
4
|
import { Plugin } from '../plugin';
|
|
5
5
|
import { Result } from '../result';
|
|
6
|
-
export interface
|
|
6
|
+
export interface CoreClient {
|
|
7
7
|
/**
|
|
8
8
|
* Adds a new plugin.
|
|
9
9
|
*
|
|
@@ -136,4 +136,4 @@ export interface BaseClient {
|
|
|
136
136
|
*/
|
|
137
137
|
flush(): AmplitudeReturn<void>;
|
|
138
138
|
}
|
|
139
|
-
//# sourceMappingURL=
|
|
139
|
+
//# sourceMappingURL=core-client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"
|
|
1
|
+
{"version":3,"file":"core-client.d.ts","sourceRoot":"","sources":["../../../src/client/core-client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC,MAAM,WAAW,UAAU;IACzB;;;;;;;;;;;;;;;;OAgBG;IACH,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC;IAE3C;;;;;;OAMG;IACH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AAC,CAAC;CAChC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core-client.js","sourceRoot":"","sources":["../../../src/client/core-client.ts"],"names":[],"mappings":"","sourcesContent":["// import { Config } from '../config';\nimport { AmplitudeReturn } from '../amplitude-promise';\nimport { BaseEvent, EventOptions } from '../base-event';\nimport { Identify, Revenue } from '../event';\nimport { Plugin } from '../plugin';\nimport { Result } from '../result';\n\nexport interface CoreClient {\n /**\n * Adds a new plugin.\n *\n * ```typescript\n * const plugin = {\n * name: 'myPlugin',\n * type: PluginType.ENRICHMENT,\n * setup(config: Config) {\n * return;\n * },\n * execute(context: Event) {\n * return context;\n * },\n * };\n * amplitude.add(plugin);\n * ```\n */\n add(plugin: Plugin): AmplitudeReturn<void>;\n\n /**\n * Removes a plugin.\n *\n * ```typescript\n * amplitude.remove('myPlugin');\n * ```\n */\n remove(pluginName: string): AmplitudeReturn<void>;\n\n /**\n * Tracks user-defined event, with specified type, optional event properties and optional overwrites.\n *\n * ```typescript\n * // event tracking with event type only\n * track('Page Load');\n *\n * // event tracking with event type and additional event properties\n * track('Page Load', { loadTime: 1000 });\n *\n * // event tracking with event type, additional event properties, and overwritten event options\n * track('Page Load', { loadTime: 1000 }, { sessionId: -1 });\n *\n * // alternatively, this tracking method is awaitable\n * const result = await track('Page Load').promise;\n * console.log(result.event); // {...}\n * console.log(result.code); // 200\n * console.log(result.message); // \"Event tracked successfully\"\n * ```\n */\n track(\n eventInput: BaseEvent | string,\n eventProperties?: Record<string, any>,\n eventOptions?: EventOptions,\n ): AmplitudeReturn<Result>;\n\n /**\n * Alias for track()\n */\n logEvent(\n eventInput: BaseEvent | string,\n eventProperties?: Record<string, any>,\n eventOptions?: EventOptions,\n ): AmplitudeReturn<Result>;\n\n /**\n * Sends an identify event containing user property operations\n *\n * ```typescript\n * const id = new Identify();\n * id.set('colors', ['rose', 'gold']);\n * identify(id);\n *\n * // alternatively, this tracking method is awaitable\n * const result = await identify(id).promise;\n * console.log(result.event); // {...}\n * console.log(result.code); // 200\n * console.log(result.message); // \"Event tracked successfully\"\n * ```\n */\n identify(identify: Identify, eventOptions?: EventOptions): AmplitudeReturn<Result>;\n\n /**\n * Sends a group identify event containing group property operations.\n *\n * ```typescript\n * const id = new Identify();\n * id.set('skills', ['js', 'ts']);\n * const groupType = 'org';\n * const groupName = 'engineering';\n * groupIdentify(groupType, groupName, id);\n *\n * // alternatively, this tracking method is awaitable\n * const result = await groupIdentify(groupType, groupName, id).promise;\n * console.log(result.event); // {...}\n * console.log(result.code); // 200\n * console.log(result.message); // \"Event tracked successfully\"\n * ```\n */\n groupIdentify(\n groupType: string,\n groupName: string | string[],\n identify: Identify,\n eventOptions?: EventOptions,\n ): AmplitudeReturn<Result>;\n\n /**\n * Assigns a user to group\n *\n * ```typescript\n * const groupType = 'orgId';\n * const groupName = '15';\n * setGroup(groupType, groupName, { user_id: '12345' })\n * ```\n */\n setGroup(groupType: string, groupName: string | string[], eventOptions?: EventOptions): AmplitudeReturn<Result>;\n\n /**\n * Sends a revenue event containing revenue property operations.\n *\n * ```typescript\n * const rev = new Revenue();\n * rev.setRevenue(100);\n * revenue(rev);\n *\n * // alternatively, this tracking method is awaitable\n * const result = await revenue(rev).promise;\n * console.log(result.event); // {...}\n * console.log(result.code); // 200\n * console.log(result.message); // \"Event tracked successfully\"\n * ```\n */\n revenue(revenue: Revenue, eventOptions?: EventOptions): AmplitudeReturn<Result>;\n\n /**\n * Sets a new optOut config value. This toggles event tracking on/off.\n *\n *```typescript\n * // Stops tracking\n * setOptOut(true);\n *\n * // Starts/resumes tracking\n * setOptOut(false);\n * ```\n */\n setOptOut(optOut: boolean): void;\n\n /**\n * Flush all unsent events.\n *\n *```typescript\n * flush();\n * ```\n */\n flush(): AmplitudeReturn<void>;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/client/index.ts"],"names":[],"mappings":"","sourcesContent":["export { BrowserClient, ReactNativeClient } from './web-client';\nexport { NodeClient } from './node-client';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/client/index.ts"],"names":[],"mappings":"","sourcesContent":["export { BrowserClient, ReactNativeClient } from './web-client';\nexport { NodeClient } from './node-client';\nexport { CoreClient } from './core-client';\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AmplitudeReturn } from '../amplitude-promise';
|
|
2
2
|
import { NodeOptions } from '../config';
|
|
3
|
-
import {
|
|
4
|
-
export interface NodeClient extends
|
|
3
|
+
import { CoreClient } from './core-client';
|
|
4
|
+
export interface NodeClient extends CoreClient {
|
|
5
5
|
/**
|
|
6
6
|
* Initializes the Amplitude SDK with your apiKey, optional configurations.
|
|
7
7
|
* This method must be called before any other operations.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-client.js","sourceRoot":"","sources":["../../../src/client/node-client.ts"],"names":[],"mappings":"","sourcesContent":["import { AmplitudeReturn } from '../amplitude-promise';\nimport { NodeOptions } from '../config';\nimport {
|
|
1
|
+
{"version":3,"file":"node-client.js","sourceRoot":"","sources":["../../../src/client/node-client.ts"],"names":[],"mappings":"","sourcesContent":["import { AmplitudeReturn } from '../amplitude-promise';\nimport { NodeOptions } from '../config';\nimport { CoreClient } from './core-client';\n\nexport interface NodeClient extends CoreClient {\n /**\n * Initializes the Amplitude SDK with your apiKey, optional configurations.\n * This method must be called before any other operations.\n *\n * ```typescript\n * await init(API_KEY, options).promise;\n * ```\n */\n init(apiKey: string, options?: NodeOptions): AmplitudeReturn<void>;\n}\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { AmplitudeReturn } from '../amplitude-promise';
|
|
2
2
|
import { BrowserOptions, ReactNativeOptions } from '../config';
|
|
3
3
|
import { TransportType } from '../transport';
|
|
4
|
-
import {
|
|
5
|
-
interface Client extends
|
|
4
|
+
import { CoreClient } from './core-client';
|
|
5
|
+
interface Client extends CoreClient {
|
|
6
6
|
/**
|
|
7
7
|
* Returns current user ID.
|
|
8
8
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web-client.js","sourceRoot":"","sources":["../../../src/client/web-client.ts"],"names":[],"mappings":"","sourcesContent":["import { AmplitudeReturn } from '../amplitude-promise';\nimport { BrowserOptions, ReactNativeOptions } from '../config';\nimport { TransportType } from '../transport';\nimport {
|
|
1
|
+
{"version":3,"file":"web-client.js","sourceRoot":"","sources":["../../../src/client/web-client.ts"],"names":[],"mappings":"","sourcesContent":["import { AmplitudeReturn } from '../amplitude-promise';\nimport { BrowserOptions, ReactNativeOptions } from '../config';\nimport { TransportType } from '../transport';\nimport { CoreClient } from './core-client';\n\ninterface Client extends CoreClient {\n /**\n * Returns current user ID.\n *\n * ```typescript\n * const userId = getUserId();\n * ```\n */\n getUserId(): string | undefined;\n\n /**\n * Sets a new user ID.\n *\n * ```typescript\n * setUserId('userId');\n * ```\n */\n setUserId(userId: string | undefined): void;\n\n /**\n * Returns current device ID.\n *\n * ```typescript\n * const deviceId = getDeviceId();\n * ```\n */\n getDeviceId(): string | undefined;\n\n /**\n * Sets a new device ID.\n * When setting a custom device ID, make sure the value is sufficiently unique.\n * A uuid is recommended.\n *\n * ```typescript\n * setDeviceId('deviceId');\n * ```\n */\n setDeviceId(deviceId: string): void;\n\n /**\n * Returns current session ID.\n *\n * ```typescript\n * const sessionId = getSessionId();\n * ```\n */\n getSessionId(): number | undefined;\n\n /**\n * Sets a new session ID.\n * When settign a custom session ID, make sure the value is in milliseconds since epoch (Unix Timestamp).\n *\n * ```typescript\n * setSessionId(Date.now());\n * ```\n */\n setSessionId(sessionId: number): void;\n\n /**\n * Anonymizes users after they log out, by:\n *\n * * setting userId to undefined\n * * setting deviceId to a new uuid value\n *\n * With an undefined userId and a completely new deviceId, the current user would appear as a brand new user in dashboard.\n *\n * ```typescript\n * import { reset } from '@amplitude/analytics-browser';\n *\n * reset();\n * ```\n */\n reset(): void;\n}\n\nexport interface BrowserClient extends Client {\n /**\n * Initializes the Amplitude SDK with your apiKey, optional configurations.\n * This method must be called before any other operations.\n *\n * ```typescript\n * await init(API_KEY, options).promise;\n * ```\n */\n init(apiKey: string, userId?: string, options?: BrowserOptions): AmplitudeReturn<void>;\n\n /**\n * Sets the network transport type for events.\n *\n * ```typescript\n * // Use Fetch API\n * setTransport('fetch');\n *\n * // Use XMLHttpRequest API\n * setTransport('xhr');\n *\n * // Use navigator.sendBeacon API\n * setTransport('beacon');\n * ```\n */\n setTransport(transport: TransportType): void;\n}\n\nexport interface ReactNativeClient extends Client {\n /**\n * Initializes the Amplitude SDK with your apiKey, optional configurations.\n * This method must be called before any other operations.\n *\n * ```typescript\n * await init(API_KEY, options).promise;\n * ```\n */\n init(apiKey: string, userId?: string, options?: ReactNativeOptions): AmplitudeReturn<void>;\n}\n"]}
|
|
@@ -2,9 +2,11 @@ import { UserSession } from '../user-session';
|
|
|
2
2
|
import { Storage } from '../storage';
|
|
3
3
|
import { TransportType } from '../transport';
|
|
4
4
|
import { Config } from './core';
|
|
5
|
+
import { PageTrackingOptions } from '../page-view-tracking';
|
|
5
6
|
export interface BrowserConfig extends Config {
|
|
6
7
|
appVersion?: string;
|
|
7
8
|
attribution?: AttributionOptions;
|
|
9
|
+
defaultTracking?: boolean | DefaultTrackingOptions;
|
|
8
10
|
deviceId?: string;
|
|
9
11
|
cookieExpiration: number;
|
|
10
12
|
cookieSameSite: string;
|
|
@@ -20,6 +22,12 @@ export interface BrowserConfig extends Config {
|
|
|
20
22
|
trackingOptions: TrackingOptions;
|
|
21
23
|
userId?: string;
|
|
22
24
|
}
|
|
25
|
+
export interface DefaultTrackingOptions {
|
|
26
|
+
fileDownloads?: boolean;
|
|
27
|
+
formInteractions?: boolean;
|
|
28
|
+
pageViews?: boolean | PageTrackingOptions;
|
|
29
|
+
sessions?: boolean;
|
|
30
|
+
}
|
|
23
31
|
export interface TrackingOptions {
|
|
24
32
|
deviceManufacturer?: boolean;
|
|
25
33
|
deviceModel?: boolean;
|
|
@@ -34,6 +42,7 @@ export interface AttributionOptions {
|
|
|
34
42
|
disabled?: boolean;
|
|
35
43
|
excludeReferrers?: string[];
|
|
36
44
|
initialEmptyValue?: string;
|
|
45
|
+
resetSessionOnNewCampaign?: boolean;
|
|
37
46
|
trackNewCampaigns?: boolean;
|
|
38
47
|
trackPageViews?: boolean;
|
|
39
48
|
}
|
|
@@ -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,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;
|
|
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,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OA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,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;CACpC;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,MAAM,WAAW,cAAe,SAAQ,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE,QAAQ,CAAC;IAC5E,SAAS,CAAC,EAAE,aAAa,GAAG,MAAM,OAAO,aAAa,CAAC;CACxD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser.js","sourceRoot":"","sources":["../../../src/config/browser.ts"],"names":[],"mappings":"","sourcesContent":["import { UserSession } from '../user-session';\nimport { Storage } from '../storage';\nimport { TransportType } from '../transport';\nimport { Config } from './core';\n\nexport interface BrowserConfig extends Config {\n appVersion?: string;\n attribution?: AttributionOptions;\n deviceId?: string;\n cookieExpiration: number;\n cookieSameSite: string;\n cookieSecure: boolean;\n cookieStorage: Storage<UserSession>;\n cookieUpgrade: boolean;\n disableCookies: boolean;\n domain: string;\n lastEventTime?: number;\n partnerId?: string;\n sessionId?: number;\n sessionTimeout: number;\n trackingOptions: TrackingOptions;\n userId?: string;\n}\n\nexport interface TrackingOptions {\n deviceManufacturer?: boolean;\n deviceModel?: boolean;\n ipAddress?: boolean;\n language?: boolean;\n osName?: boolean;\n osVersion?: boolean;\n platform?: boolean;\n [key: string]: boolean | undefined;\n}\n\nexport interface AttributionOptions {\n disabled?: boolean;\n excludeReferrers?: string[];\n initialEmptyValue?: string;\n trackNewCampaigns?: boolean;\n trackPageViews?: boolean;\n}\n\nexport interface BrowserOptions extends Omit<Partial<BrowserConfig>, 'apiKey'> {\n transport?: TransportType | keyof typeof TransportType;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"browser.js","sourceRoot":"","sources":["../../../src/config/browser.ts"],"names":[],"mappings":"","sourcesContent":["import { UserSession } from '../user-session';\nimport { Storage } from '../storage';\nimport { TransportType } from '../transport';\nimport { Config } from './core';\nimport { PageTrackingOptions } from '../page-view-tracking';\n\nexport interface BrowserConfig extends Config {\n appVersion?: string;\n attribution?: AttributionOptions;\n defaultTracking?: boolean | DefaultTrackingOptions;\n deviceId?: string;\n cookieExpiration: number;\n cookieSameSite: string;\n cookieSecure: boolean;\n cookieStorage: Storage<UserSession>;\n cookieUpgrade: boolean;\n disableCookies: boolean;\n domain: string;\n lastEventTime?: number;\n partnerId?: string;\n sessionId?: number;\n sessionTimeout: number;\n trackingOptions: TrackingOptions;\n userId?: string;\n}\n\nexport interface DefaultTrackingOptions {\n fileDownloads?: boolean;\n formInteractions?: boolean;\n pageViews?: boolean | PageTrackingOptions;\n sessions?: boolean;\n}\n\nexport interface TrackingOptions {\n deviceManufacturer?: boolean;\n deviceModel?: boolean;\n ipAddress?: boolean;\n language?: boolean;\n osName?: boolean;\n osVersion?: boolean;\n platform?: boolean;\n [key: string]: boolean | undefined;\n}\n\nexport interface AttributionOptions {\n disabled?: boolean;\n excludeReferrers?: string[];\n initialEmptyValue?: string;\n resetSessionOnNewCampaign?: boolean;\n trackNewCampaigns?: boolean;\n trackPageViews?: boolean;\n}\n\nexport interface BrowserOptions extends Omit<Partial<BrowserConfig>, 'apiKey'> {\n transport?: TransportType | keyof typeof TransportType;\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { Config, Options } from './core';
|
|
2
|
-
export { BrowserConfig, TrackingOptions, AttributionOptions, BrowserOptions } from './browser';
|
|
2
|
+
export { BrowserConfig, DefaultTrackingOptions, TrackingOptions, AttributionOptions, BrowserOptions } from './browser';
|
|
3
3
|
export { NodeConfig, NodeOptions } from './node';
|
|
4
4
|
export { 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,eAAe,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;
|
|
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,EAAE,iBAAiB,EAAE,0BAA0B,EAAE,kBAAkB,EAAE,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, TrackingOptions, AttributionOptions, BrowserOptions } from './browser';\nexport { NodeConfig, NodeOptions } from './node';\nexport { ReactNativeConfig, ReactNativeTrackingOptions, ReactNativeOptions } from './react-native';\n"]}
|
|
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 { ReactNativeConfig, ReactNativeTrackingOptions, ReactNativeOptions } from './react-native';\n"]}
|
package/lib/esm/index.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ 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, Options, NodeConfig, NodeOptions, ReactNativeConfig, ReactNativeOptions, ReactNativeTrackingOptions, TrackingOptions, } from './config';
|
|
6
|
-
export { CoreClient } from './core-client';
|
|
5
|
+
export { AttributionOptions, BrowserConfig, BrowserOptions, Config, DefaultTrackingOptions, Options, NodeConfig, NodeOptions, ReactNativeConfig, ReactNativeOptions, ReactNativeTrackingOptions, TrackingOptions, } from './config';
|
|
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';
|
|
9
9
|
export { EventCallback } from './event-callback';
|
|
@@ -22,4 +22,5 @@ export { CookieStorageOptions, Storage } from './storage';
|
|
|
22
22
|
export { Transport, TransportType } from './transport';
|
|
23
23
|
export { UserSession } from './user-session';
|
|
24
24
|
export { UTMData } from './utm';
|
|
25
|
+
export { PageTrackingOptions, PageTrackingTrackOn, PageTrackingHistoryChanges } from './page-view-tracking';
|
|
25
26
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/esm/index.d.ts.map
CHANGED
|
@@ -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,OAAO,EACP,UAAU,EACV,WAAW,EACX,iBAAiB,EACjB,kBAAkB,EAClB,0BAA0B,EAC1B,eAAe,GAChB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,UAAU,EAAE,MAAM,
|
|
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,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1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"
|
|
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;AAIrE,OAAO,EAA6D,UAAU,EAAE,MAAM,UAAU,CAAC;AAIjG,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,OAAO,EAAa,aAAa,EAAE,MAAM,aAAa,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 } from './server-zone';\nexport { Status } from './status';\nexport { CookieStorageOptions, 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';\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface PageTrackingOptions {
|
|
2
|
+
trackOn?: PageTrackingTrackOn;
|
|
3
|
+
trackHistoryChanges?: PageTrackingHistoryChanges;
|
|
4
|
+
eventType?: string;
|
|
5
|
+
}
|
|
6
|
+
export type PageTrackingTrackOn = 'attribution' | (() => boolean);
|
|
7
|
+
export type PageTrackingHistoryChanges = 'all' | 'pathOnly';
|
|
8
|
+
//# sourceMappingURL=page-view-tracking.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page-view-tracking.d.ts","sourceRoot":"","sources":["../../src/page-view-tracking.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,mBAAmB;IAClC,OAAO,CAAC,EAAE,mBAAmB,CAAC;IAC9B,mBAAmB,CAAC,EAAE,0BAA0B,CAAC;IACjD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,MAAM,mBAAmB,GAAG,aAAa,GAAG,CAAC,MAAM,OAAO,CAAC,CAAC;AAElE,MAAM,MAAM,0BAA0B,GAAG,KAAK,GAAG,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page-view-tracking.js","sourceRoot":"","sources":["../../src/page-view-tracking.ts"],"names":[],"mappings":"","sourcesContent":["export interface PageTrackingOptions {\n trackOn?: PageTrackingTrackOn;\n trackHistoryChanges?: PageTrackingHistoryChanges;\n eventType?: string;\n}\n\nexport type PageTrackingTrackOn = 'attribution' | (() => boolean);\n\nexport type PageTrackingHistoryChanges = 'all' | 'pathOnly';\n"]}
|
package/lib/esm/plugin.d.ts
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { Event } from './event';
|
|
2
2
|
import { Config } from './config';
|
|
3
3
|
import { Result } from './result';
|
|
4
|
-
import {
|
|
4
|
+
import { CoreClient } from './client/core-client';
|
|
5
5
|
export declare enum PluginType {
|
|
6
6
|
BEFORE = "before",
|
|
7
7
|
ENRICHMENT = "enrichment",
|
|
8
8
|
DESTINATION = "destination"
|
|
9
9
|
}
|
|
10
|
-
export interface BeforePlugin<T =
|
|
10
|
+
export interface BeforePlugin<T = CoreClient> {
|
|
11
11
|
name: string;
|
|
12
12
|
type: PluginType.BEFORE;
|
|
13
13
|
setup(config: Config, client?: T): Promise<void>;
|
|
14
14
|
execute(context: Event): Promise<Event>;
|
|
15
15
|
}
|
|
16
|
-
export interface EnrichmentPlugin<T =
|
|
16
|
+
export interface EnrichmentPlugin<T = CoreClient> {
|
|
17
17
|
name: string;
|
|
18
18
|
type: PluginType.ENRICHMENT;
|
|
19
19
|
setup(config: Config, client?: T): Promise<void>;
|
|
20
20
|
execute(context: Event): Promise<Event>;
|
|
21
21
|
}
|
|
22
|
-
export interface DestinationPlugin<T =
|
|
22
|
+
export interface DestinationPlugin<T = CoreClient> {
|
|
23
23
|
name: string;
|
|
24
24
|
type: PluginType.DESTINATION;
|
|
25
25
|
setup(config: Config, client?: T): Promise<void>;
|
package/lib/esm/plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../src/plugin.ts"],"names":[],"mappings":"AAKA,MAAM,CAAN,IAAY,UAIX;AAJD,WAAY,UAAU;IACpB,+BAAiB,CAAA;IACjB,uCAAyB,CAAA;IACzB,yCAA2B,CAAA;AAC7B,CAAC,EAJW,UAAU,KAAV,UAAU,QAIrB","sourcesContent":["import { Event } from './event';\nimport { Config } from './config';\nimport { Result } from './result';\nimport {
|
|
1
|
+
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../src/plugin.ts"],"names":[],"mappings":"AAKA,MAAM,CAAN,IAAY,UAIX;AAJD,WAAY,UAAU;IACpB,+BAAiB,CAAA;IACjB,uCAAyB,CAAA;IACzB,yCAA2B,CAAA;AAC7B,CAAC,EAJW,UAAU,KAAV,UAAU,QAIrB","sourcesContent":["import { Event } from './event';\nimport { Config } from './config';\nimport { Result } from './result';\nimport { CoreClient } from './client/core-client';\n\nexport enum PluginType {\n BEFORE = 'before',\n ENRICHMENT = 'enrichment',\n DESTINATION = 'destination',\n}\n\nexport interface BeforePlugin<T = CoreClient> {\n name: string;\n type: PluginType.BEFORE;\n setup(config: Config, client?: T): Promise<void>;\n execute(context: Event): Promise<Event>;\n}\n\nexport interface EnrichmentPlugin<T = CoreClient> {\n name: string;\n type: PluginType.ENRICHMENT;\n setup(config: Config, client?: T): Promise<void>;\n execute(context: Event): Promise<Event>;\n}\n\nexport interface DestinationPlugin<T = CoreClient> {\n name: string;\n type: PluginType.DESTINATION;\n setup(config: Config, client?: T): Promise<void>;\n execute(context: Event): Promise<Result>;\n flush?(): Promise<void>;\n}\n\nexport type Plugin = BeforePlugin | EnrichmentPlugin | DestinationPlugin;\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@amplitude/analytics-types",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.0-beta.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "Amplitude Inc",
|
|
6
6
|
"homepage": "https://github.com/amplitude/Amplitude-TypeScript",
|
|
@@ -34,5 +34,5 @@
|
|
|
34
34
|
"files": [
|
|
35
35
|
"lib"
|
|
36
36
|
],
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "5590f7d77d93362d2f3db6d47116ca502afd1fc4"
|
|
38
38
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base-client.js","sourceRoot":"","sources":["../../../src/client/base-client.ts"],"names":[],"mappings":"","sourcesContent":["import { AmplitudeReturn } from '../amplitude-promise';\nimport { BaseEvent, EventOptions } from '../base-event';\nimport { Identify, Revenue } from '../event';\nimport { Plugin } from '../plugin';\nimport { Result } from '../result';\n\nexport interface BaseClient {\n /**\n * Adds a new plugin.\n *\n * ```typescript\n * const plugin = {\n * name: 'myPlugin',\n * type: PluginType.ENRICHMENT,\n * setup(config: Config) {\n * return;\n * },\n * execute(context: Event) {\n * return context;\n * },\n * };\n * amplitude.add(plugin);\n * ```\n */\n add(plugin: Plugin): AmplitudeReturn<void>;\n\n /**\n * Removes a plugin.\n *\n * ```typescript\n * amplitude.remove('myPlugin');\n * ```\n */\n remove(pluginName: string): AmplitudeReturn<void>;\n\n /**\n * Tracks user-defined event, with specified type, optional event properties and optional overwrites.\n *\n * ```typescript\n * // event tracking with event type only\n * track('Page Load');\n *\n * // event tracking with event type and additional event properties\n * track('Page Load', { loadTime: 1000 });\n *\n * // event tracking with event type, additional event properties, and overwritten event options\n * track('Page Load', { loadTime: 1000 }, { sessionId: -1 });\n *\n * // alternatively, this tracking method is awaitable\n * const result = await track('Page Load').promise;\n * console.log(result.event); // {...}\n * console.log(result.code); // 200\n * console.log(result.message); // \"Event tracked successfully\"\n * ```\n */\n track(\n eventInput: BaseEvent | string,\n eventProperties?: Record<string, any>,\n eventOptions?: EventOptions,\n ): AmplitudeReturn<Result>;\n\n /**\n * Alias for track()\n */\n logEvent(\n eventInput: BaseEvent | string,\n eventProperties?: Record<string, any>,\n eventOptions?: EventOptions,\n ): AmplitudeReturn<Result>;\n\n /**\n * Sends an identify event containing user property operations\n *\n * ```typescript\n * const id = new Identify();\n * id.set('colors', ['rose', 'gold']);\n * identify(id);\n *\n * // alternatively, this tracking method is awaitable\n * const result = await identify(id).promise;\n * console.log(result.event); // {...}\n * console.log(result.code); // 200\n * console.log(result.message); // \"Event tracked successfully\"\n * ```\n */\n identify(identify: Identify, eventOptions?: EventOptions): AmplitudeReturn<Result>;\n\n /**\n * Sends a group identify event containing group property operations.\n *\n * ```typescript\n * const id = new Identify();\n * id.set('skills', ['js', 'ts']);\n * const groupType = 'org';\n * const groupName = 'engineering';\n * groupIdentify(groupType, groupName, id);\n *\n * // alternatively, this tracking method is awaitable\n * const result = await groupIdentify(groupType, groupName, id).promise;\n * console.log(result.event); // {...}\n * console.log(result.code); // 200\n * console.log(result.message); // \"Event tracked successfully\"\n * ```\n */\n groupIdentify(\n groupType: string,\n groupName: string | string[],\n identify: Identify,\n eventOptions?: EventOptions,\n ): AmplitudeReturn<Result>;\n\n /**\n * Assigns a user to group\n *\n * ```typescript\n * const groupType = 'orgId';\n * const groupName = '15';\n * setGroup(groupType, groupName, { user_id: '12345' })\n * ```\n */\n setGroup(groupType: string, groupName: string | string[], eventOptions?: EventOptions): AmplitudeReturn<Result>;\n\n /**\n * Sends a revenue event containing revenue property operations.\n *\n * ```typescript\n * const rev = new Revenue();\n * rev.setRevenue(100);\n * revenue(rev);\n *\n * // alternatively, this tracking method is awaitable\n * const result = await revenue(rev).promise;\n * console.log(result.event); // {...}\n * console.log(result.code); // 200\n * console.log(result.message); // \"Event tracked successfully\"\n * ```\n */\n revenue(revenue: Revenue, eventOptions?: EventOptions): AmplitudeReturn<Result>;\n\n /**\n * Sets a new optOut config value. This toggles event tracking on/off.\n *\n *```typescript\n * // Stops tracking\n * setOptOut(true);\n *\n * // Starts/resumes tracking\n * setOptOut(false);\n * ```\n */\n setOptOut(optOut: boolean): void;\n\n /**\n * Flush all unsent events.\n *\n *```typescript\n * flush();\n * ```\n */\n flush(): AmplitudeReturn<void>;\n}\n"]}
|
package/lib/cjs/core-client.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { BaseEvent, EventOptions } from './base-event';
|
|
2
|
-
import { Config } from './config';
|
|
3
|
-
import { Result } from './result';
|
|
4
|
-
export interface CoreClient<T extends Config> {
|
|
5
|
-
config: T;
|
|
6
|
-
track(eventInput: BaseEvent | string, eventProperties?: Record<string, any>, eventOptions?: EventOptions): Promise<Result>;
|
|
7
|
-
}
|
|
8
|
-
//# sourceMappingURL=core-client.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"core-client.d.ts","sourceRoot":"","sources":["../../src/core-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,MAAM,WAAW,UAAU,CAAC,CAAC,SAAS,MAAM;IAC1C,MAAM,EAAE,CAAC,CAAC;IACV,KAAK,CACH,UAAU,EAAE,SAAS,GAAG,MAAM,EAC9B,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACrC,YAAY,CAAC,EAAE,YAAY,GAC1B,OAAO,CAAC,MAAM,CAAC,CAAC;CACpB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"core-client.js","sourceRoot":"","sources":["../../src/core-client.ts"],"names":[],"mappings":"","sourcesContent":["import { BaseEvent, EventOptions } from './base-event';\nimport { Config } from './config';\nimport { Result } from './result';\n\nexport interface CoreClient<T extends Config> {\n config: T;\n track(\n eventInput: BaseEvent | string,\n eventProperties?: Record<string, any>,\n eventOptions?: EventOptions,\n ): Promise<Result>;\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base-client.js","sourceRoot":"","sources":["../../../src/client/base-client.ts"],"names":[],"mappings":"","sourcesContent":["import { AmplitudeReturn } from '../amplitude-promise';\nimport { BaseEvent, EventOptions } from '../base-event';\nimport { Identify, Revenue } from '../event';\nimport { Plugin } from '../plugin';\nimport { Result } from '../result';\n\nexport interface BaseClient {\n /**\n * Adds a new plugin.\n *\n * ```typescript\n * const plugin = {\n * name: 'myPlugin',\n * type: PluginType.ENRICHMENT,\n * setup(config: Config) {\n * return;\n * },\n * execute(context: Event) {\n * return context;\n * },\n * };\n * amplitude.add(plugin);\n * ```\n */\n add(plugin: Plugin): AmplitudeReturn<void>;\n\n /**\n * Removes a plugin.\n *\n * ```typescript\n * amplitude.remove('myPlugin');\n * ```\n */\n remove(pluginName: string): AmplitudeReturn<void>;\n\n /**\n * Tracks user-defined event, with specified type, optional event properties and optional overwrites.\n *\n * ```typescript\n * // event tracking with event type only\n * track('Page Load');\n *\n * // event tracking with event type and additional event properties\n * track('Page Load', { loadTime: 1000 });\n *\n * // event tracking with event type, additional event properties, and overwritten event options\n * track('Page Load', { loadTime: 1000 }, { sessionId: -1 });\n *\n * // alternatively, this tracking method is awaitable\n * const result = await track('Page Load').promise;\n * console.log(result.event); // {...}\n * console.log(result.code); // 200\n * console.log(result.message); // \"Event tracked successfully\"\n * ```\n */\n track(\n eventInput: BaseEvent | string,\n eventProperties?: Record<string, any>,\n eventOptions?: EventOptions,\n ): AmplitudeReturn<Result>;\n\n /**\n * Alias for track()\n */\n logEvent(\n eventInput: BaseEvent | string,\n eventProperties?: Record<string, any>,\n eventOptions?: EventOptions,\n ): AmplitudeReturn<Result>;\n\n /**\n * Sends an identify event containing user property operations\n *\n * ```typescript\n * const id = new Identify();\n * id.set('colors', ['rose', 'gold']);\n * identify(id);\n *\n * // alternatively, this tracking method is awaitable\n * const result = await identify(id).promise;\n * console.log(result.event); // {...}\n * console.log(result.code); // 200\n * console.log(result.message); // \"Event tracked successfully\"\n * ```\n */\n identify(identify: Identify, eventOptions?: EventOptions): AmplitudeReturn<Result>;\n\n /**\n * Sends a group identify event containing group property operations.\n *\n * ```typescript\n * const id = new Identify();\n * id.set('skills', ['js', 'ts']);\n * const groupType = 'org';\n * const groupName = 'engineering';\n * groupIdentify(groupType, groupName, id);\n *\n * // alternatively, this tracking method is awaitable\n * const result = await groupIdentify(groupType, groupName, id).promise;\n * console.log(result.event); // {...}\n * console.log(result.code); // 200\n * console.log(result.message); // \"Event tracked successfully\"\n * ```\n */\n groupIdentify(\n groupType: string,\n groupName: string | string[],\n identify: Identify,\n eventOptions?: EventOptions,\n ): AmplitudeReturn<Result>;\n\n /**\n * Assigns a user to group\n *\n * ```typescript\n * const groupType = 'orgId';\n * const groupName = '15';\n * setGroup(groupType, groupName, { user_id: '12345' })\n * ```\n */\n setGroup(groupType: string, groupName: string | string[], eventOptions?: EventOptions): AmplitudeReturn<Result>;\n\n /**\n * Sends a revenue event containing revenue property operations.\n *\n * ```typescript\n * const rev = new Revenue();\n * rev.setRevenue(100);\n * revenue(rev);\n *\n * // alternatively, this tracking method is awaitable\n * const result = await revenue(rev).promise;\n * console.log(result.event); // {...}\n * console.log(result.code); // 200\n * console.log(result.message); // \"Event tracked successfully\"\n * ```\n */\n revenue(revenue: Revenue, eventOptions?: EventOptions): AmplitudeReturn<Result>;\n\n /**\n * Sets a new optOut config value. This toggles event tracking on/off.\n *\n *```typescript\n * // Stops tracking\n * setOptOut(true);\n *\n * // Starts/resumes tracking\n * setOptOut(false);\n * ```\n */\n setOptOut(optOut: boolean): void;\n\n /**\n * Flush all unsent events.\n *\n *```typescript\n * flush();\n * ```\n */\n flush(): AmplitudeReturn<void>;\n}\n"]}
|
package/lib/esm/core-client.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { BaseEvent, EventOptions } from './base-event';
|
|
2
|
-
import { Config } from './config';
|
|
3
|
-
import { Result } from './result';
|
|
4
|
-
export interface CoreClient<T extends Config> {
|
|
5
|
-
config: T;
|
|
6
|
-
track(eventInput: BaseEvent | string, eventProperties?: Record<string, any>, eventOptions?: EventOptions): Promise<Result>;
|
|
7
|
-
}
|
|
8
|
-
//# sourceMappingURL=core-client.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"core-client.d.ts","sourceRoot":"","sources":["../../src/core-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,MAAM,WAAW,UAAU,CAAC,CAAC,SAAS,MAAM;IAC1C,MAAM,EAAE,CAAC,CAAC;IACV,KAAK,CACH,UAAU,EAAE,SAAS,GAAG,MAAM,EAC9B,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACrC,YAAY,CAAC,EAAE,YAAY,GAC1B,OAAO,CAAC,MAAM,CAAC,CAAC;CACpB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"core-client.js","sourceRoot":"","sources":["../../src/core-client.ts"],"names":[],"mappings":"","sourcesContent":["import { BaseEvent, EventOptions } from './base-event';\nimport { Config } from './config';\nimport { Result } from './result';\n\nexport interface CoreClient<T extends Config> {\n config: T;\n track(\n eventInput: BaseEvent | string,\n eventProperties?: Record<string, any>,\n eventOptions?: EventOptions,\n ): Promise<Result>;\n}\n"]}
|
|
File without changes
|
|
File without changes
|