@amplitude/unified 1.0.0-beta.5 → 1.0.0-beta.6
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/index.d.ts +1 -1
- package/lib/cjs/index.d.ts.map +1 -1
- package/lib/cjs/unified-client-factory.d.ts.map +1 -1
- package/lib/cjs/unified-client-factory.js +4 -2
- package/lib/cjs/unified-client-factory.js.map +1 -1
- package/lib/cjs/unified.d.ts +5 -4
- package/lib/cjs/unified.d.ts.map +1 -1
- package/lib/cjs/unified.js +22 -23
- package/lib/cjs/unified.js.map +1 -1
- package/lib/cjs/version.d.ts +1 -1
- package/lib/cjs/version.js +1 -1
- package/lib/cjs/version.js.map +1 -1
- package/lib/esm/index.d.ts +1 -1
- package/lib/esm/index.d.ts.map +1 -1
- package/lib/esm/unified-client-factory.d.ts.map +1 -1
- package/lib/esm/unified-client-factory.js +4 -2
- package/lib/esm/unified-client-factory.js.map +1 -1
- package/lib/esm/unified.d.ts +5 -4
- package/lib/esm/unified.d.ts.map +1 -1
- package/lib/esm/unified.js +22 -23
- package/lib/esm/unified.js.map +1 -1
- package/lib/esm/version.d.ts +1 -1
- package/lib/esm/version.js +1 -1
- package/lib/esm/version.js.map +1 -1
- package/lib/scripts/amplitude-min.umd.js +1 -1
- package/lib/scripts/amplitude-min.umd.js.gz +0 -0
- package/lib/scripts/index.d.ts +1 -1
- package/lib/scripts/index.d.ts.map +1 -1
- package/lib/scripts/unified-client-factory.d.ts.map +1 -1
- package/lib/scripts/unified.d.ts +5 -4
- package/lib/scripts/unified.d.ts.map +1 -1
- package/lib/scripts/version.d.ts +1 -1
- package/package.json +1 -1
package/lib/cjs/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { createInstance } from './unified-client-factory';
|
|
2
|
-
export declare const initAll: (apiKey: string, unifiedOptions?: import("./unified").UnifiedOptions | undefined) => Promise<void>, experiment: import("@amplitude/experiment-js-client").Client | undefined, sessionReplay: import("@amplitude/session-replay-browser").AmplitudeSessionReplay, add: (plugin: import("@amplitude/analytics-core").Plugin<import("@amplitude/analytics-core").BrowserClient, import("@amplitude/analytics-core").BrowserConfig>) => import("@amplitude/analytics-core").AmplitudeReturn<void>, extendSession: () => void, flush: () => import("@amplitude/analytics-core").AmplitudeReturn<void>, getDeviceId: () => string | undefined, getSessionId: () => number | undefined, getUserId: () => string | undefined, groupIdentify: (groupType: string, groupName: string | string[], identify: import("@amplitude/analytics-core").IIdentify, eventOptions?: import("@amplitude/analytics-core").EventOptions | undefined) => import("@amplitude/analytics-core").AmplitudeReturn<import("@amplitude/analytics-core").Result>, identify: (identify: import("@amplitude/analytics-core").IIdentify, eventOptions?: import("@amplitude/analytics-core").EventOptions | undefined) => import("@amplitude/analytics-core").AmplitudeReturn<import("@amplitude/analytics-core").Result>, logEvent: (eventInput: string | import("@amplitude/analytics-core").BaseEvent, eventProperties?: Record<string, any> | undefined, eventOptions?: import("@amplitude/analytics-core").EventOptions | undefined) => import("@amplitude/analytics-core").AmplitudeReturn<import("@amplitude/analytics-core").Result>, remove: (pluginName: string) => import("@amplitude/analytics-core").AmplitudeReturn<void>, reset: () => void, revenue: (revenue: import("@amplitude/analytics-core").IRevenue, eventOptions?: import("@amplitude/analytics-core").EventOptions | undefined) => import("@amplitude/analytics-core").AmplitudeReturn<import("@amplitude/analytics-core").Result>, setDeviceId: (deviceId: string) => void, setGroup: (groupType: string, groupName: string | string[], eventOptions?: import("@amplitude/analytics-core").EventOptions | undefined) => import("@amplitude/analytics-core").AmplitudeReturn<import("@amplitude/analytics-core").Result>, setOptOut: (optOut: boolean) => void, setSessionId: (sessionId: number) => void, setTransport: (transport: import("@amplitude/analytics-core").TransportType) => void, setUserId: (userId: string | undefined) => void, track: (eventInput: string | import("@amplitude/analytics-core").BaseEvent, eventProperties?: Record<string, any> | undefined, eventOptions?: import("@amplitude/analytics-core").EventOptions | undefined) => import("@amplitude/analytics-core").AmplitudeReturn<import("@amplitude/analytics-core").Result>;
|
|
2
|
+
export declare const initAll: (apiKey: string, unifiedOptions?: import("./unified").UnifiedOptions | undefined) => Promise<void>, experiment: () => import("@amplitude/experiment-js-client").Client | undefined, sessionReplay: () => import("@amplitude/session-replay-browser").AmplitudeSessionReplay, add: (plugin: import("@amplitude/analytics-core").Plugin<import("@amplitude/analytics-core").BrowserClient, import("@amplitude/analytics-core").BrowserConfig>) => import("@amplitude/analytics-core").AmplitudeReturn<void>, extendSession: () => void, flush: () => import("@amplitude/analytics-core").AmplitudeReturn<void>, getDeviceId: () => string | undefined, getSessionId: () => number | undefined, getUserId: () => string | undefined, groupIdentify: (groupType: string, groupName: string | string[], identify: import("@amplitude/analytics-core").IIdentify, eventOptions?: import("@amplitude/analytics-core").EventOptions | undefined) => import("@amplitude/analytics-core").AmplitudeReturn<import("@amplitude/analytics-core").Result>, identify: (identify: import("@amplitude/analytics-core").IIdentify, eventOptions?: import("@amplitude/analytics-core").EventOptions | undefined) => import("@amplitude/analytics-core").AmplitudeReturn<import("@amplitude/analytics-core").Result>, logEvent: (eventInput: string | import("@amplitude/analytics-core").BaseEvent, eventProperties?: Record<string, any> | undefined, eventOptions?: import("@amplitude/analytics-core").EventOptions | undefined) => import("@amplitude/analytics-core").AmplitudeReturn<import("@amplitude/analytics-core").Result>, remove: (pluginName: string) => import("@amplitude/analytics-core").AmplitudeReturn<void>, reset: () => void, revenue: (revenue: import("@amplitude/analytics-core").IRevenue, eventOptions?: import("@amplitude/analytics-core").EventOptions | undefined) => import("@amplitude/analytics-core").AmplitudeReturn<import("@amplitude/analytics-core").Result>, setDeviceId: (deviceId: string) => void, setGroup: (groupType: string, groupName: string | string[], eventOptions?: import("@amplitude/analytics-core").EventOptions | undefined) => import("@amplitude/analytics-core").AmplitudeReturn<import("@amplitude/analytics-core").Result>, setOptOut: (optOut: boolean) => void, setSessionId: (sessionId: number) => void, setTransport: (transport: import("@amplitude/analytics-core").TransportType) => void, setUserId: (userId: string | undefined) => void, track: (eventInput: string | import("@amplitude/analytics-core").BaseEvent, eventProperties?: Record<string, any> | undefined, eventOptions?: import("@amplitude/analytics-core").EventOptions | undefined) => import("@amplitude/analytics-core").AmplitudeReturn<import("@amplitude/analytics-core").Result>;
|
|
3
3
|
export { Types } from '@amplitude/analytics-browser';
|
|
4
4
|
//# 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":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,eAAO,MACL,OAAO,sGACP,UAAU,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,eAAO,MACL,OAAO,sGACP,UAAU,sEACV,aAAa,4EACb,GAAG,2NACH,aAAa,cACb,KAAK,mEACL,WAAW,4BACX,YAAY,4BACZ,SAAS,4BACT,aAAa,8RACb,QAAQ,6OACR,QAAQ,2SACR,MAAM,qFACN,KAAK,cACL,OAAO,2OACP,WAAW,8BACX,QAAQ,qOACR,SAAS,6BACT,YAAY,+BACZ,YAAY,0EACZ,SAAS,wCACT,KAAK,ySACG,CAAC;AACX,OAAO,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unified-client-factory.d.ts","sourceRoot":"","sources":["../../src/unified-client-factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,aAAa,EAAE,MAAM,WAAW,CAAC;AAG5D,eAAO,MAAM,cAAc,QAAO,
|
|
1
|
+
{"version":3,"file":"unified-client-factory.d.ts","sourceRoot":"","sources":["../../src/unified-client-factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,aAAa,EAAE,MAAM,WAAW,CAAC;AAG5D,eAAO,MAAM,cAAc,QAAO,aA0JjC,CAAC;;AAEF,wBAAgC"}
|
|
@@ -6,8 +6,8 @@ var analytics_core_1 = require("@amplitude/analytics-core");
|
|
|
6
6
|
var createInstance = function () {
|
|
7
7
|
var client = new unified_1.AmplitudeUnified();
|
|
8
8
|
return {
|
|
9
|
-
experiment: client.experiment,
|
|
10
|
-
sessionReplay: client.sessionReplay,
|
|
9
|
+
experiment: (0, analytics_core_1.debugWrapper)(client.experiment.bind(client), 'experiment', (0, analytics_core_1.getClientLogConfig)(client), (0, analytics_core_1.getClientStates)(client, ['config'])),
|
|
10
|
+
sessionReplay: (0, analytics_core_1.debugWrapper)(client.sessionReplay.bind(client), 'sessionReplay', (0, analytics_core_1.getClientLogConfig)(client), (0, analytics_core_1.getClientStates)(client, ['config'])),
|
|
11
11
|
initAll: (0, analytics_core_1.debugWrapper)(client.initAll.bind(client), 'initAll', (0, analytics_core_1.getClientLogConfig)(client), (0, analytics_core_1.getClientStates)(client, ['config'])),
|
|
12
12
|
init: (0, analytics_core_1.debugWrapper)(client.init.bind(client), 'init', (0, analytics_core_1.getClientLogConfig)(client), (0, analytics_core_1.getClientStates)(client, ['config'])),
|
|
13
13
|
add: (0, analytics_core_1.debugWrapper)(client.add.bind(client), 'add', (0, analytics_core_1.getClientLogConfig)(client), (0, analytics_core_1.getClientStates)(client, ['config.apiKey', 'timeline.plugins'])),
|
|
@@ -28,7 +28,9 @@ var createInstance = function () {
|
|
|
28
28
|
setSessionId: (0, analytics_core_1.debugWrapper)(client.setSessionId.bind(client), 'setSessionId', (0, analytics_core_1.getClientLogConfig)(client), (0, analytics_core_1.getClientStates)(client, ['config'])),
|
|
29
29
|
extendSession: (0, analytics_core_1.debugWrapper)(client.extendSession.bind(client), 'extendSession', (0, analytics_core_1.getClientLogConfig)(client), (0, analytics_core_1.getClientStates)(client, ['config'])),
|
|
30
30
|
setOptOut: (0, analytics_core_1.debugWrapper)(client.setOptOut.bind(client), 'setOptOut', (0, analytics_core_1.getClientLogConfig)(client), (0, analytics_core_1.getClientStates)(client, ['config'])),
|
|
31
|
+
getOptOut: (0, analytics_core_1.debugWrapper)(client.getOptOut.bind(client), 'getOptOut', (0, analytics_core_1.getClientLogConfig)(client), (0, analytics_core_1.getClientStates)(client, ['config'])),
|
|
31
32
|
setTransport: (0, analytics_core_1.debugWrapper)(client.setTransport.bind(client), 'setTransport', (0, analytics_core_1.getClientLogConfig)(client), (0, analytics_core_1.getClientStates)(client, ['config'])),
|
|
33
|
+
getIdentity: (0, analytics_core_1.debugWrapper)(client.getIdentity.bind(client), 'getIdentity', (0, analytics_core_1.getClientLogConfig)(client), (0, analytics_core_1.getClientStates)(client, ['config'])),
|
|
32
34
|
};
|
|
33
35
|
};
|
|
34
36
|
exports.createInstance = createInstance;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unified-client-factory.js","sourceRoot":"","sources":["../../src/unified-client-factory.ts"],"names":[],"mappings":";;;AAAA,qCAA4D;AAC5D,4DAA8F;AAEvF,IAAM,cAAc,GAAG;IAC5B,IAAM,MAAM,GAAG,IAAI,0BAAgB,EAAE,CAAC;IACtC,OAAO;QACL,UAAU,EAAE,MAAM,CAAC,UAAU;
|
|
1
|
+
{"version":3,"file":"unified-client-factory.js","sourceRoot":"","sources":["../../src/unified-client-factory.ts"],"names":[],"mappings":";;;AAAA,qCAA4D;AAC5D,4DAA8F;AAEvF,IAAM,cAAc,GAAG;IAC5B,IAAM,MAAM,GAAG,IAAI,0BAAgB,EAAE,CAAC;IACtC,OAAO;QACL,UAAU,EAAE,IAAA,6BAAY,EACtB,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,EAC9B,YAAY,EACZ,IAAA,mCAAkB,EAAC,MAAM,CAAC,EAC1B,IAAA,gCAAe,EAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,CAAC,CACpC;QACD,aAAa,EAAE,IAAA,6BAAY,EACzB,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,M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IAAA,mCAAkB,EAAC,MAAM,CAAC,EAC1B,IAAA,gCAAe,EAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,CAAC,CACpC;KACF,CAAC;AACJ,CAAC,CAAC;AA1JW,QAAA,cAAc,kBA0JzB;AAEF,kBAAe,IAAA,sBAAc,GAAE,CAAC","sourcesContent":["import { AmplitudeUnified, UnifiedClient } from './unified';\nimport { debugWrapper, getClientLogConfig, getClientStates } from '@amplitude/analytics-core';\n\nexport const createInstance = (): UnifiedClient => {\n const client = new AmplitudeUnified();\n return {\n experiment: debugWrapper(\n client.experiment.bind(client),\n 'experiment',\n getClientLogConfig(client),\n getClientStates(client, ['config']),\n ),\n sessionReplay: debugWrapper(\n client.sessionReplay.bind(client),\n 'sessionReplay',\n getClientLogConfig(client),\n getClientStates(client, ['config']),\n ),\n initAll: debugWrapper(\n client.initAll.bind(client),\n 'initAll',\n getClientLogConfig(client),\n getClientStates(client, ['config']),\n ),\n init: debugWrapper(\n client.init.bind(client),\n 'init',\n getClientLogConfig(client),\n getClientStates(client, ['config']),\n ),\n add: debugWrapper(\n client.add.bind(client),\n 'add',\n getClientLogConfig(client),\n getClientStates(client, ['config.apiKey', 'timeline.plugins']),\n ),\n remove: debugWrapper(\n client.remove.bind(client),\n 'remove',\n getClientLogConfig(client),\n getClientStates(client, ['config.apiKey', 'timeline.plugins']),\n ),\n track: debugWrapper(\n client.track.bind(client),\n 'track',\n getClientLogConfig(client),\n getClientStates(client, ['config.apiKey', 'timeline.queue.length']),\n ),\n logEvent: debugWrapper(\n client.logEvent.bind(client),\n 'logEvent',\n getClientLogConfig(client),\n getClientStates(client, ['config.apiKey', 'timeline.queue.length']),\n ),\n identify: debugWrapper(\n client.identify.bind(client),\n 'identify',\n getClientLogConfig(client),\n getClientStates(client, ['config.apiKey', 'timeline.queue.length']),\n ),\n groupIdentify: debugWrapper(\n client.groupIdentify.bind(client),\n 'groupIdentify',\n getClientLogConfig(client),\n getClientStates(client, ['config.apiKey', 'timeline.queue.length']),\n ),\n setGroup: debugWrapper(\n client.setGroup.bind(client),\n 'setGroup',\n getClientLogConfig(client),\n getClientStates(client, ['config.apiKey', 'timeline.queue.length']),\n ),\n revenue: debugWrapper(\n client.revenue.bind(client),\n 'revenue',\n getClientLogConfig(client),\n getClientStates(client, ['config.apiKey', 'timeline.queue.length']),\n ),\n flush: debugWrapper(\n client.flush.bind(client),\n 'flush',\n getClientLogConfig(client),\n getClientStates(client, ['config.apiKey', 'timeline.queue.length']),\n ),\n getUserId: debugWrapper(\n client.getUserId.bind(client),\n 'getUserId',\n getClientLogConfig(client),\n getClientStates(client, ['config', 'config.userId']),\n ),\n setUserId: debugWrapper(\n client.setUserId.bind(client),\n 'setUserId',\n getClientLogConfig(client),\n getClientStates(client, ['config', 'config.userId']),\n ),\n getDeviceId: debugWrapper(\n client.getDeviceId.bind(client),\n 'getDeviceId',\n getClientLogConfig(client),\n getClientStates(client, ['config', 'config.deviceId']),\n ),\n setDeviceId: debugWrapper(\n client.setDeviceId.bind(client),\n 'setDeviceId',\n getClientLogConfig(client),\n getClientStates(client, ['config', 'config.deviceId']),\n ),\n reset: debugWrapper(\n client.reset.bind(client),\n 'reset',\n getClientLogConfig(client),\n getClientStates(client, ['config', 'config.userId', 'config.deviceId']),\n ),\n getSessionId: debugWrapper(\n client.getSessionId.bind(client),\n 'getSessionId',\n getClientLogConfig(client),\n getClientStates(client, ['config']),\n ),\n setSessionId: debugWrapper(\n client.setSessionId.bind(client),\n 'setSessionId',\n getClientLogConfig(client),\n getClientStates(client, ['config']),\n ),\n extendSession: debugWrapper(\n client.extendSession.bind(client),\n 'extendSession',\n getClientLogConfig(client),\n getClientStates(client, ['config']),\n ),\n setOptOut: debugWrapper(\n client.setOptOut.bind(client),\n 'setOptOut',\n getClientLogConfig(client),\n getClientStates(client, ['config']),\n ),\n getOptOut: debugWrapper(\n client.getOptOut.bind(client),\n 'getOptOut',\n getClientLogConfig(client),\n getClientStates(client, ['config']),\n ),\n setTransport: debugWrapper(\n client.setTransport.bind(client),\n 'setTransport',\n getClientLogConfig(client),\n getClientStates(client, ['config']),\n ),\n getIdentity: debugWrapper(\n client.getIdentity.bind(client),\n 'getIdentity',\n getClientLogConfig(client),\n getClientStates(client, ['config']),\n ),\n };\n};\n\nexport default createInstance();\n"]}
|
package/lib/cjs/unified.d.ts
CHANGED
|
@@ -13,12 +13,13 @@ export type UnifiedOptions = UnifiedSharedOptions & {
|
|
|
13
13
|
};
|
|
14
14
|
export interface UnifiedClient extends BrowserClient {
|
|
15
15
|
initAll(apiKey: string, unifiedOptions?: UnifiedOptions): Promise<void>;
|
|
16
|
-
sessionReplay: AmplitudeSessionReplay;
|
|
17
|
-
experiment: IExperimentClient | undefined;
|
|
16
|
+
sessionReplay(): AmplitudeSessionReplay;
|
|
17
|
+
experiment(): IExperimentClient | undefined;
|
|
18
18
|
}
|
|
19
19
|
export declare class AmplitudeUnified extends AmplitudeBrowser implements UnifiedClient {
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
private _sessionReplay;
|
|
21
|
+
sessionReplay(): AmplitudeSessionReplay;
|
|
22
|
+
experiment(): IExperimentClient | undefined;
|
|
22
23
|
/**
|
|
23
24
|
* Initialize SDKs with configuration options.
|
|
24
25
|
*
|
package/lib/cjs/unified.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unified.d.ts","sourceRoot":"","sources":["../../src/unified.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EACL,sBAAsB,EACtB,oBAAoB,EAGrB,MAAM,0CAA0C,CAAC;AAClD,OAAO,EACL,iBAAiB,EACjB,sBAAsB,EAGvB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAG1E,MAAM,WAAW,oBAAoB;IACnC,UAAU,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACzB,YAA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,OAAO,CAAC,IAAI,CAAC,CAAC;IACxE,aAAa,IAAI,sBAAsB,CAAC;IACxC,UAAU,IAAI,iBAAiB,GAAG,SAAS,CAAC;CAC7C;AAED,qBAAa,gBAAiB,SAAQ,gBAAiB,YAAW,aAAa;IAG7E,OAAO,CAAC,cAAc,CAAyB;IAE/C,aAAa,IAAI,sBAAsB;IAIvC,UAAU,IAAI,iBAAiB,GAAG,SAAS;IAkB3C;;;;;;OAMG;IACG,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,cAAc;IAqB7D;;OAEG;IAEH,IAAI,CAAC,MAAM,SAAK,EAAE,eAAe,CAAC,EAAE,MAAM,GAAG,cAAc,EAAE,YAAY,CAAC,EAAE,cAAc;CAI3F"}
|
package/lib/cjs/unified.js
CHANGED
|
@@ -11,28 +11,27 @@ var AmplitudeUnified = /** @class */ (function (_super) {
|
|
|
11
11
|
function AmplitudeUnified() {
|
|
12
12
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
13
13
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
});
|
|
14
|
+
AmplitudeUnified.prototype.sessionReplay = function () {
|
|
15
|
+
return this._sessionReplay;
|
|
16
|
+
};
|
|
17
|
+
AmplitudeUnified.prototype.experiment = function () {
|
|
18
|
+
// Return when init() or initAll() is not called
|
|
19
|
+
if (this.config === undefined) {
|
|
20
|
+
return undefined;
|
|
21
|
+
}
|
|
22
|
+
var expPlugins = this.plugins(plugin_experiment_browser_1.ExperimentPlugin);
|
|
23
|
+
if (expPlugins.length === 0) {
|
|
24
|
+
this.config.loggerProvider.debug("".concat(plugin_experiment_browser_1.ExperimentPlugin.pluginName, " plugin is not found."));
|
|
25
|
+
return undefined;
|
|
26
|
+
}
|
|
27
|
+
else if (expPlugins.length === 1) {
|
|
28
|
+
return expPlugins[0].experiment;
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
this.config.loggerProvider.debug("Multiple instances of ".concat(plugin_experiment_browser_1.ExperimentPlugin.pluginName, " are found."));
|
|
32
|
+
return undefined;
|
|
33
|
+
}
|
|
34
|
+
};
|
|
36
35
|
/**
|
|
37
36
|
* Initialize SDKs with configuration options.
|
|
38
37
|
*
|
|
@@ -65,7 +64,7 @@ var AmplitudeUnified = /** @class */ (function (_super) {
|
|
|
65
64
|
this.config.loggerProvider.debug("".concat(plugin_session_replay_browser_1.SessionReplayPlugin.pluginName, " plugin is not found."));
|
|
66
65
|
}
|
|
67
66
|
else {
|
|
68
|
-
this.
|
|
67
|
+
this._sessionReplay = srPlugin.sessionReplay;
|
|
69
68
|
}
|
|
70
69
|
return [2 /*return*/];
|
|
71
70
|
}
|
package/lib/cjs/unified.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unified.js","sourceRoot":"","sources":["../../src/unified.ts"],"names":[],"mappings":";;;;AAAA,kEAAgE;AAChE,0FAKkD;AAClD,kFAK8C;AAE9C,qCAA0C;AAmB1C;IAAsC,4CAAgB;IAAtD;;
|
|
1
|
+
{"version":3,"file":"unified.js","sourceRoot":"","sources":["../../src/unified.ts"],"names":[],"mappings":";;;;AAAA,kEAAgE;AAChE,0FAKkD;AAClD,kFAK8C;AAE9C,qCAA0C;AAmB1C;IAAsC,4CAAgB;IAAtD;;IA+DA,CAAC;IA1DC,wCAAa,GAAb;QACE,OAAO,IAAI,CAAC,cAAc,CAAC;IAC7B,CAAC;IAED,qCAAU,GAAV;QACE,gDAAgD;QAChD,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS,EAAE;YAC7B,OAAO,SAAS,CAAC;SAClB;QAED,IAAM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BAA9F,SAA8F,CAAC;wBAEzF,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,mDAAmB,CAAC,UAAU,CAAC,CAAC;wBAC7D,IAAI,QAAQ,KAAK,SAAS,EAAE;4BAC1B,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,UAAG,mDAAmB,CAAC,UAAU,0BAAuB,CAAC,CAAC;yBAC5F;6BAAM;4BACL,IAAI,CAAC,cAAc,GAAI,QAAgC,CAAC,aAAa,CAAC;yBACvE;;;;;KACF;IAED;;OAEG;IACH,0BAA0B;IAC1B,+BAAI,GAAJ,UAAK,MAAW,EAAE,eAAyC,EAAE,YAA6B;QAArF,uBAAA,EAAA,WAAW;QACd,IAAM,GAAG,GAAG,iBAAM,IAAI,YAAC,MAAM,EAAE,eAAe,EAAE,YAAY,CAAC,CAAC;QAC9D,OAAO,GAAG,CAAC;IACb,CAAC;IACH,uBAAC;AAAD,CAAC,AA/DD,CAAsC,oCAAgB,GA+DrD;AA/DY,4CAAgB","sourcesContent":["import { AmplitudeBrowser } from '@amplitude/analytics-browser';\nimport {\n AmplitudeSessionReplay,\n SessionReplayOptions,\n sessionReplayPlugin,\n SessionReplayPlugin,\n} from '@amplitude/plugin-session-replay-browser';\nimport {\n IExperimentClient,\n ExperimentPluginConfig,\n ExperimentPlugin,\n experimentPlugin,\n} from '@amplitude/plugin-experiment-browser';\nimport { BrowserClient, BrowserOptions } from '@amplitude/analytics-core';\nimport { libraryPlugin } from './library';\n\nexport interface UnifiedSharedOptions {\n serverZone?: 'US' | 'EU';\n instanceName?: string;\n}\n\nexport type UnifiedOptions = UnifiedSharedOptions & {\n analytics?: BrowserOptions;\n sessionReplay?: Omit<SessionReplayOptions, keyof UnifiedSharedOptions>;\n experiment?: Omit<ExperimentPluginConfig, keyof UnifiedSharedOptions>;\n};\n\nexport interface UnifiedClient extends BrowserClient {\n initAll(apiKey: string, unifiedOptions?: UnifiedOptions): Promise<void>;\n sessionReplay(): AmplitudeSessionReplay;\n experiment(): IExperimentClient | undefined;\n}\n\nexport class AmplitudeUnified extends AmplitudeBrowser implements UnifiedClient {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n private _sessionReplay: AmplitudeSessionReplay;\n\n sessionReplay(): AmplitudeSessionReplay {\n return this._sessionReplay;\n }\n\n experiment(): IExperimentClient | undefined {\n // Return when init() or initAll() is not called\n if (this.config === undefined) {\n return undefined;\n }\n\n const expPlugins = this.plugins(ExperimentPlugin);\n if (expPlugins.length === 0) {\n this.config.loggerProvider.debug(`${ExperimentPlugin.pluginName} plugin is not found.`);\n return undefined;\n } else if (expPlugins.length === 1) {\n return expPlugins[0].experiment;\n } else {\n this.config.loggerProvider.debug(`Multiple instances of ${ExperimentPlugin.pluginName} are found.`);\n return undefined;\n }\n }\n\n /**\n * Initialize SDKs with configuration options.\n *\n * @param apiKey Amplitude API key.\n * @param analyticsOptions Analytics configuration options. Refer to {@link https://amplitude.com/docs/sdks/analytics/browser/browser-sdk-2#configure-the-sdk here} for more info.\n * @param unifiedOptions Shared configuration for all SDKs and for blade SDKs.\n */\n async initAll(apiKey: string, unifiedOptions?: UnifiedOptions) {\n const sharedOptions = {\n serverZone: unifiedOptions?.serverZone,\n instanceName: unifiedOptions?.instanceName,\n };\n\n super.add(libraryPlugin());\n await super.init(apiKey, { ...unifiedOptions?.analytics, ...sharedOptions }).promise;\n\n await super.add(sessionReplayPlugin({ ...unifiedOptions?.sessionReplay, ...sharedOptions })).promise;\n\n await super.add(experimentPlugin({ ...unifiedOptions?.experiment, ...sharedOptions })).promise;\n\n const srPlugin = this.plugin(SessionReplayPlugin.pluginName);\n if (srPlugin === undefined) {\n this.config.loggerProvider.debug(`${SessionReplayPlugin.pluginName} plugin is not found.`);\n } else {\n this._sessionReplay = (srPlugin as SessionReplayPlugin).sessionReplay;\n }\n }\n\n /**\n * Only analytics SDK is initialized. Use initAll() instead to initialize all blade SDKs.\n */\n /* istanbul ignore next */\n init(apiKey = '', userIdOrOptions?: string | BrowserOptions, maybeOptions?: BrowserOptions) {\n const res = super.init(apiKey, userIdOrOptions, maybeOptions);\n return res;\n }\n}\n"]}
|
package/lib/cjs/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "1.0.0-beta.
|
|
1
|
+
export declare const VERSION = "1.0.0-beta.6";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/lib/cjs/version.js
CHANGED
package/lib/cjs/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";;;AAAA,oDAAoD;AACvC,QAAA,OAAO,GAAG,cAAc,CAAC","sourcesContent":["// Autogenerated by `yarn version-file`. DO NOT EDIT\nexport const VERSION = '1.0.0-beta.
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";;;AAAA,oDAAoD;AACvC,QAAA,OAAO,GAAG,cAAc,CAAC","sourcesContent":["// Autogenerated by `yarn version-file`. DO NOT EDIT\nexport const VERSION = '1.0.0-beta.6';\n"]}
|
package/lib/esm/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { createInstance } from './unified-client-factory';
|
|
2
|
-
export declare const initAll: (apiKey: string, unifiedOptions?: import("./unified").UnifiedOptions | undefined) => Promise<void>, experiment: import("@amplitude/experiment-js-client").Client | undefined, sessionReplay: import("@amplitude/session-replay-browser").AmplitudeSessionReplay, add: (plugin: import("@amplitude/analytics-core").Plugin<import("@amplitude/analytics-core").BrowserClient, import("@amplitude/analytics-core").BrowserConfig>) => import("@amplitude/analytics-core").AmplitudeReturn<void>, extendSession: () => void, flush: () => import("@amplitude/analytics-core").AmplitudeReturn<void>, getDeviceId: () => string | undefined, getSessionId: () => number | undefined, getUserId: () => string | undefined, groupIdentify: (groupType: string, groupName: string | string[], identify: import("@amplitude/analytics-core").IIdentify, eventOptions?: import("@amplitude/analytics-core").EventOptions | undefined) => import("@amplitude/analytics-core").AmplitudeReturn<import("@amplitude/analytics-core").Result>, identify: (identify: import("@amplitude/analytics-core").IIdentify, eventOptions?: import("@amplitude/analytics-core").EventOptions | undefined) => import("@amplitude/analytics-core").AmplitudeReturn<import("@amplitude/analytics-core").Result>, logEvent: (eventInput: string | import("@amplitude/analytics-core").BaseEvent, eventProperties?: Record<string, any> | undefined, eventOptions?: import("@amplitude/analytics-core").EventOptions | undefined) => import("@amplitude/analytics-core").AmplitudeReturn<import("@amplitude/analytics-core").Result>, remove: (pluginName: string) => import("@amplitude/analytics-core").AmplitudeReturn<void>, reset: () => void, revenue: (revenue: import("@amplitude/analytics-core").IRevenue, eventOptions?: import("@amplitude/analytics-core").EventOptions | undefined) => import("@amplitude/analytics-core").AmplitudeReturn<import("@amplitude/analytics-core").Result>, setDeviceId: (deviceId: string) => void, setGroup: (groupType: string, groupName: string | string[], eventOptions?: import("@amplitude/analytics-core").EventOptions | undefined) => import("@amplitude/analytics-core").AmplitudeReturn<import("@amplitude/analytics-core").Result>, setOptOut: (optOut: boolean) => void, setSessionId: (sessionId: number) => void, setTransport: (transport: import("@amplitude/analytics-core").TransportType) => void, setUserId: (userId: string | undefined) => void, track: (eventInput: string | import("@amplitude/analytics-core").BaseEvent, eventProperties?: Record<string, any> | undefined, eventOptions?: import("@amplitude/analytics-core").EventOptions | undefined) => import("@amplitude/analytics-core").AmplitudeReturn<import("@amplitude/analytics-core").Result>;
|
|
2
|
+
export declare const initAll: (apiKey: string, unifiedOptions?: import("./unified").UnifiedOptions | undefined) => Promise<void>, experiment: () => import("@amplitude/experiment-js-client").Client | undefined, sessionReplay: () => import("@amplitude/session-replay-browser").AmplitudeSessionReplay, add: (plugin: import("@amplitude/analytics-core").Plugin<import("@amplitude/analytics-core").BrowserClient, import("@amplitude/analytics-core").BrowserConfig>) => import("@amplitude/analytics-core").AmplitudeReturn<void>, extendSession: () => void, flush: () => import("@amplitude/analytics-core").AmplitudeReturn<void>, getDeviceId: () => string | undefined, getSessionId: () => number | undefined, getUserId: () => string | undefined, groupIdentify: (groupType: string, groupName: string | string[], identify: import("@amplitude/analytics-core").IIdentify, eventOptions?: import("@amplitude/analytics-core").EventOptions | undefined) => import("@amplitude/analytics-core").AmplitudeReturn<import("@amplitude/analytics-core").Result>, identify: (identify: import("@amplitude/analytics-core").IIdentify, eventOptions?: import("@amplitude/analytics-core").EventOptions | undefined) => import("@amplitude/analytics-core").AmplitudeReturn<import("@amplitude/analytics-core").Result>, logEvent: (eventInput: string | import("@amplitude/analytics-core").BaseEvent, eventProperties?: Record<string, any> | undefined, eventOptions?: import("@amplitude/analytics-core").EventOptions | undefined) => import("@amplitude/analytics-core").AmplitudeReturn<import("@amplitude/analytics-core").Result>, remove: (pluginName: string) => import("@amplitude/analytics-core").AmplitudeReturn<void>, reset: () => void, revenue: (revenue: import("@amplitude/analytics-core").IRevenue, eventOptions?: import("@amplitude/analytics-core").EventOptions | undefined) => import("@amplitude/analytics-core").AmplitudeReturn<import("@amplitude/analytics-core").Result>, setDeviceId: (deviceId: string) => void, setGroup: (groupType: string, groupName: string | string[], eventOptions?: import("@amplitude/analytics-core").EventOptions | undefined) => import("@amplitude/analytics-core").AmplitudeReturn<import("@amplitude/analytics-core").Result>, setOptOut: (optOut: boolean) => void, setSessionId: (sessionId: number) => void, setTransport: (transport: import("@amplitude/analytics-core").TransportType) => void, setUserId: (userId: string | undefined) => void, track: (eventInput: string | import("@amplitude/analytics-core").BaseEvent, eventProperties?: Record<string, any> | undefined, eventOptions?: import("@amplitude/analytics-core").EventOptions | undefined) => import("@amplitude/analytics-core").AmplitudeReturn<import("@amplitude/analytics-core").Result>;
|
|
3
3
|
export { Types } from '@amplitude/analytics-browser';
|
|
4
4
|
//# 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":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,eAAO,MACL,OAAO,sGACP,UAAU,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,eAAO,MACL,OAAO,sGACP,UAAU,sEACV,aAAa,4EACb,GAAG,2NACH,aAAa,cACb,KAAK,mEACL,WAAW,4BACX,YAAY,4BACZ,SAAS,4BACT,aAAa,8RACb,QAAQ,6OACR,QAAQ,2SACR,MAAM,qFACN,KAAK,cACL,OAAO,2OACP,WAAW,8BACX,QAAQ,qOACR,SAAS,6BACT,YAAY,+BACZ,YAAY,0EACZ,SAAS,wCACT,KAAK,ySACG,CAAC;AACX,OAAO,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unified-client-factory.d.ts","sourceRoot":"","sources":["../../src/unified-client-factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,aAAa,EAAE,MAAM,WAAW,CAAC;AAG5D,eAAO,MAAM,cAAc,QAAO,
|
|
1
|
+
{"version":3,"file":"unified-client-factory.d.ts","sourceRoot":"","sources":["../../src/unified-client-factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,aAAa,EAAE,MAAM,WAAW,CAAC;AAG5D,eAAO,MAAM,cAAc,QAAO,aA0JjC,CAAC;;AAEF,wBAAgC"}
|
|
@@ -3,8 +3,8 @@ import { debugWrapper, getClientLogConfig, getClientStates } from '@amplitude/an
|
|
|
3
3
|
export var createInstance = function () {
|
|
4
4
|
var client = new AmplitudeUnified();
|
|
5
5
|
return {
|
|
6
|
-
experiment: client.experiment,
|
|
7
|
-
sessionReplay: client.sessionReplay,
|
|
6
|
+
experiment: debugWrapper(client.experiment.bind(client), 'experiment', getClientLogConfig(client), getClientStates(client, ['config'])),
|
|
7
|
+
sessionReplay: debugWrapper(client.sessionReplay.bind(client), 'sessionReplay', getClientLogConfig(client), getClientStates(client, ['config'])),
|
|
8
8
|
initAll: debugWrapper(client.initAll.bind(client), 'initAll', getClientLogConfig(client), getClientStates(client, ['config'])),
|
|
9
9
|
init: debugWrapper(client.init.bind(client), 'init', getClientLogConfig(client), getClientStates(client, ['config'])),
|
|
10
10
|
add: debugWrapper(client.add.bind(client), 'add', getClientLogConfig(client), getClientStates(client, ['config.apiKey', 'timeline.plugins'])),
|
|
@@ -25,7 +25,9 @@ export var createInstance = function () {
|
|
|
25
25
|
setSessionId: debugWrapper(client.setSessionId.bind(client), 'setSessionId', getClientLogConfig(client), getClientStates(client, ['config'])),
|
|
26
26
|
extendSession: debugWrapper(client.extendSession.bind(client), 'extendSession', getClientLogConfig(client), getClientStates(client, ['config'])),
|
|
27
27
|
setOptOut: debugWrapper(client.setOptOut.bind(client), 'setOptOut', getClientLogConfig(client), getClientStates(client, ['config'])),
|
|
28
|
+
getOptOut: debugWrapper(client.getOptOut.bind(client), 'getOptOut', getClientLogConfig(client), getClientStates(client, ['config'])),
|
|
28
29
|
setTransport: debugWrapper(client.setTransport.bind(client), 'setTransport', getClientLogConfig(client), getClientStates(client, ['config'])),
|
|
30
|
+
getIdentity: debugWrapper(client.getIdentity.bind(client), 'getIdentity', getClientLogConfig(client), getClientStates(client, ['config'])),
|
|
29
31
|
};
|
|
30
32
|
};
|
|
31
33
|
export default createInstance();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unified-client-factory.js","sourceRoot":"","sources":["../../src/unified-client-factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAiB,MAAM,WAAW,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAE9F,MAAM,CAAC,IAAM,cAAc,GAAG;IAC5B,IAAM,MAAM,GAAG,IAAI,gBAAgB,EAA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B,eAAe,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,CAAC,CACpC;QACD,WAAW,EAAE,YAAY,CACvB,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,EAC/B,aAAa,EACb,kBAAkB,CAAC,MAAM,CAAC,EAC1B,eAAe,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,CAAC,CACpC;KACF,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,cAAc,EAAE,CAAC","sourcesContent":["import { AmplitudeUnified, UnifiedClient } from './unified';\nimport { debugWrapper, getClientLogConfig, getClientStates } from '@amplitude/analytics-core';\n\nexport const createInstance = (): UnifiedClient => {\n const client = new AmplitudeUnified();\n return {\n experiment: debugWrapper(\n client.experiment.bind(client),\n 'experiment',\n getClientLogConfig(client),\n getClientStates(client, ['config']),\n ),\n sessionReplay: debugWrapper(\n client.sessionReplay.bind(client),\n 'sessionReplay',\n getClientLogConfig(client),\n getClientStates(client, ['config']),\n ),\n initAll: debugWrapper(\n client.initAll.bind(client),\n 'initAll',\n getClientLogConfig(client),\n getClientStates(client, ['config']),\n ),\n init: debugWrapper(\n client.init.bind(client),\n 'init',\n getClientLogConfig(client),\n getClientStates(client, ['config']),\n ),\n add: debugWrapper(\n client.add.bind(client),\n 'add',\n getClientLogConfig(client),\n getClientStates(client, ['config.apiKey', 'timeline.plugins']),\n ),\n remove: debugWrapper(\n client.remove.bind(client),\n 'remove',\n getClientLogConfig(client),\n getClientStates(client, ['config.apiKey', 'timeline.plugins']),\n ),\n track: debugWrapper(\n client.track.bind(client),\n 'track',\n getClientLogConfig(client),\n getClientStates(client, ['config.apiKey', 'timeline.queue.length']),\n ),\n logEvent: debugWrapper(\n client.logEvent.bind(client),\n 'logEvent',\n getClientLogConfig(client),\n getClientStates(client, ['config.apiKey', 'timeline.queue.length']),\n ),\n identify: debugWrapper(\n client.identify.bind(client),\n 'identify',\n getClientLogConfig(client),\n getClientStates(client, ['config.apiKey', 'timeline.queue.length']),\n ),\n groupIdentify: debugWrapper(\n client.groupIdentify.bind(client),\n 'groupIdentify',\n getClientLogConfig(client),\n getClientStates(client, ['config.apiKey', 'timeline.queue.length']),\n ),\n setGroup: debugWrapper(\n client.setGroup.bind(client),\n 'setGroup',\n getClientLogConfig(client),\n getClientStates(client, ['config.apiKey', 'timeline.queue.length']),\n ),\n revenue: debugWrapper(\n client.revenue.bind(client),\n 'revenue',\n getClientLogConfig(client),\n getClientStates(client, ['config.apiKey', 'timeline.queue.length']),\n ),\n flush: debugWrapper(\n client.flush.bind(client),\n 'flush',\n getClientLogConfig(client),\n getClientStates(client, ['config.apiKey', 'timeline.queue.length']),\n ),\n getUserId: debugWrapper(\n client.getUserId.bind(client),\n 'getUserId',\n getClientLogConfig(client),\n getClientStates(client, ['config', 'config.userId']),\n ),\n setUserId: debugWrapper(\n client.setUserId.bind(client),\n 'setUserId',\n getClientLogConfig(client),\n getClientStates(client, ['config', 'config.userId']),\n ),\n getDeviceId: debugWrapper(\n client.getDeviceId.bind(client),\n 'getDeviceId',\n getClientLogConfig(client),\n getClientStates(client, ['config', 'config.deviceId']),\n ),\n setDeviceId: debugWrapper(\n client.setDeviceId.bind(client),\n 'setDeviceId',\n getClientLogConfig(client),\n getClientStates(client, ['config', 'config.deviceId']),\n ),\n reset: debugWrapper(\n client.reset.bind(client),\n 'reset',\n getClientLogConfig(client),\n getClientStates(client, ['config', 'config.userId', 'config.deviceId']),\n ),\n getSessionId: debugWrapper(\n client.getSessionId.bind(client),\n 'getSessionId',\n getClientLogConfig(client),\n getClientStates(client, ['config']),\n ),\n setSessionId: debugWrapper(\n client.setSessionId.bind(client),\n 'setSessionId',\n getClientLogConfig(client),\n getClientStates(client, ['config']),\n ),\n extendSession: debugWrapper(\n client.extendSession.bind(client),\n 'extendSession',\n getClientLogConfig(client),\n getClientStates(client, ['config']),\n ),\n setOptOut: debugWrapper(\n client.setOptOut.bind(client),\n 'setOptOut',\n getClientLogConfig(client),\n getClientStates(client, ['config']),\n ),\n getOptOut: debugWrapper(\n client.getOptOut.bind(client),\n 'getOptOut',\n getClientLogConfig(client),\n getClientStates(client, ['config']),\n ),\n setTransport: debugWrapper(\n client.setTransport.bind(client),\n 'setTransport',\n getClientLogConfig(client),\n getClientStates(client, ['config']),\n ),\n getIdentity: debugWrapper(\n client.getIdentity.bind(client),\n 'getIdentity',\n getClientLogConfig(client),\n getClientStates(client, ['config']),\n ),\n };\n};\n\nexport default createInstance();\n"]}
|
package/lib/esm/unified.d.ts
CHANGED
|
@@ -13,12 +13,13 @@ export type UnifiedOptions = UnifiedSharedOptions & {
|
|
|
13
13
|
};
|
|
14
14
|
export interface UnifiedClient extends BrowserClient {
|
|
15
15
|
initAll(apiKey: string, unifiedOptions?: UnifiedOptions): Promise<void>;
|
|
16
|
-
sessionReplay: AmplitudeSessionReplay;
|
|
17
|
-
experiment: IExperimentClient | undefined;
|
|
16
|
+
sessionReplay(): AmplitudeSessionReplay;
|
|
17
|
+
experiment(): IExperimentClient | undefined;
|
|
18
18
|
}
|
|
19
19
|
export declare class AmplitudeUnified extends AmplitudeBrowser implements UnifiedClient {
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
private _sessionReplay;
|
|
21
|
+
sessionReplay(): AmplitudeSessionReplay;
|
|
22
|
+
experiment(): IExperimentClient | undefined;
|
|
22
23
|
/**
|
|
23
24
|
* Initialize SDKs with configuration options.
|
|
24
25
|
*
|
package/lib/esm/unified.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unified.d.ts","sourceRoot":"","sources":["../../src/unified.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EACL,sBAAsB,EACtB,oBAAoB,EAGrB,MAAM,0CAA0C,CAAC;AAClD,OAAO,EACL,iBAAiB,EACjB,sBAAsB,EAGvB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,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AM,WAAW,aAAc,SAAQ,aAAa;IAClD,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACxE,aAAa,IAAI,sBAAsB,CAAC;IACxC,UAAU,IAAI,iBAAiB,GAAG,SAAS,CAAC;CAC7C;AAED,qBAAa,gBAAiB,SAAQ,gBAAiB,YAAW,aAAa;IAG7E,OAAO,CAAC,cAAc,CAAyB;IAE/C,aAAa,IAAI,sBAAsB;IAIvC,UAAU,IAAI,iBAAiB,GAAG,SAAS;IAkB3C;;;;;;OAMG;IACG,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,cAAc;IAqB7D;;OAEG;IAEH,IAAI,CAAC,MAAM,SAAK,EAAE,eAAe,CAAC,EAAE,MAAM,GAAG,cAAc,EAAE,YAAY,CAAC,EAAE,cAAc;CAI3F"}
|
package/lib/esm/unified.js
CHANGED
|
@@ -8,28 +8,27 @@ var AmplitudeUnified = /** @class */ (function (_super) {
|
|
|
8
8
|
function AmplitudeUnified() {
|
|
9
9
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
10
10
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
});
|
|
11
|
+
AmplitudeUnified.prototype.sessionReplay = function () {
|
|
12
|
+
return this._sessionReplay;
|
|
13
|
+
};
|
|
14
|
+
AmplitudeUnified.prototype.experiment = function () {
|
|
15
|
+
// Return when init() or initAll() is not called
|
|
16
|
+
if (this.config === undefined) {
|
|
17
|
+
return undefined;
|
|
18
|
+
}
|
|
19
|
+
var expPlugins = this.plugins(ExperimentPlugin);
|
|
20
|
+
if (expPlugins.length === 0) {
|
|
21
|
+
this.config.loggerProvider.debug("".concat(ExperimentPlugin.pluginName, " plugin is not found."));
|
|
22
|
+
return undefined;
|
|
23
|
+
}
|
|
24
|
+
else if (expPlugins.length === 1) {
|
|
25
|
+
return expPlugins[0].experiment;
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
this.config.loggerProvider.debug("Multiple instances of ".concat(ExperimentPlugin.pluginName, " are found."));
|
|
29
|
+
return undefined;
|
|
30
|
+
}
|
|
31
|
+
};
|
|
33
32
|
/**
|
|
34
33
|
* Initialize SDKs with configuration options.
|
|
35
34
|
*
|
|
@@ -62,7 +61,7 @@ var AmplitudeUnified = /** @class */ (function (_super) {
|
|
|
62
61
|
this.config.loggerProvider.debug("".concat(SessionReplayPlugin.pluginName, " plugin is not found."));
|
|
63
62
|
}
|
|
64
63
|
else {
|
|
65
|
-
this.
|
|
64
|
+
this._sessionReplay = srPlugin.sessionReplay;
|
|
66
65
|
}
|
|
67
66
|
return [2 /*return*/];
|
|
68
67
|
}
|
package/lib/esm/unified.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unified.js","sourceRoot":"","sources":["../../src/unified.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAGL,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAGL,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAmB1C;IAAsC,oCAAgB;IAAtD;;
|
|
1
|
+
{"version":3,"file":"unified.js","sourceRoot":"","sources":["../../src/unified.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAGL,mBAAmB,EACnB,mBA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CAAE,SAAS,GAAK,aAAa,EAAG,CAAC,OAAO,EAAA;;wBAApF,SAAoF,CAAC;wBAErF,qBAAM,iBAAM,GAAG,YAAC,mBAAmB,uBAAM,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,aAAa,GAAK,aAAa,EAAG,CAAC,CAAC,OAAO,EAAA;;wBAApG,SAAoG,CAAC;wBAErG,qBAAM,iBAAM,GAAG,YAAC,gBAAgB,uBAAM,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,UAAU,GAAK,aAAa,EAAG,CAAC,CAAC,OAAO,EAAA;;wBAA9F,SAA8F,CAAC;wBAEzF,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC,UAAU,CAAC,CAAC;wBAC7D,IAAI,QAAQ,KAAK,SAAS,EAAE;4BAC1B,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,UAAG,mBAAmB,CAAC,UAAU,0BAAuB,CAAC,CAAC;yBAC5F;6BAAM;4BACL,IAAI,CAAC,cAAc,GAAI,QAAgC,CAAC,aAAa,CAAC;yBACvE;;;;;KACF;IAED;;OAEG;IACH,0BAA0B;IAC1B,+BAAI,GAAJ,UAAK,MAAW,EAAE,eAAyC,EAAE,YAA6B;QAArF,uBAAA,EAAA,WAAW;QACd,IAAM,GAAG,GAAG,iBAAM,IAAI,YAAC,MAAM,EAAE,eAAe,EAAE,YAAY,CAAC,CAAC;QAC9D,OAAO,GAAG,CAAC;IACb,CAAC;IACH,uBAAC;AAAD,CAAC,AA/DD,CAAsC,gBAAgB,GA+DrD","sourcesContent":["import { AmplitudeBrowser } from '@amplitude/analytics-browser';\nimport {\n AmplitudeSessionReplay,\n SessionReplayOptions,\n sessionReplayPlugin,\n SessionReplayPlugin,\n} from '@amplitude/plugin-session-replay-browser';\nimport {\n IExperimentClient,\n ExperimentPluginConfig,\n ExperimentPlugin,\n experimentPlugin,\n} from '@amplitude/plugin-experiment-browser';\nimport { BrowserClient, BrowserOptions } from '@amplitude/analytics-core';\nimport { libraryPlugin } from './library';\n\nexport interface UnifiedSharedOptions {\n serverZone?: 'US' | 'EU';\n instanceName?: string;\n}\n\nexport type UnifiedOptions = UnifiedSharedOptions & {\n analytics?: BrowserOptions;\n sessionReplay?: Omit<SessionReplayOptions, keyof UnifiedSharedOptions>;\n experiment?: Omit<ExperimentPluginConfig, keyof UnifiedSharedOptions>;\n};\n\nexport interface UnifiedClient extends BrowserClient {\n initAll(apiKey: string, unifiedOptions?: UnifiedOptions): Promise<void>;\n sessionReplay(): AmplitudeSessionReplay;\n experiment(): IExperimentClient | undefined;\n}\n\nexport class AmplitudeUnified extends AmplitudeBrowser implements UnifiedClient {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n private _sessionReplay: AmplitudeSessionReplay;\n\n sessionReplay(): AmplitudeSessionReplay {\n return this._sessionReplay;\n }\n\n experiment(): IExperimentClient | undefined {\n // Return when init() or initAll() is not called\n if (this.config === undefined) {\n return undefined;\n }\n\n const expPlugins = this.plugins(ExperimentPlugin);\n if (expPlugins.length === 0) {\n this.config.loggerProvider.debug(`${ExperimentPlugin.pluginName} plugin is not found.`);\n return undefined;\n } else if (expPlugins.length === 1) {\n return expPlugins[0].experiment;\n } else {\n this.config.loggerProvider.debug(`Multiple instances of ${ExperimentPlugin.pluginName} are found.`);\n return undefined;\n }\n }\n\n /**\n * Initialize SDKs with configuration options.\n *\n * @param apiKey Amplitude API key.\n * @param analyticsOptions Analytics configuration options. Refer to {@link https://amplitude.com/docs/sdks/analytics/browser/browser-sdk-2#configure-the-sdk here} for more info.\n * @param unifiedOptions Shared configuration for all SDKs and for blade SDKs.\n */\n async initAll(apiKey: string, unifiedOptions?: UnifiedOptions) {\n const sharedOptions = {\n serverZone: unifiedOptions?.serverZone,\n instanceName: unifiedOptions?.instanceName,\n };\n\n super.add(libraryPlugin());\n await super.init(apiKey, { ...unifiedOptions?.analytics, ...sharedOptions }).promise;\n\n await super.add(sessionReplayPlugin({ ...unifiedOptions?.sessionReplay, ...sharedOptions })).promise;\n\n await super.add(experimentPlugin({ ...unifiedOptions?.experiment, ...sharedOptions })).promise;\n\n const srPlugin = this.plugin(SessionReplayPlugin.pluginName);\n if (srPlugin === undefined) {\n this.config.loggerProvider.debug(`${SessionReplayPlugin.pluginName} plugin is not found.`);\n } else {\n this._sessionReplay = (srPlugin as SessionReplayPlugin).sessionReplay;\n }\n }\n\n /**\n * Only analytics SDK is initialized. Use initAll() instead to initialize all blade SDKs.\n */\n /* istanbul ignore next */\n init(apiKey = '', userIdOrOptions?: string | BrowserOptions, maybeOptions?: BrowserOptions) {\n const res = super.init(apiKey, userIdOrOptions, maybeOptions);\n return res;\n }\n}\n"]}
|
package/lib/esm/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "1.0.0-beta.
|
|
1
|
+
export declare const VERSION = "1.0.0-beta.6";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/lib/esm/version.js
CHANGED
package/lib/esm/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,MAAM,CAAC,IAAM,OAAO,GAAG,cAAc,CAAC","sourcesContent":["// Autogenerated by `yarn version-file`. DO NOT EDIT\nexport const VERSION = '1.0.0-beta.
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,MAAM,CAAC,IAAM,OAAO,GAAG,cAAc,CAAC","sourcesContent":["// Autogenerated by `yarn version-file`. DO NOT EDIT\nexport const VERSION = '1.0.0-beta.6';\n"]}
|