@amplitude/plugin-session-replay-browser 0.6.6 → 0.6.8
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/README.md +5 -5
- package/lib/cjs/constants.d.ts +0 -15
- package/lib/cjs/constants.d.ts.map +1 -1
- package/lib/cjs/constants.js +1 -20
- package/lib/cjs/constants.js.map +1 -1
- package/lib/cjs/session-replay.d.ts +13 -2
- package/lib/cjs/session-replay.d.ts.map +1 -1
- package/lib/cjs/session-replay.js +28 -483
- package/lib/cjs/session-replay.js.map +1 -1
- package/lib/cjs/typings/session-replay.d.ts +0 -67
- package/lib/cjs/typings/session-replay.d.ts.map +1 -1
- package/lib/cjs/typings/session-replay.js +0 -6
- package/lib/cjs/typings/session-replay.js.map +1 -1
- package/lib/esm/constants.d.ts +0 -15
- package/lib/esm/constants.d.ts.map +1 -1
- package/lib/esm/constants.js +0 -19
- package/lib/esm/constants.js.map +1 -1
- package/lib/esm/session-replay.d.ts +13 -2
- package/lib/esm/session-replay.d.ts.map +1 -1
- package/lib/esm/session-replay.js +29 -484
- package/lib/esm/session-replay.js.map +1 -1
- package/lib/esm/typings/session-replay.d.ts +0 -67
- package/lib/esm/typings/session-replay.d.ts.map +1 -1
- package/lib/esm/typings/session-replay.js +1 -5
- package/lib/esm/typings/session-replay.js.map +1 -1
- package/lib/scripts/amplitude-min.js +1 -1
- package/lib/scripts/amplitude-min.js.gz +0 -0
- package/lib/scripts/amplitude-min.umd.js +1 -1
- package/lib/scripts/amplitude-min.umd.js.gz +0 -0
- package/lib/scripts/constants.d.ts +0 -15
- package/lib/scripts/constants.d.ts.map +1 -1
- package/lib/scripts/session-replay.d.ts +13 -2
- package/lib/scripts/session-replay.d.ts.map +1 -1
- package/lib/scripts/typings/session-replay.d.ts +0 -67
- package/lib/scripts/typings/session-replay.d.ts.map +1 -1
- package/package.json +3 -2
- package/lib/cjs/helpers.d.ts +0 -4
- package/lib/cjs/helpers.d.ts.map +0 -1
- package/lib/cjs/helpers.js +0 -32
- package/lib/cjs/helpers.js.map +0 -1
- package/lib/cjs/messages.d.ts +0 -5
- package/lib/cjs/messages.d.ts.map +0 -1
- package/lib/cjs/messages.js +0 -10
- package/lib/cjs/messages.js.map +0 -1
- package/lib/esm/helpers.d.ts +0 -4
- package/lib/esm/helpers.d.ts.map +0 -1
- package/lib/esm/helpers.js +0 -27
- package/lib/esm/helpers.js.map +0 -1
- package/lib/esm/messages.d.ts +0 -5
- package/lib/esm/messages.d.ts.map +0 -1
- package/lib/esm/messages.js +0 -7
- package/lib/esm/messages.js.map +0 -1
- package/lib/scripts/helpers.d.ts +0 -4
- package/lib/scripts/helpers.d.ts.map +0 -1
- package/lib/scripts/messages.d.ts +0 -5
- package/lib/scripts/messages.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -53,7 +53,7 @@ const sessionReplayTracking = sessionReplayPlugin({
|
|
|
53
53
|
|
|
54
54
|
|Name|Type|Default|Description|
|
|
55
55
|
|-|-|-|-|
|
|
56
|
-
|`sampleRate`|`number`|`undefined`|Use this option to control how many sessions will be selected for
|
|
56
|
+
|`sampleRate`|`number`|`undefined`|Use this option to control how many sessions will be selected for replay collection. A selected session will be collected for replay, while sessions that are not selected will not. <br></br>The number should be a decimal between 0 and 1, ie `0.4`, representing the fraction of sessions you would like to have randomly selected for replay collection. Over a large number of sessions, `0.4` would select `40%` of those sessions.|
|
|
57
57
|
|
|
58
58
|
### 3. Install plugin to Amplitude SDK
|
|
59
59
|
|
|
@@ -62,13 +62,13 @@ amplitude.add(sessionReplayTracking);
|
|
|
62
62
|
```
|
|
63
63
|
|
|
64
64
|
## Privacy
|
|
65
|
-
By default, the session
|
|
65
|
+
By default, the session replay will mask all inputs, meaning the text in inputs will appear in a session replay as asterisks: `***`. You may require more specific masking controls based on your use case, so we offer the following controls:
|
|
66
66
|
|
|
67
67
|
#### 1. Unmask inputs
|
|
68
|
-
In your application code, add the class `.amp-unmask` to any __input__ whose text you'd like to have unmasked in the
|
|
68
|
+
In your application code, add the class `.amp-unmask` to any __input__ whose text you'd like to have unmasked in the replay. In the session replay, it will be possible to read the exact text entered into an input with this class, the text will not be converted to asterisks.
|
|
69
69
|
|
|
70
70
|
#### 2. Mask non-input elements
|
|
71
|
-
In your application code, add the class `.amp-mask` to any __non-input element__ whose text you'd like to have masked from the
|
|
71
|
+
In your application code, add the class `.amp-mask` to any __non-input element__ whose text you'd like to have masked from the replay. The text in the element, as well as it's children, will all be converted to asterisks.
|
|
72
72
|
|
|
73
73
|
#### 3. Block non-text elements
|
|
74
|
-
In your application code, add the class `.amp-block` to any element you would like to have blocked from the
|
|
74
|
+
In your application code, add the class `.amp-block` to any element you would like to have blocked from the collection of the replay. The element will appear in the replay as a placeholder with the same dimensions.
|
package/lib/cjs/constants.d.ts
CHANGED
|
@@ -1,17 +1,2 @@
|
|
|
1
|
-
import { IDBStoreSession } from './typings/session-replay';
|
|
2
|
-
export declare const DEFAULT_EVENT_PROPERTY_PREFIX = "[Amplitude]";
|
|
3
|
-
export declare const DEFAULT_SESSION_REPLAY_PROPERTY: string;
|
|
4
1
|
export declare const DEFAULT_SESSION_START_EVENT = "session_start";
|
|
5
|
-
export declare const DEFAULT_SESSION_END_EVENT = "session_end";
|
|
6
|
-
export declare const BLOCK_CLASS = "amp-block";
|
|
7
|
-
export declare const MASK_TEXT_CLASS = "amp-mask";
|
|
8
|
-
export declare const UNMASK_TEXT_CLASS = "amp-unmask";
|
|
9
|
-
export declare const SESSION_REPLAY_SERVER_URL = "https://api-secure.amplitude.com/sessions/track";
|
|
10
|
-
export declare const SESSION_REPLAY_EU_URL = "https://api.eu.amplitude.com/sessions/track";
|
|
11
|
-
export declare const STORAGE_PREFIX: string;
|
|
12
|
-
export declare const MAX_EVENT_LIST_SIZE_IN_BYTES: number;
|
|
13
|
-
export declare const MIN_INTERVAL = 500;
|
|
14
|
-
export declare const MAX_INTERVAL: number;
|
|
15
|
-
export declare const defaultSessionStore: IDBStoreSession;
|
|
16
|
-
export declare const MAX_IDB_STORAGE_LENGTH: number;
|
|
17
2
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,2BAA2B,kBAAkB,CAAC"}
|
package/lib/cjs/constants.js
CHANGED
|
@@ -1,23 +1,4 @@
|
|
|
1
1
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
-
exports.
|
|
3
|
-
var analytics_core_1 = require("@amplitude/analytics-core");
|
|
4
|
-
exports.DEFAULT_EVENT_PROPERTY_PREFIX = '[Amplitude]';
|
|
5
|
-
exports.DEFAULT_SESSION_REPLAY_PROPERTY = "".concat(exports.DEFAULT_EVENT_PROPERTY_PREFIX, " Session Recorded");
|
|
2
|
+
exports.DEFAULT_SESSION_START_EVENT = void 0;
|
|
6
3
|
exports.DEFAULT_SESSION_START_EVENT = 'session_start';
|
|
7
|
-
exports.DEFAULT_SESSION_END_EVENT = 'session_end';
|
|
8
|
-
exports.BLOCK_CLASS = 'amp-block';
|
|
9
|
-
exports.MASK_TEXT_CLASS = 'amp-mask';
|
|
10
|
-
exports.UNMASK_TEXT_CLASS = 'amp-unmask';
|
|
11
|
-
exports.SESSION_REPLAY_SERVER_URL = 'https://api-secure.amplitude.com/sessions/track';
|
|
12
|
-
exports.SESSION_REPLAY_EU_URL = 'https://api.eu.amplitude.com/sessions/track';
|
|
13
|
-
exports.STORAGE_PREFIX = "".concat(analytics_core_1.AMPLITUDE_PREFIX, "_replay_unsent");
|
|
14
|
-
var PAYLOAD_ESTIMATED_SIZE_IN_BYTES_WITHOUT_EVENTS = 500; // derived by JSON stringifying an example payload without events
|
|
15
|
-
exports.MAX_EVENT_LIST_SIZE_IN_BYTES = 10 * 1000000 - PAYLOAD_ESTIMATED_SIZE_IN_BYTES_WITHOUT_EVENTS;
|
|
16
|
-
exports.MIN_INTERVAL = 500; // 500 ms
|
|
17
|
-
exports.MAX_INTERVAL = 10 * 1000; // 10 seconds
|
|
18
|
-
exports.defaultSessionStore = {
|
|
19
|
-
currentSequenceId: 0,
|
|
20
|
-
sessionSequences: {},
|
|
21
|
-
};
|
|
22
|
-
exports.MAX_IDB_STORAGE_LENGTH = 1000 * 60 * 60 * 24 * 3; // 3 days
|
|
23
4
|
//# sourceMappingURL=constants.js.map
|
package/lib/cjs/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":";;AAAa,QAAA,2BAA2B,GAAG,eAAe,CAAC","sourcesContent":["export const DEFAULT_SESSION_START_EVENT = 'session_start';\n"]}
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { BrowserConfig, EnrichmentPlugin, Event } from '@amplitude/analytics-types';
|
|
2
|
+
import { SessionReplayOptions } from './typings/session-replay';
|
|
3
|
+
export declare class SessionReplayPlugin implements EnrichmentPlugin {
|
|
4
|
+
name: string;
|
|
5
|
+
type: "enrichment";
|
|
6
|
+
config: BrowserConfig;
|
|
7
|
+
options: SessionReplayOptions;
|
|
8
|
+
constructor(options?: SessionReplayOptions);
|
|
9
|
+
setup(config: BrowserConfig): Promise<void>;
|
|
10
|
+
execute(event: Event): Promise<Event>;
|
|
11
|
+
teardown(): Promise<void>;
|
|
12
|
+
}
|
|
13
|
+
export declare const sessionReplayPlugin: (options?: SessionReplayOptions) => EnrichmentPlugin;
|
|
3
14
|
//# sourceMappingURL=session-replay.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-replay.d.ts","sourceRoot":"","sources":["../../src/session-replay.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"session-replay.d.ts","sourceRoot":"","sources":["../../src/session-replay.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAGpF,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,qBAAa,mBAAoB,YAAW,gBAAgB;IAC1D,IAAI,SAA8C;IAClD,IAAI,eAAyB;IAI7B,MAAM,EAAE,aAAa,CAAC;IACtB,OAAO,EAAE,oBAAoB,CAAC;gBAElB,OAAO,CAAC,EAAE,oBAAoB;IAIpC,KAAK,CAAC,MAAM,EAAE,aAAa;IAkC3B,OAAO,CAAC,KAAK,EAAE,KAAK;IAcpB,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;CAGhC;AAED,eAAO,MAAM,mBAAmB,EAAE,CAAC,OAAO,CAAC,EAAE,oBAAoB,KAAK,gBAIrE,CAAC"}
|