@amplitude/session-replay-browser
Advanced tools
Comparing version 1.0.2 to 1.1.0-beta.0
@@ -1,4 +0,4 @@ | ||
export declare const init: (apiKey: string, options: import("./typings/session-replay").SessionReplayOptions) => import("@amplitude/analytics-types").AmplitudeReturn<void>, setSessionId: (sessionId: number) => void, getSessionReplayProperties: () => { | ||
export declare const init: (apiKey: string, options: import("./typings/session-replay").SessionReplayOptions) => import("@amplitude/analytics-types").AmplitudeReturn<void>, setSessionId: (sessionId: number) => void, getSessionId: () => number | undefined, getSessionReplayProperties: () => { | ||
[key: string]: string | boolean | null; | ||
}, flush: (useRetry: boolean) => Promise<void>, shutdown: () => void; | ||
//# sourceMappingURL=index.d.ts.map |
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.shutdown = exports.flush = exports.getSessionReplayProperties = exports.setSessionId = exports.init = void 0; | ||
exports.shutdown = exports.flush = exports.getSessionReplayProperties = exports.getSessionId = exports.setSessionId = exports.init = void 0; | ||
var tslib_1 = require("tslib"); | ||
var session_replay_factory_1 = tslib_1.__importDefault(require("./session-replay-factory")); | ||
exports.init = session_replay_factory_1.default.init, exports.setSessionId = session_replay_factory_1.default.setSessionId, exports.getSessionReplayProperties = session_replay_factory_1.default.getSessionReplayProperties, exports.flush = session_replay_factory_1.default.flush, exports.shutdown = session_replay_factory_1.default.shutdown; | ||
exports.init = session_replay_factory_1.default.init, exports.setSessionId = session_replay_factory_1.default.setSessionId, exports.getSessionId = session_replay_factory_1.default.getSessionId, exports.getSessionReplayProperties = session_replay_factory_1.default.getSessionReplayProperties, exports.flush = session_replay_factory_1.default.flush, exports.shutdown = session_replay_factory_1.default.shutdown; | ||
//# sourceMappingURL=index.js.map |
@@ -20,2 +20,3 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
setSessionId: (0, analytics_core_1.debugWrapper)(sessionReplay.setSessionId.bind(sessionReplay), 'setSessionId', (0, exports.getLogConfig)(sessionReplay)), | ||
getSessionId: (0, analytics_core_1.debugWrapper)(sessionReplay.getSessionId.bind(sessionReplay), 'getSessionId', (0, exports.getLogConfig)(sessionReplay)), | ||
getSessionReplayProperties: (0, analytics_core_1.debugWrapper)(sessionReplay.getSessionReplayProperties.bind(sessionReplay), 'getSessionReplayProperties', (0, exports.getLogConfig)(sessionReplay)), | ||
@@ -22,0 +23,0 @@ flush: (0, analytics_core_1.debugWrapper)(sessionReplay.flush.bind(sessionReplay), 'flush', (0, exports.getLogConfig)(sessionReplay)), |
@@ -31,3 +31,3 @@ import { Logger as ILogger } from '@amplitude/analytics-types'; | ||
shouldOptOut(): boolean | undefined; | ||
getShouldRecord(): boolean; | ||
getShouldRecord(ignoreFocus?: boolean): boolean; | ||
getBlockSelectors(): string | string[] | undefined; | ||
@@ -54,2 +54,3 @@ sendStoredEvents(storedReplaySessions: IDBStore): void; | ||
getDeviceId(): string | undefined; | ||
getSessionId(): number | undefined; | ||
send(context: SessionReplayContext, useRetry?: boolean): Promise<void>; | ||
@@ -56,0 +57,0 @@ handleReponse(status: number, context: SessionReplayContext): void; |
@@ -89,4 +89,6 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
} | ||
if (sessionId && this.config.deviceId) { | ||
this.config.sessionReplayId = (0, helpers_1.generateSessionReplayId)(sessionId, this.config.deviceId); | ||
// use a consistent device id. | ||
var deviceId = this.getDeviceId(); | ||
if (sessionId && deviceId) { | ||
this.config.sessionReplayId = (0, helpers_1.generateSessionReplayId)(sessionId, deviceId); | ||
} | ||
@@ -118,3 +120,6 @@ else { | ||
} | ||
var shouldRecord = this.getShouldRecord(); | ||
// If the user is in debug mode, ignore the focus handler when tagging events. | ||
// this is a common mishap when someone is developing locally and not seeing events getting tagged. | ||
var ignoreFocus = !!this.config.debugMode; | ||
var shouldRecord = this.getShouldRecord(ignoreFocus); | ||
if (shouldRecord) { | ||
@@ -204,3 +209,4 @@ var eventProperties = (_a = {}, | ||
}; | ||
SessionReplay.prototype.getShouldRecord = function () { | ||
SessionReplay.prototype.getShouldRecord = function (ignoreFocus) { | ||
if (ignoreFocus === void 0) { ignoreFocus = false; } | ||
if (!this.config) { | ||
@@ -211,3 +217,3 @@ this.loggerProvider.error("Session is not being recorded due to lack of config, please call sessionReplay.init."); | ||
var globalScope = (0, analytics_client_common_1.getGlobalScope)(); | ||
if (globalScope && globalScope.document && !globalScope.document.hasFocus()) { | ||
if (!ignoreFocus && globalScope && globalScope.document && !globalScope.document.hasFocus()) { | ||
if (this.config.sessionId) { | ||
@@ -402,2 +408,6 @@ this.loggerProvider.log("Session ".concat(this.config.sessionId, " temporarily not recording due to lack of browser focus.")); | ||
}; | ||
SessionReplay.prototype.getSessionId = function () { | ||
var _a; | ||
return (_a = this.config) === null || _a === void 0 ? void 0 : _a.sessionId; | ||
}; | ||
SessionReplay.prototype.send = function (context, useRetry) { | ||
@@ -404,0 +414,0 @@ var _a; |
@@ -46,2 +46,3 @@ import { AmplitudeReturn, Config, LogLevel, Logger } from '@amplitude/analytics-types'; | ||
setSessionId: (sessionId: number) => void; | ||
getSessionId: () => number | undefined; | ||
getSessionReplayProperties: () => { | ||
@@ -48,0 +49,0 @@ [key: string]: boolean | string | null; |
@@ -1,4 +0,4 @@ | ||
export declare const init: (apiKey: string, options: import("./typings/session-replay").SessionReplayOptions) => import("@amplitude/analytics-types").AmplitudeReturn<void>, setSessionId: (sessionId: number) => void, getSessionReplayProperties: () => { | ||
export declare const init: (apiKey: string, options: import("./typings/session-replay").SessionReplayOptions) => import("@amplitude/analytics-types").AmplitudeReturn<void>, setSessionId: (sessionId: number) => void, getSessionId: () => number | undefined, getSessionReplayProperties: () => { | ||
[key: string]: string | boolean | null; | ||
}, flush: (useRetry: boolean) => Promise<void>, shutdown: () => void; | ||
//# sourceMappingURL=index.d.ts.map |
import sessionReplay from './session-replay-factory'; | ||
export var init = sessionReplay.init, setSessionId = sessionReplay.setSessionId, getSessionReplayProperties = sessionReplay.getSessionReplayProperties, flush = sessionReplay.flush, shutdown = sessionReplay.shutdown; | ||
export var init = sessionReplay.init, setSessionId = sessionReplay.setSessionId, getSessionId = sessionReplay.getSessionId, getSessionReplayProperties = sessionReplay.getSessionReplayProperties, flush = sessionReplay.flush, shutdown = sessionReplay.shutdown; | ||
//# sourceMappingURL=index.js.map |
@@ -17,2 +17,3 @@ import { debugWrapper } from '@amplitude/analytics-core'; | ||
setSessionId: debugWrapper(sessionReplay.setSessionId.bind(sessionReplay), 'setSessionId', getLogConfig(sessionReplay)), | ||
getSessionId: debugWrapper(sessionReplay.getSessionId.bind(sessionReplay), 'getSessionId', getLogConfig(sessionReplay)), | ||
getSessionReplayProperties: debugWrapper(sessionReplay.getSessionReplayProperties.bind(sessionReplay), 'getSessionReplayProperties', getLogConfig(sessionReplay)), | ||
@@ -19,0 +20,0 @@ flush: debugWrapper(sessionReplay.flush.bind(sessionReplay), 'flush', getLogConfig(sessionReplay)), |
@@ -31,3 +31,3 @@ import { Logger as ILogger } from '@amplitude/analytics-types'; | ||
shouldOptOut(): boolean | undefined; | ||
getShouldRecord(): boolean; | ||
getShouldRecord(ignoreFocus?: boolean): boolean; | ||
getBlockSelectors(): string | string[] | undefined; | ||
@@ -54,2 +54,3 @@ sendStoredEvents(storedReplaySessions: IDBStore): void; | ||
getDeviceId(): string | undefined; | ||
getSessionId(): number | undefined; | ||
send(context: SessionReplayContext, useRetry?: boolean): Promise<void>; | ||
@@ -56,0 +57,0 @@ handleReponse(status: number, context: SessionReplayContext): void; |
@@ -87,4 +87,6 @@ import { __assign, __awaiter, __generator, __read } from "tslib"; | ||
} | ||
if (sessionId && this.config.deviceId) { | ||
this.config.sessionReplayId = generateSessionReplayId(sessionId, this.config.deviceId); | ||
// use a consistent device id. | ||
var deviceId = this.getDeviceId(); | ||
if (sessionId && deviceId) { | ||
this.config.sessionReplayId = generateSessionReplayId(sessionId, deviceId); | ||
} | ||
@@ -116,3 +118,6 @@ else { | ||
} | ||
var shouldRecord = this.getShouldRecord(); | ||
// If the user is in debug mode, ignore the focus handler when tagging events. | ||
// this is a common mishap when someone is developing locally and not seeing events getting tagged. | ||
var ignoreFocus = !!this.config.debugMode; | ||
var shouldRecord = this.getShouldRecord(ignoreFocus); | ||
if (shouldRecord) { | ||
@@ -202,3 +207,4 @@ var eventProperties = (_a = {}, | ||
}; | ||
SessionReplay.prototype.getShouldRecord = function () { | ||
SessionReplay.prototype.getShouldRecord = function (ignoreFocus) { | ||
if (ignoreFocus === void 0) { ignoreFocus = false; } | ||
if (!this.config) { | ||
@@ -209,3 +215,3 @@ this.loggerProvider.error("Session is not being recorded due to lack of config, please call sessionReplay.init."); | ||
var globalScope = getGlobalScope(); | ||
if (globalScope && globalScope.document && !globalScope.document.hasFocus()) { | ||
if (!ignoreFocus && globalScope && globalScope.document && !globalScope.document.hasFocus()) { | ||
if (this.config.sessionId) { | ||
@@ -400,2 +406,6 @@ this.loggerProvider.log("Session ".concat(this.config.sessionId, " temporarily not recording due to lack of browser focus.")); | ||
}; | ||
SessionReplay.prototype.getSessionId = function () { | ||
var _a; | ||
return (_a = this.config) === null || _a === void 0 ? void 0 : _a.sessionId; | ||
}; | ||
SessionReplay.prototype.send = function (context, useRetry) { | ||
@@ -402,0 +412,0 @@ var _a; |
@@ -46,2 +46,3 @@ import { AmplitudeReturn, Config, LogLevel, Logger } from '@amplitude/analytics-types'; | ||
setSessionId: (sessionId: number) => void; | ||
getSessionId: () => number | undefined; | ||
getSessionReplayProperties: () => { | ||
@@ -48,0 +49,0 @@ [key: string]: boolean | string | null; |
@@ -1,4 +0,4 @@ | ||
export declare const init: (apiKey: string, options: import("./typings/session-replay").SessionReplayOptions) => import("@amplitude/analytics-types").AmplitudeReturn<void>, setSessionId: (sessionId: number) => void, getSessionReplayProperties: () => { | ||
export declare const init: (apiKey: string, options: import("./typings/session-replay").SessionReplayOptions) => import("@amplitude/analytics-types").AmplitudeReturn<void>, setSessionId: (sessionId: number) => void, getSessionId: () => number | undefined, getSessionReplayProperties: () => { | ||
[key: string]: string | boolean | null; | ||
}, flush: (useRetry: boolean) => Promise<void>, shutdown: () => void; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -31,3 +31,3 @@ import { Logger as ILogger } from '@amplitude/analytics-types'; | ||
shouldOptOut(): boolean | undefined; | ||
getShouldRecord(): boolean; | ||
getShouldRecord(ignoreFocus?: boolean): boolean; | ||
getBlockSelectors(): string | string[] | undefined; | ||
@@ -54,2 +54,3 @@ sendStoredEvents(storedReplaySessions: IDBStore): void; | ||
getDeviceId(): string | undefined; | ||
getSessionId(): number | undefined; | ||
send(context: SessionReplayContext, useRetry?: boolean): Promise<void>; | ||
@@ -56,0 +57,0 @@ handleReponse(status: number, context: SessionReplayContext): void; |
@@ -46,2 +46,3 @@ import { AmplitudeReturn, Config, LogLevel, Logger } from '@amplitude/analytics-types'; | ||
setSessionId: (sessionId: number) => void; | ||
getSessionId: () => number | undefined; | ||
getSessionReplayProperties: () => { | ||
@@ -48,0 +49,0 @@ [key: string]: boolean | string | null; |
{ | ||
"name": "@amplitude/session-replay-browser", | ||
"version": "1.0.2", | ||
"version": "1.1.0-beta.0", | ||
"description": "", | ||
@@ -60,3 +60,3 @@ "author": "Amplitude Inc", | ||
], | ||
"gitHead": "f07f2bf6aaf2817ded4f18eda548d5c2778ee75c" | ||
"gitHead": "350be3b91b8186c3aba1af460ab6a507cc43ed25" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
509796
2878
1