@amplitude/session-replay-react-native 0.1.0-beta.2 → 0.1.0-beta.4
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/AmplitudeSessionReplayReactNative.podspec +2 -43
- package/README.md +3 -113
- package/android/build.gradle +19 -127
- package/android/src/main/java/com/amplitude/sessionreplayreactnative/SessionReplayReactNativeModule.kt +4 -62
- package/android/src/newarch/java/com/amplitude/sessionreplayreactnative/SessionReplayReactNativePackage.kt +4 -2
- package/android/src/newarch/java/com/amplitude/sessionreplayreactnative/fabric/AmpMaskViewManager.kt +48 -0
- package/android/src/oldarch/java/com/amplitude/sessionreplayreactnative/SessionReplayReactNativeSpec.kt +0 -1
- package/ios/AMPNativeSessionReplay.mm +0 -2
- package/ios/AmpMaskApplier.h +22 -0
- package/ios/AmpMaskApplier.m +21 -0
- package/ios/NativeSessionReplay.swift +6 -41
- package/ios/fabric/AMPMaskComponentView.h +17 -0
- package/ios/fabric/AMPMaskComponentView.mm +78 -0
- package/lib/commonjs/amp-mask-view.js +9 -2
- package/lib/commonjs/amp-mask-view.js.map +1 -1
- package/lib/commonjs/index.js +0 -25
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/native-module.js.map +1 -1
- package/lib/commonjs/plugin-session-replay.js +5 -34
- package/lib/commonjs/plugin-session-replay.js.map +1 -1
- package/lib/commonjs/session-replay-config.js +0 -1
- package/lib/commonjs/session-replay-config.js.map +1 -1
- package/lib/commonjs/session-replay.js +4 -35
- package/lib/commonjs/session-replay.js.map +1 -1
- package/lib/commonjs/specs/{SRMaskViewNativeComponent.js → AmpMaskViewNativeComponent.js} +7 -2
- package/lib/commonjs/specs/AmpMaskViewNativeComponent.js.map +1 -0
- package/lib/commonjs/specs/NativeAmpSessionReplay.js.map +1 -1
- package/lib/commonjs/version.js +1 -1
- package/lib/module/amp-mask-view.js +8 -2
- package/lib/module/amp-mask-view.js.map +1 -1
- package/lib/module/index.js +1 -16
- package/lib/module/index.js.map +1 -1
- package/lib/module/native-module.js.map +1 -1
- package/lib/module/plugin-session-replay.js +6 -35
- package/lib/module/plugin-session-replay.js.map +1 -1
- package/lib/module/session-replay-config.js +0 -1
- package/lib/module/session-replay-config.js.map +1 -1
- package/lib/module/session-replay.js +4 -34
- package/lib/module/session-replay.js.map +1 -1
- package/lib/module/specs/AmpMaskViewNativeComponent.js +10 -0
- package/lib/module/specs/AmpMaskViewNativeComponent.js.map +1 -0
- package/lib/module/specs/NativeAmpSessionReplay.js.map +1 -1
- package/lib/module/version.js +1 -1
- package/lib/typescript/amp-mask-view.d.ts +4 -4
- package/lib/typescript/amp-mask-view.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +2 -13
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/native-module.d.ts +0 -12
- package/lib/typescript/native-module.d.ts.map +1 -1
- package/lib/typescript/plugin-session-replay.d.ts +0 -16
- package/lib/typescript/plugin-session-replay.d.ts.map +1 -1
- package/lib/typescript/session-replay-config.d.ts +0 -5
- package/lib/typescript/session-replay-config.d.ts.map +1 -1
- package/lib/typescript/session-replay.d.ts +4 -28
- package/lib/typescript/session-replay.d.ts.map +1 -1
- package/lib/typescript/specs/{SRMaskViewNativeComponent.d.ts → AmpMaskViewNativeComponent.d.ts} +2 -4
- package/lib/typescript/specs/AmpMaskViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/specs/NativeAmpSessionReplay.d.ts +0 -1
- package/lib/typescript/specs/NativeAmpSessionReplay.d.ts.map +1 -1
- package/lib/typescript/version.d.ts +1 -1
- package/package.json +2 -2
- package/src/amp-mask-view.tsx +11 -3
- package/src/index.tsx +2 -29
- package/src/native-module.ts +0 -14
- package/src/plugin-session-replay.ts +4 -33
- package/src/session-replay-config.ts +0 -7
- package/src/session-replay.ts +4 -37
- package/src/specs/AmpMaskViewNativeComponent.ts +17 -0
- package/src/specs/NativeAmpSessionReplay.ts +0 -1
- package/src/version.ts +1 -1
- package/android/src/androidTest/java/com/amplitude/sessionreplayreactnative/SRMaskViewTest.kt +0 -459
- package/android/src/main/java/com/amplitude/sessionreplayreactnative/SRDefaultMaskingPrimitive.kt +0 -36
- package/android/src/main/java/com/amplitude/sessionreplayreactnative/SRMaskingPrimitive.kt +0 -84
- package/android/src/newarch/java/com/amplitude/sessionreplayreactnative/fabric/SRMaskView.kt +0 -174
- package/android/src/newarch/java/com/amplitude/sessionreplayreactnative/fabric/SRMaskViewManager.kt +0 -44
- package/android/src/newarch/java/com/amplitude/sessionreplayreactnative/fabric/SRMaskViewPointerEvents.java +0 -36
- package/cpp/SRMaskViewComponentDescriptor.h +0 -20
- package/cpp/SRMaskViewShadowNode.cpp +0 -54
- package/cpp/SRMaskViewShadowNode.h +0 -56
- package/ios/SRDefaultMaskingPrimitive.swift +0 -34
- package/ios/SRMaskingPrimitive.h +0 -26
- package/ios/SRMaskingRegistry.m +0 -105
- package/ios/fabric/SRMaskView.h +0 -10
- package/ios/fabric/SRMaskView.mm +0 -178
- package/lib/commonjs/Mask.types.js +0 -29
- package/lib/commonjs/Mask.types.js.map +0 -1
- package/lib/commonjs/fabric/MaskFabric.js +0 -92
- package/lib/commonjs/fabric/MaskFabric.js.map +0 -1
- package/lib/commonjs/mask-fallback.js +0 -53
- package/lib/commonjs/mask-fallback.js.map +0 -1
- package/lib/commonjs/paper/MaskPaper.js +0 -27
- package/lib/commonjs/paper/MaskPaper.js.map +0 -1
- package/lib/commonjs/specs/SRMaskViewNativeComponent.js.map +0 -1
- package/lib/module/Mask.types.js +0 -23
- package/lib/module/Mask.types.js.map +0 -1
- package/lib/module/fabric/MaskFabric.js +0 -85
- package/lib/module/fabric/MaskFabric.js.map +0 -1
- package/lib/module/mask-fallback.js +0 -45
- package/lib/module/mask-fallback.js.map +0 -1
- package/lib/module/paper/MaskPaper.js +0 -21
- package/lib/module/paper/MaskPaper.js.map +0 -1
- package/lib/module/specs/SRMaskViewNativeComponent.js +0 -5
- package/lib/module/specs/SRMaskViewNativeComponent.js.map +0 -1
- package/lib/typescript/Mask.types.d.ts +0 -38
- package/lib/typescript/Mask.types.d.ts.map +0 -1
- package/lib/typescript/fabric/MaskFabric.d.ts +0 -8
- package/lib/typescript/fabric/MaskFabric.d.ts.map +0 -1
- package/lib/typescript/mask-fallback.d.ts +0 -27
- package/lib/typescript/mask-fallback.d.ts.map +0 -1
- package/lib/typescript/paper/MaskPaper.d.ts +0 -10
- package/lib/typescript/paper/MaskPaper.d.ts.map +0 -1
- package/lib/typescript/specs/SRMaskViewNativeComponent.d.ts.map +0 -1
- package/src/Mask.types.ts +0 -45
- package/src/fabric/MaskFabric.tsx +0 -73
- package/src/mask-fallback.tsx +0 -60
- package/src/paper/MaskPaper.tsx +0 -24
- package/src/specs/SRMaskViewNativeComponent.ts +0 -12
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getDefaultSessionReplayPluginConfig","getSessionId","
|
|
1
|
+
{"version":3,"names":["getDefaultSessionReplayPluginConfig","getSessionId","privateInit","setSessionId","start","stop","createSessionReplayLogger","SessionReplayPlugin","name","type","config","isInitialized","logger","constructor","sessionReplayConfig","setLogLevel","logLevel","log","setup","_","apiKey","deviceId","sessionId","serverZone","sampleRate","enableRemoteConfig","autoStart","execute","event","_this$config","Promise","resolve","teardown"],"sourceRoot":"../../src","sources":["plugin-session-replay.ts"],"mappings":"AAOA,SAAoCA,mCAAmC,QAAQ,gCAAgC;AAC/G,SAASC,YAAY,EAAEC,WAAW,EAAEC,YAAY,EAAEC,KAAK,EAAEC,IAAI,QAAQ,kBAAkB;AACvF,SAASC,yBAAyB,QAAQ,UAAU;;AAEpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,mBAAmB,CAAmE;EACjGC,IAAI,GAAG,+CAA+C;EACtDC,IAAI,GAAG,YAAY;EAEXC,MAAM,GAA6B,IAAI;EACvCC,aAAa,GAAG,KAAK;EAGrBC,MAAM,GAAGN,yBAAyB,CAAC,CAAC;;EAE5C;AAC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ACnB,MAAM,cAAAmB,YAAA,eAAXA,YAAA,CAAaP,SAAS,IAAI,IAAI,CAACZ,MAAM,CAACY,SAAS,MAAM,MAAMrB,YAAY,CAAC,CAAC,CAAC,EAAE;MAC9E,MAAME,YAAY,CAAC,IAAI,CAACO,MAAM,CAACY,SAAS,CAAC;IAC3C;IACA,OAAOQ,OAAO,CAACC,OAAO,CAACH,KAAK,CAAC;EAC/B;;EAEA;AACF;AACA;AACA;AACA;AACA;EACE,MAAMxB,KAAKA,CAAA,EAAkB;IAC3B,IAAI,IAAI,CAACO,aAAa,EAAE;MACtB,MAAMP,KAAK,CAAC,CAAC;IACf;EACF;;EAEA;AACF;AACA;AACA;AACA;AACA;EACE,MAAMC,IAAIA,CAAA,EAAkB;IAC1B,IAAI,IAAI,CAACM,aAAa,EAAE;MACtB,MAAMN,IAAI,CAAC,CAAC;IACd;EACF;EAEA,MAAM2B,QAAQA,CAAA,EAAkB;IAC9B,IAAI,IAAI,CAACrB,aAAa,EAAE;MACtB,MAAMN,IAAI,CAAC,CAAC;IACd;IAEA,IAAI,CAACK,MAAM,GAAG,IAAI;IAClB,IAAI,CAACC,aAAa,GAAG,KAAK;EAC5B;AACF","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["LogLevel","getDefaultConfig","
|
|
1
|
+
{"version":3,"names":["LogLevel","getDefaultConfig","deviceId","enableRemoteConfig","logLevel","Warn","optOut","privacyConfig","sampleRate","serverZone","sessionId"],"sourceRoot":"../../src","sources":["session-replay-config.ts"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,4BAA4B;;AAErD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAOA;AACA;AACA;;AAqEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,OAAO,MAAMC,gBAA6E,GAAGA,CAAA,KAAM;EACjG,OAAO;IACLC,QAAQ,EAAE,IAAI;IACdC,kBAAkB,EAAE,IAAI;IACxBC,QAAQ,EAAEJ,QAAQ,CAACK,IAAI;IACvBC,MAAM,EAAE,KAAK;IACb;IACA;IACA;IACA;IACAC,aAAa,EAAE,CAAC,CAAC;IACjBC,UAAU,EAAE,CAAC;IACbC,UAAU,EAAE,IAAI;IAChBC,SAAS,EAAE,CAAC;EACd,CAAC;AACH,CAAC;AACD,SAASV,QAAQ","ignoreList":[]}
|
|
@@ -40,12 +40,12 @@ let isInitialized = false;
|
|
|
40
40
|
let logger = createSessionReplayLogger();
|
|
41
41
|
|
|
42
42
|
/**
|
|
43
|
-
* Configure the SDK
|
|
43
|
+
* Configure the SDK. Call `start()` explicitly to begin collecting replays.
|
|
44
44
|
* This function must be called before any other session replay operations.
|
|
45
45
|
*
|
|
46
46
|
* @param config - Configuration object containing API key, device ID, session ID, and other options
|
|
47
|
-
* @returns Promise that resolves when initialization is complete
|
|
48
|
-
*
|
|
47
|
+
* @returns Promise that resolves when initialization is complete. Native setup
|
|
48
|
+
* failures are logged and do not reject the promise.
|
|
49
49
|
*
|
|
50
50
|
* @example
|
|
51
51
|
* ```typescript
|
|
@@ -145,35 +145,6 @@ export async function getSessionId() {
|
|
|
145
145
|
return await NativeSessionReplay.getSessionId();
|
|
146
146
|
}
|
|
147
147
|
|
|
148
|
-
/**
|
|
149
|
-
* Interface for session replay properties that should be attached to Amplitude events.
|
|
150
|
-
* These properties help correlate events with session recordings.
|
|
151
|
-
*/
|
|
152
|
-
|
|
153
|
-
/**
|
|
154
|
-
* When you send events to Amplitude, call this function to get the most up-to-date session replay properties for the event.
|
|
155
|
-
* Collect Session Replay properties to send with other event properties.
|
|
156
|
-
*
|
|
157
|
-
* @returns Promise that resolves to an object containing session replay metadata
|
|
158
|
-
*
|
|
159
|
-
* @example
|
|
160
|
-
* ```typescript
|
|
161
|
-
* const sessionReplayProperties = await getSessionReplayProperties();
|
|
162
|
-
* analytics.track('Button Clicked', {
|
|
163
|
-
* buttonName: 'submit',
|
|
164
|
-
* ...sessionReplayProperties // Merge session replay properties
|
|
165
|
-
* });
|
|
166
|
-
* ```
|
|
167
|
-
*/
|
|
168
|
-
export async function getSessionReplayProperties() {
|
|
169
|
-
if (!isInitialized) {
|
|
170
|
-
logger.warn('SessionReplay is not initialized');
|
|
171
|
-
return {};
|
|
172
|
-
}
|
|
173
|
-
const properties = await NativeSessionReplay.getSessionReplayProperties();
|
|
174
|
-
return properties;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
148
|
/**
|
|
178
149
|
* Flush any pending session replay data to the server.
|
|
179
150
|
* Forces immediate upload of recorded session data that may be buffered locally.
|
|
@@ -197,13 +168,12 @@ export async function flush() {
|
|
|
197
168
|
/**
|
|
198
169
|
* Start session replay recording.
|
|
199
170
|
* Begins capturing user interactions and screen content for replay.
|
|
200
|
-
* If autoStart is enabled in the configuration, this is called automatically during initialization.
|
|
201
171
|
*
|
|
202
172
|
* @returns Promise that resolves when recording starts
|
|
203
173
|
*
|
|
204
174
|
* @example
|
|
205
175
|
* ```typescript
|
|
206
|
-
* //
|
|
176
|
+
* // Recording starts only after this explicit call.
|
|
207
177
|
* await start();
|
|
208
178
|
* ```
|
|
209
179
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NativeSessionReplay","getDefaultConfig","createSessionReplayLogger","VERSION","normalizeConfig","config","maskLevel","privacyConfig","rest","undefined","fullConfig","isInitialized","logger","init","warn","setLogLevel","logLevel","log","setup","nativeConfig","error","setSessionId","sessionId","setDeviceId","deviceId","getSessionId","
|
|
1
|
+
{"version":3,"names":["NativeSessionReplay","getDefaultConfig","createSessionReplayLogger","VERSION","normalizeConfig","config","maskLevel","privacyConfig","rest","undefined","fullConfig","isInitialized","logger","init","warn","setLogLevel","logLevel","log","setup","nativeConfig","error","setSessionId","sessionId","setDeviceId","deviceId","getSessionId","flush","start","stop","resolvedMaskLevel","privateInit","newLogger"],"sourceRoot":"../../src","sources":["session-replay.ts"],"mappings":"AAAA;;AAEA,SAASA,mBAAmB,QAAwC,iBAAiB;AAC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AChB,aAAa,EAAE;IAClBC,MAAM,CAACE,IAAI,CAAC,kCAAkC,CAAC;IAC/C;EACF;EACA,MAAMd,mBAAmB,CAAC2B,KAAK,CAAC,CAAC;AACnC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,eAAeC,IAAIA,CAAA,EAAkB;EAC1C,IAAI,CAACjB,aAAa,EAAE;IAClBC,MAAM,CAACE,IAAI,CAAC,kCAAkC,CAAC;IAC/C;EACF;EACA,MAAMd,mBAAmB,CAAC4B,IAAI,CAAC,CAAC;AAClC;AAEA,SAAST,YAAYA,CAACd,MAAmC,EAA6B;EACpF;EACA;EACA;EACA;EACA;EACA;EACA,MAAM;IAAEE,aAAa;IAAE,GAAGC;EAAK,CAAC,GAAGH,MAAM;EACzC,MAAMwB,iBAAyD,GAAGtB,aAAa,CAACD,SAAS,IAAI,QAAQ;EACrG,OAAO;IACL,GAAGE,IAAI;IACPQ,QAAQ,EAAER,IAAI,CAACQ,QAAiD;IAChE;IACAV,SAAS,EAAEuB;EACb,CAAC;AACH;AAEA,OAAO,eAAeC,WAAWA,CAC/BzB,MAA2B,EAC3B0B,SAAuD,EACxC;EACfnB,MAAM,GAAGmB,SAAS;EAClB,OAAOlB,IAAI,CAACR,MAAM,CAAC;AACrB","ignoreList":[]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/* eslint-disable import/namespace, import/default, import/no-named-as-default, import/no-named-as-default-member */
|
|
2
|
+
|
|
3
|
+
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
|
|
4
|
+
// Same native name on both architectures: on the New Architecture this resolves
|
|
5
|
+
// to the Fabric AMPMaskComponentView (ios/fabric, android/src/newarch); on the
|
|
6
|
+
// old architecture codegenNativeComponent falls back to
|
|
7
|
+
// requireNativeComponent('AMPMaskComponentView'), which resolves to the
|
|
8
|
+
// unchanged legacy Paper view managers.
|
|
9
|
+
export default codegenNativeComponent('AMPMaskComponentView');
|
|
10
|
+
//# sourceMappingURL=AmpMaskViewNativeComponent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["codegenNativeComponent"],"sourceRoot":"../../../src","sources":["specs/AmpMaskViewNativeComponent.ts"],"mappings":"AAAA;;AAGA,OAAOA,sBAAsB,MAAM,yDAAyD;AAQ5F;AACA;AACA;AACA;AACA;AACA,eAAeA,sBAAsB,CAAc,sBAAsB,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["TurboModuleRegistry","get"],"sourceRoot":"../../../src","sources":["specs/NativeAmpSessionReplay.ts"],"mappings":"AACA,SAASA,mBAAmB,QAAQ,cAAc;AAClD;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;;
|
|
1
|
+
{"version":3,"names":["TurboModuleRegistry","get"],"sourceRoot":"../../../src","sources":["specs/NativeAmpSessionReplay.ts"],"mappings":"AACA,SAASA,mBAAmB,QAAQ,cAAc;AAClD;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAWA;AACA;AACA;AACA;AACA;AACA,eAAeA,mBAAmB,CAACC,GAAG,CAAO,wBAAwB,CAAC","ignoreList":[]}
|
package/lib/module/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '0.1.0-beta.
|
|
1
|
+
export const VERSION = '0.1.0-beta.4';
|
|
2
2
|
//# sourceMappingURL=version.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import type { ComponentType } from 'react';
|
|
2
|
+
import type { ViewProps } from 'react-native';
|
|
3
|
+
export interface AmpMaskViewProps extends ViewProps {
|
|
3
4
|
mask: 'amp-mask' | 'amp-unmask' | 'amp-block';
|
|
4
5
|
}
|
|
5
|
-
export declare const AmpMaskView:
|
|
6
|
-
export {};
|
|
6
|
+
export declare const AmpMaskView: ComponentType<AmpMaskViewProps>;
|
|
7
7
|
//# sourceMappingURL=amp-mask-view.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"amp-mask-view.d.ts","sourceRoot":"","sources":["../../src/amp-mask-view.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"amp-mask-view.d.ts","sourceRoot":"","sources":["../../src/amp-mask-view.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAG9C,MAAM,WAAW,gBAAiB,SAAQ,SAAS;IACjD,IAAI,EAAE,UAAU,GAAG,YAAY,GAAG,WAAW,CAAC;CAC/C;AAQD,eAAO,MAAM,WAAW,iCAAuD,CAAC"}
|
|
@@ -1,17 +1,6 @@
|
|
|
1
|
-
export { init, setSessionId, getSessionId,
|
|
1
|
+
export { init, setSessionId, getSessionId, flush, start, stop, setDeviceId } from './session-replay';
|
|
2
2
|
export { type SessionReplayConfig, type MaskLevel, type PrivacyConfig } from './session-replay-config';
|
|
3
3
|
export { SessionReplayPlugin } from './plugin-session-replay';
|
|
4
4
|
export type { SessionReplayPluginConfig } from './plugin-session-replay-config';
|
|
5
|
-
export { AmpMaskView } from './amp-mask-view';
|
|
6
|
-
import type { ComponentType } from 'react';
|
|
7
|
-
import type { MaskProps, UnmaskProps } from './Mask.types';
|
|
8
|
-
/**
|
|
9
|
-
* Layout-transparent Session Replay masking.
|
|
10
|
-
* `<AmpMask>` masks its children; `<AmpUnmask>` exempts children inside a masked region.
|
|
11
|
-
* Requires the New Architecture (React Native >= 0.77). On the Old Architecture:
|
|
12
|
-
* throws in dev, falls back to `<AmpMaskView>` (masked but layout-unsafe) in prod.
|
|
13
|
-
* @experimental Subject to change while experimental.
|
|
14
|
-
*/
|
|
15
|
-
export declare const AmpMask: ComponentType<MaskProps>, AmpUnmask: ComponentType<UnmaskProps>;
|
|
16
|
-
export type { MaskProps, UnmaskProps, AmpMaskLevel } from './Mask.types';
|
|
5
|
+
export { AmpMaskView, type AmpMaskViewProps } from './amp-mask-view';
|
|
17
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,YAAY,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACrG,OAAO,EAAE,KAAK,mBAAmB,EAAE,KAAK,SAAS,EAAE,KAAK,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAEvG,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,YAAY,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAEhF,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -6,8 +6,6 @@ export declare const NativeSessionReplay: NativeSessionReplaySpec;
|
|
|
6
6
|
export interface NativeSessionReplayConfig {
|
|
7
7
|
/** Your Amplitude API key for authentication and data routing */
|
|
8
8
|
apiKey: string;
|
|
9
|
-
/** Whether to automatically start recording when the module is initialized */
|
|
10
|
-
autoStart: boolean;
|
|
11
9
|
/** Device identifier that matches the device ID sent with Amplitude events */
|
|
12
10
|
deviceId: string | null;
|
|
13
11
|
/** Whether to enable remote configuration for dynamic settings updates */
|
|
@@ -25,9 +23,6 @@ export interface NativeSessionReplayConfig {
|
|
|
25
23
|
/** Current session identifier for correlating events with recordings */
|
|
26
24
|
sessionId: number;
|
|
27
25
|
}
|
|
28
|
-
export interface NativeSessionReplayProperties {
|
|
29
|
-
[key: string]: string | number | boolean;
|
|
30
|
-
}
|
|
31
26
|
/**
|
|
32
27
|
* Interface defining the native session replay module specification.
|
|
33
28
|
* This interface provides the contract for communication between JavaScript and
|
|
@@ -48,13 +43,6 @@ export interface NativeSessionReplaySpec {
|
|
|
48
43
|
* @note OLD ARCH: ideally we want to cache that on JS side to avoid bridge overhead
|
|
49
44
|
*/
|
|
50
45
|
getSessionId(): Promise<number>;
|
|
51
|
-
/**
|
|
52
|
-
* Retrieves session replay properties that should be attached to Amplitude events.
|
|
53
|
-
* These properties help correlate events with session recordings.
|
|
54
|
-
* @returns Promise resolving to an object containing session replay metadata
|
|
55
|
-
* @note OLD ARCH: ideally we want to cache that on JS side to avoid bridge overhead
|
|
56
|
-
*/
|
|
57
|
-
getSessionReplayProperties(): Promise<NativeSessionReplayProperties>;
|
|
58
46
|
/**
|
|
59
47
|
* Updates the device identifier used for session replay tracking.
|
|
60
48
|
* @param deviceId - The device identifier string, or null to clear the device ID
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"native-module.d.ts","sourceRoot":"","sources":["../../src/native-module.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,mBAAmB,yBAQU,CAAC;AAE3C;;;GAGG;AACH,MAAM,WAAW,yBAAyB;IACxC,iEAAiE;IACjE,MAAM,EAAE,MAAM,CAAC;IACf,8EAA8E;IAC9E,
|
|
1
|
+
{"version":3,"file":"native-module.d.ts","sourceRoot":"","sources":["../../src/native-module.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,mBAAmB,yBAQU,CAAC;AAE3C;;;GAGG;AACH,MAAM,WAAW,yBAAyB;IACxC,iEAAiE;IACjE,MAAM,EAAE,MAAM,CAAC;IACf,8EAA8E;IAC9E,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,0EAA0E;IAC1E,kBAAkB,EAAE,OAAO,CAAC;IAC5B,oFAAoF;IACpF,QAAQ,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC5B,kEAAkE;IAClE,SAAS,EAAE,OAAO,GAAG,QAAQ,GAAG,cAAc,CAAC;IAC/C,iEAAiE;IACjE,MAAM,EAAE,OAAO,CAAC;IAChB,kFAAkF;IAClF,UAAU,EAAE,MAAM,CAAC;IACnB,4DAA4D;IAC5D,UAAU,EAAE,IAAI,GAAG,IAAI,CAAC;IACxB,wEAAwE;IACxE,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,uBAAuB;IACtC;;;OAGG;IACH,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAEvB;;;;OAIG;IACH,YAAY,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAEhC;;;;OAIG;IACH,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEpD;;;;OAIG;IACH,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE/C;;;;OAIG;IACH,KAAK,CAAC,MAAM,EAAE,yBAAyB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAExD;;;OAGG;IACH,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAEvB;;;OAGG;IACH,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACvB"}
|
|
@@ -57,21 +57,5 @@ export declare class SessionReplayPlugin implements EnrichmentPlugin<ReactNative
|
|
|
57
57
|
*/
|
|
58
58
|
stop(): Promise<void>;
|
|
59
59
|
teardown(): Promise<void>;
|
|
60
|
-
/**
|
|
61
|
-
* Get session replay properties for manual event correlation.
|
|
62
|
-
* When you send events to Amplitude, call this method to get the most up-to-date session replay properties for the event.
|
|
63
|
-
*
|
|
64
|
-
* @returns Promise that resolves to an object containing session replay metadata
|
|
65
|
-
*
|
|
66
|
-
* @example
|
|
67
|
-
* ```typescript
|
|
68
|
-
* const sessionReplayProperties = await plugin.getSessionReplayProperties();
|
|
69
|
-
* analytics.track('Button Clicked', {
|
|
70
|
-
* buttonName: 'submit',
|
|
71
|
-
* ...sessionReplayProperties
|
|
72
|
-
* });
|
|
73
|
-
* ```
|
|
74
|
-
*/
|
|
75
|
-
getSessionReplayProperties(): Promise<import("./session-replay").SessionReplayProperties>;
|
|
76
60
|
}
|
|
77
61
|
//# sourceMappingURL=plugin-session-replay.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-session-replay.d.ts","sourceRoot":"","sources":["../../src/plugin-session-replay.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,KAAK,EACV,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACvB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,yBAAyB,EAAuC,MAAM,gCAAgC,CAAC;AAIhH;;;;;;;;GAQG;AACH,qBAAa,mBAAoB,YAAW,gBAAgB,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IAChG,IAAI,SAAmD;IACvD,IAAI,eAAyB;IAE7B,OAAO,CAAC,MAAM,CAAkC;IAChD,OAAO,CAAC,aAAa,CAAS;IAE9B,OAAO,CAAC,mBAAmB,CAAsC;IACjE,OAAO,CAAC,MAAM,CAA+B;IAE7C;;;;;;;;;;;;;;OAcG;gBACS,MAAM,GAAE,yBAA8B;IAUlD;;;;;;;OAOG;IACG,KAAK,CAAC,MAAM,EAAE,iBAAiB,EAAE,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"plugin-session-replay.d.ts","sourceRoot":"","sources":["../../src/plugin-session-replay.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,KAAK,EACV,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACvB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,yBAAyB,EAAuC,MAAM,gCAAgC,CAAC;AAIhH;;;;;;;;GAQG;AACH,qBAAa,mBAAoB,YAAW,gBAAgB,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IAChG,IAAI,SAAmD;IACvD,IAAI,eAAyB;IAE7B,OAAO,CAAC,MAAM,CAAkC;IAChD,OAAO,CAAC,aAAa,CAAS;IAE9B,OAAO,CAAC,mBAAmB,CAAsC;IACjE,OAAO,CAAC,MAAM,CAA+B;IAE7C;;;;;;;;;;;;;;OAcG;gBACS,MAAM,GAAE,yBAA8B;IAUlD;;;;;;;OAOG;IACG,KAAK,CAAC,MAAM,EAAE,iBAAiB,EAAE,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAoBrE,OAAO,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC;IAclD;;;;;OAKG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAM5B;;;;;OAKG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAMrB,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;CAQhC"}
|
|
@@ -23,11 +23,6 @@ export interface SessionReplayConfig {
|
|
|
23
23
|
* @required
|
|
24
24
|
*/
|
|
25
25
|
apiKey: string;
|
|
26
|
-
/**
|
|
27
|
-
* Whether to automatically start recording when the SDK is initialized
|
|
28
|
-
* @default true
|
|
29
|
-
*/
|
|
30
|
-
autoStart?: boolean;
|
|
31
26
|
/**
|
|
32
27
|
* Device identifier that matches the device ID sent with Amplitude events
|
|
33
28
|
* Must match the Device ID passed as event properties to Amplitude
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-replay-config.d.ts","sourceRoot":"","sources":["../../src/session-replay-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAEtD;;;;;;;;;;GAUG;AACH,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,QAAQ,GAAG,cAAc,CAAC;AAE5D,MAAM,WAAW,aAAa;IAC5B,SAAS,CAAC,E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,12 +1,12 @@
|
|
|
1
1
|
import { SessionReplayConfig } from './session-replay-config';
|
|
2
2
|
import { createSessionReplayLogger } from './logger';
|
|
3
3
|
/**
|
|
4
|
-
* Configure the SDK
|
|
4
|
+
* Configure the SDK. Call `start()` explicitly to begin collecting replays.
|
|
5
5
|
* This function must be called before any other session replay operations.
|
|
6
6
|
*
|
|
7
7
|
* @param config - Configuration object containing API key, device ID, session ID, and other options
|
|
8
|
-
* @returns Promise that resolves when initialization is complete
|
|
9
|
-
*
|
|
8
|
+
* @returns Promise that resolves when initialization is complete. Native setup
|
|
9
|
+
* failures are logged and do not reject the promise.
|
|
10
10
|
*
|
|
11
11
|
* @example
|
|
12
12
|
* ```typescript
|
|
@@ -61,29 +61,6 @@ export declare function setDeviceId(deviceId: string | null): Promise<void>;
|
|
|
61
61
|
* ```
|
|
62
62
|
*/
|
|
63
63
|
export declare function getSessionId(): Promise<number | null>;
|
|
64
|
-
/**
|
|
65
|
-
* Interface for session replay properties that should be attached to Amplitude events.
|
|
66
|
-
* These properties help correlate events with session recordings.
|
|
67
|
-
*/
|
|
68
|
-
export interface SessionReplayProperties {
|
|
69
|
-
[key: string]: string | boolean | null;
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* When you send events to Amplitude, call this function to get the most up-to-date session replay properties for the event.
|
|
73
|
-
* Collect Session Replay properties to send with other event properties.
|
|
74
|
-
*
|
|
75
|
-
* @returns Promise that resolves to an object containing session replay metadata
|
|
76
|
-
*
|
|
77
|
-
* @example
|
|
78
|
-
* ```typescript
|
|
79
|
-
* const sessionReplayProperties = await getSessionReplayProperties();
|
|
80
|
-
* analytics.track('Button Clicked', {
|
|
81
|
-
* buttonName: 'submit',
|
|
82
|
-
* ...sessionReplayProperties // Merge session replay properties
|
|
83
|
-
* });
|
|
84
|
-
* ```
|
|
85
|
-
*/
|
|
86
|
-
export declare function getSessionReplayProperties(): Promise<SessionReplayProperties>;
|
|
87
64
|
/**
|
|
88
65
|
* Flush any pending session replay data to the server.
|
|
89
66
|
* Forces immediate upload of recorded session data that may be buffered locally.
|
|
@@ -100,13 +77,12 @@ export declare function flush(): Promise<void>;
|
|
|
100
77
|
/**
|
|
101
78
|
* Start session replay recording.
|
|
102
79
|
* Begins capturing user interactions and screen content for replay.
|
|
103
|
-
* If autoStart is enabled in the configuration, this is called automatically during initialization.
|
|
104
80
|
*
|
|
105
81
|
* @returns Promise that resolves when recording starts
|
|
106
82
|
*
|
|
107
83
|
* @example
|
|
108
84
|
* ```typescript
|
|
109
|
-
* //
|
|
85
|
+
* // Recording starts only after this explicit call.
|
|
110
86
|
* await start();
|
|
111
87
|
* ```
|
|
112
88
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-replay.d.ts","sourceRoot":"","sources":["../../src/session-replay.ts"],"names":[],"mappings":"AAGA,OAAO,EAAoB,mBAAmB,EAA+B,MAAM,yBAAyB,CAAC;AAC7G,OAAO,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AA6BrD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,IAAI,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAyBrE;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAMnE;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAMxE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,YAAY,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAM3D;AAED
|
|
1
|
+
{"version":3,"file":"session-replay.d.ts","sourceRoot":"","sources":["../../src/session-replay.ts"],"names":[],"mappings":"AAGA,OAAO,EAAoB,mBAAmB,EAA+B,MAAM,yBAAyB,CAAC;AAC7G,OAAO,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AA6BrD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,IAAI,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAyBrE;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAMnE;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAMxE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,YAAY,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAM3D;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAM3C;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAM3C;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAM1C;AAmBD,wBAAsB,WAAW,CAC/B,MAAM,EAAE,mBAAmB,EAC3B,SAAS,EAAE,UAAU,CAAC,OAAO,yBAAyB,CAAC,GACtD,OAAO,CAAC,IAAI,CAAC,CAGf"}
|
package/lib/typescript/specs/{SRMaskViewNativeComponent.d.ts → AmpMaskViewNativeComponent.d.ts}
RENAMED
|
@@ -2,10 +2,8 @@
|
|
|
2
2
|
import type { ViewProps } from 'react-native';
|
|
3
3
|
import type { WithDefault } from 'react-native/Libraries/Types/CodegenTypes';
|
|
4
4
|
export interface NativeProps extends ViewProps {
|
|
5
|
-
|
|
6
|
-
unmask?: WithDefault<boolean, false>;
|
|
7
|
-
maskLevel?: WithDefault<string, 'mask'>;
|
|
5
|
+
mask?: WithDefault<string, 'amp-mask'>;
|
|
8
6
|
}
|
|
9
7
|
declare const _default: import("react-native/Libraries/Utilities/codegenNativeComponent").NativeComponentType<NativeProps>;
|
|
10
8
|
export default _default;
|
|
11
|
-
//# sourceMappingURL=
|
|
9
|
+
//# sourceMappingURL=AmpMaskViewNativeComponent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AmpMaskViewNativeComponent.d.ts","sourceRoot":"","sources":["../../../src/specs/AmpMaskViewNativeComponent.ts"],"names":[],"mappings":";AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAC;AAG7E,MAAM,WAAW,WAAY,SAAQ,SAAS;IAG5C,IAAI,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;CACxC;;AAOD,wBAA2E"}
|
|
@@ -5,7 +5,6 @@ export interface Spec extends TurboModule {
|
|
|
5
5
|
setSessionId(sessionId: number): Promise<void>;
|
|
6
6
|
setDeviceId(deviceId: string | null): Promise<void>;
|
|
7
7
|
getSessionId(): Promise<number>;
|
|
8
|
-
getSessionReplayProperties(): Promise<UnsafeObject>;
|
|
9
8
|
start(): Promise<void>;
|
|
10
9
|
stop(): Promise<void>;
|
|
11
10
|
flush(): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeAmpSessionReplay.d.ts","sourceRoot":"","sources":["../../../src/specs/NativeAmpSessionReplay.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAIhD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2CAA2C,CAAC;AAQ9E,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC,KAAK,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3C,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/C,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACpD,YAAY,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAChC,
|
|
1
|
+
{"version":3,"file":"NativeAmpSessionReplay.d.ts","sourceRoot":"","sources":["../../../src/specs/NativeAmpSessionReplay.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAIhD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2CAA2C,CAAC;AAQ9E,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC,KAAK,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3C,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/C,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACpD,YAAY,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAChC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACtB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB;;AAOD,wBAAuE"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.1.0-beta.
|
|
1
|
+
export declare const VERSION = "0.1.0-beta.4";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@amplitude/session-replay-react-native",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.4",
|
|
4
4
|
"description": "Amplitude Session Replay for React Native",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"analytics",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
},
|
|
71
71
|
"ios": {
|
|
72
72
|
"componentProvider": {
|
|
73
|
-
"
|
|
73
|
+
"AMPMaskComponentView": "AMPMaskComponentView"
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
},
|
package/src/amp-mask-view.tsx
CHANGED
|
@@ -1,7 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ComponentType } from 'react';
|
|
2
|
+
import type { ViewProps } from 'react-native';
|
|
3
|
+
import NativeAmpMaskView from './specs/AmpMaskViewNativeComponent';
|
|
2
4
|
|
|
3
|
-
interface AmpMaskViewProps extends ViewProps {
|
|
5
|
+
export interface AmpMaskViewProps extends ViewProps {
|
|
4
6
|
mask: 'amp-mask' | 'amp-unmask' | 'amp-block';
|
|
5
7
|
}
|
|
6
8
|
|
|
7
|
-
|
|
9
|
+
// A normal layout node (lays out exactly like a plain <View>) that tags itself
|
|
10
|
+
// for the Session Replay recorder. On the New Architecture it is a real Fabric
|
|
11
|
+
// component, so it does not go through React Native's legacy-interop layer
|
|
12
|
+
// (whose out-of-band re-parenting mis-renders nested mask/unmask subtrees).
|
|
13
|
+
// The spec widens `mask` to string for codegen; the public prop stays required
|
|
14
|
+
// and union-typed.
|
|
15
|
+
export const AmpMaskView = NativeAmpMaskView as ComponentType<AmpMaskViewProps>;
|
package/src/index.tsx
CHANGED
|
@@ -1,34 +1,7 @@
|
|
|
1
|
-
export {
|
|
2
|
-
init,
|
|
3
|
-
setSessionId,
|
|
4
|
-
getSessionId,
|
|
5
|
-
getSessionReplayProperties,
|
|
6
|
-
flush,
|
|
7
|
-
start,
|
|
8
|
-
stop,
|
|
9
|
-
setDeviceId,
|
|
10
|
-
} from './session-replay';
|
|
1
|
+
export { init, setSessionId, getSessionId, flush, start, stop, setDeviceId } from './session-replay';
|
|
11
2
|
export { type SessionReplayConfig, type MaskLevel, type PrivacyConfig } from './session-replay-config';
|
|
12
3
|
|
|
13
4
|
export { SessionReplayPlugin } from './plugin-session-replay';
|
|
14
5
|
export type { SessionReplayPluginConfig } from './plugin-session-replay-config';
|
|
15
6
|
|
|
16
|
-
export { AmpMaskView } from './amp-mask-view';
|
|
17
|
-
|
|
18
|
-
import type { ComponentType } from 'react';
|
|
19
|
-
import type { MaskProps, UnmaskProps } from './Mask.types';
|
|
20
|
-
|
|
21
|
-
const g = global as unknown as { RN$Bridgeless?: boolean; nativeFabricUIManager?: unknown };
|
|
22
|
-
const isNewArch = g.RN$Bridgeless === true || g.nativeFabricUIManager != null;
|
|
23
|
-
/**
|
|
24
|
-
* Layout-transparent Session Replay masking.
|
|
25
|
-
* `<AmpMask>` masks its children; `<AmpUnmask>` exempts children inside a masked region.
|
|
26
|
-
* Requires the New Architecture (React Native >= 0.77). On the Old Architecture:
|
|
27
|
-
* throws in dev, falls back to `<AmpMaskView>` (masked but layout-unsafe) in prod.
|
|
28
|
-
* @experimental Subject to change while experimental.
|
|
29
|
-
*/
|
|
30
|
-
// eslint-disable-next-line @typescript-eslint/no-var-requires, @typescript-eslint/no-unsafe-assignment
|
|
31
|
-
export const { AmpMask, AmpUnmask }: { AmpMask: ComponentType<MaskProps>; AmpUnmask: ComponentType<UnmaskProps> } =
|
|
32
|
-
isNewArch ? require('./fabric/MaskFabric') : require('./paper/MaskPaper');
|
|
33
|
-
// Named AmpMaskLevel because `MaskLevel` is already exported from './session-replay-config'.
|
|
34
|
-
export type { MaskProps, UnmaskProps, AmpMaskLevel } from './Mask.types';
|
|
7
|
+
export { AmpMaskView, type AmpMaskViewProps } from './amp-mask-view';
|
package/src/native-module.ts
CHANGED
|
@@ -30,8 +30,6 @@ export const NativeSessionReplay = (SessionReplaySpec ??
|
|
|
30
30
|
export interface NativeSessionReplayConfig {
|
|
31
31
|
/** Your Amplitude API key for authentication and data routing */
|
|
32
32
|
apiKey: string;
|
|
33
|
-
/** Whether to automatically start recording when the module is initialized */
|
|
34
|
-
autoStart: boolean;
|
|
35
33
|
/** Device identifier that matches the device ID sent with Amplitude events */
|
|
36
34
|
deviceId: string | null;
|
|
37
35
|
/** Whether to enable remote configuration for dynamic settings updates */
|
|
@@ -50,10 +48,6 @@ export interface NativeSessionReplayConfig {
|
|
|
50
48
|
sessionId: number;
|
|
51
49
|
}
|
|
52
50
|
|
|
53
|
-
export interface NativeSessionReplayProperties {
|
|
54
|
-
[key: string]: string | number | boolean;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
51
|
/**
|
|
58
52
|
* Interface defining the native session replay module specification.
|
|
59
53
|
* This interface provides the contract for communication between JavaScript and
|
|
@@ -76,14 +70,6 @@ export interface NativeSessionReplaySpec {
|
|
|
76
70
|
*/
|
|
77
71
|
getSessionId(): Promise<number>;
|
|
78
72
|
|
|
79
|
-
/**
|
|
80
|
-
* Retrieves session replay properties that should be attached to Amplitude events.
|
|
81
|
-
* These properties help correlate events with session recordings.
|
|
82
|
-
* @returns Promise resolving to an object containing session replay metadata
|
|
83
|
-
* @note OLD ARCH: ideally we want to cache that on JS side to avoid bridge overhead
|
|
84
|
-
*/
|
|
85
|
-
getSessionReplayProperties(): Promise<NativeSessionReplayProperties>;
|
|
86
|
-
|
|
87
73
|
/**
|
|
88
74
|
* Updates the device identifier used for session replay tracking.
|
|
89
75
|
* @param deviceId - The device identifier string, or null to clear the device ID
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from '@amplitude/analytics-types';
|
|
7
7
|
|
|
8
8
|
import { SessionReplayPluginConfig, getDefaultSessionReplayPluginConfig } from './plugin-session-replay-config';
|
|
9
|
-
import { getSessionId,
|
|
9
|
+
import { getSessionId, privateInit, setSessionId, start, stop } from './session-replay';
|
|
10
10
|
import { createSessionReplayLogger } from './logger';
|
|
11
11
|
|
|
12
12
|
/**
|
|
@@ -72,11 +72,13 @@ export class SessionReplayPlugin implements EnrichmentPlugin<ReactNativeClient,
|
|
|
72
72
|
sampleRate: this.sessionReplayConfig.sampleRate,
|
|
73
73
|
enableRemoteConfig: this.sessionReplayConfig.enableRemoteConfig,
|
|
74
74
|
logLevel: this.sessionReplayConfig.logLevel,
|
|
75
|
-
autoStart: this.sessionReplayConfig.autoStart,
|
|
76
75
|
},
|
|
77
76
|
this.logger,
|
|
78
77
|
);
|
|
79
78
|
this.isInitialized = true;
|
|
79
|
+
if (this.sessionReplayConfig.autoStart) {
|
|
80
|
+
await start();
|
|
81
|
+
}
|
|
80
82
|
}
|
|
81
83
|
|
|
82
84
|
async execute(event: Event): Promise<Event | null> {
|
|
@@ -90,15 +92,6 @@ export class SessionReplayPlugin implements EnrichmentPlugin<ReactNativeClient,
|
|
|
90
92
|
if (this.config?.sessionId && this.config.sessionId !== (await getSessionId())) {
|
|
91
93
|
await setSessionId(this.config.sessionId);
|
|
92
94
|
}
|
|
93
|
-
// Treating config.sessionId as source of truth, if the event's session id doesn't match, the
|
|
94
|
-
// event is not of the current session (offline/late events). In that case, don't tag the events
|
|
95
|
-
if (this.config?.sessionId && this.config.sessionId === event.session_id) {
|
|
96
|
-
const sessionRecordingProperties = await getSessionReplayProperties();
|
|
97
|
-
event.event_properties = {
|
|
98
|
-
...event.event_properties,
|
|
99
|
-
...sessionRecordingProperties,
|
|
100
|
-
};
|
|
101
|
-
}
|
|
102
95
|
return Promise.resolve(event);
|
|
103
96
|
}
|
|
104
97
|
|
|
@@ -134,26 +127,4 @@ export class SessionReplayPlugin implements EnrichmentPlugin<ReactNativeClient,
|
|
|
134
127
|
this.config = null;
|
|
135
128
|
this.isInitialized = false;
|
|
136
129
|
}
|
|
137
|
-
|
|
138
|
-
/**
|
|
139
|
-
* Get session replay properties for manual event correlation.
|
|
140
|
-
* When you send events to Amplitude, call this method to get the most up-to-date session replay properties for the event.
|
|
141
|
-
*
|
|
142
|
-
* @returns Promise that resolves to an object containing session replay metadata
|
|
143
|
-
*
|
|
144
|
-
* @example
|
|
145
|
-
* ```typescript
|
|
146
|
-
* const sessionReplayProperties = await plugin.getSessionReplayProperties();
|
|
147
|
-
* analytics.track('Button Clicked', {
|
|
148
|
-
* buttonName: 'submit',
|
|
149
|
-
* ...sessionReplayProperties
|
|
150
|
-
* });
|
|
151
|
-
* ```
|
|
152
|
-
*/
|
|
153
|
-
async getSessionReplayProperties() {
|
|
154
|
-
if (!this.isInitialized) {
|
|
155
|
-
return {};
|
|
156
|
-
}
|
|
157
|
-
return getSessionReplayProperties();
|
|
158
|
-
}
|
|
159
130
|
}
|
|
@@ -27,12 +27,6 @@ export interface SessionReplayConfig {
|
|
|
27
27
|
*/
|
|
28
28
|
apiKey: string;
|
|
29
29
|
|
|
30
|
-
/**
|
|
31
|
-
* Whether to automatically start recording when the SDK is initialized
|
|
32
|
-
* @default true
|
|
33
|
-
*/
|
|
34
|
-
autoStart?: boolean;
|
|
35
|
-
|
|
36
30
|
/**
|
|
37
31
|
* Device identifier that matches the device ID sent with Amplitude events
|
|
38
32
|
* Must match the Device ID passed as event properties to Amplitude
|
|
@@ -107,7 +101,6 @@ export type SessionReplayConfigInternal = Omit<SessionReplayConfig, 'maskLevel'>
|
|
|
107
101
|
|
|
108
102
|
export const getDefaultConfig: () => Required<Omit<SessionReplayConfigInternal, 'apiKey'>> = () => {
|
|
109
103
|
return {
|
|
110
|
-
autoStart: true,
|
|
111
104
|
deviceId: null,
|
|
112
105
|
enableRemoteConfig: true,
|
|
113
106
|
logLevel: LogLevel.Warn,
|