@plushanalytics/react-native-session-replay 3.0.0 → 3.0.2
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 +55 -2
- package/android/src/main/java/com/posthogreactnativesessionreplay/PosthogReactNativeSessionReplayModule.kt +68 -27
- package/ios/PosthogReactNativeSessionReplay.mm +3 -0
- package/ios/PosthogReactNativeSessionReplay.swift +58 -31
- package/lib/commonjs/adapters/mobileReplayAdapter.js +55 -18
- package/lib/commonjs/adapters/mobileReplayAdapter.js.map +1 -1
- package/lib/commonjs/client.js +2 -1
- package/lib/commonjs/client.js.map +1 -1
- package/lib/commonjs/nativeBridge.js +5 -0
- package/lib/commonjs/nativeBridge.js.map +1 -1
- package/lib/module/adapters/mobileReplayAdapter.js +55 -18
- package/lib/module/adapters/mobileReplayAdapter.js.map +1 -1
- package/lib/module/client.js +2 -1
- package/lib/module/client.js.map +1 -1
- package/lib/module/nativeBridge.js +4 -0
- package/lib/module/nativeBridge.js.map +1 -1
- package/lib/typescript/commonjs/src/adapters/mobileReplayAdapter.d.ts +2 -1
- package/lib/typescript/commonjs/src/adapters/mobileReplayAdapter.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/client.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/index.d.ts +1 -1
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/nativeBridge.d.ts +2 -0
- package/lib/typescript/commonjs/src/nativeBridge.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/types.d.ts +16 -5
- package/lib/typescript/commonjs/src/types.d.ts.map +1 -1
- package/lib/typescript/module/src/adapters/mobileReplayAdapter.d.ts +2 -1
- package/lib/typescript/module/src/adapters/mobileReplayAdapter.d.ts.map +1 -1
- package/lib/typescript/module/src/client.d.ts.map +1 -1
- package/lib/typescript/module/src/index.d.ts +1 -1
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/nativeBridge.d.ts +2 -0
- package/lib/typescript/module/src/nativeBridge.d.ts.map +1 -1
- package/lib/typescript/module/src/types.d.ts +16 -5
- package/lib/typescript/module/src/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/adapters/mobileReplayAdapter.ts +112 -19
- package/src/client.ts +2 -1
- package/src/index.tsx +2 -0
- package/src/nativeBridge.ts +8 -1
- package/src/types.ts +19 -5
package/src/nativeBridge.ts
CHANGED
|
@@ -40,6 +40,10 @@ export function endSession(): Promise<void> {
|
|
|
40
40
|
return PosthogReactNativeSessionReplay.endSession();
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
+
export function flush(): Promise<void> {
|
|
44
|
+
return PosthogReactNativeSessionReplay.flush();
|
|
45
|
+
}
|
|
46
|
+
|
|
43
47
|
export function isEnabled(): Promise<boolean> {
|
|
44
48
|
return PosthogReactNativeSessionReplay.isEnabled();
|
|
45
49
|
}
|
|
@@ -56,13 +60,15 @@ export interface PostHogReactNativeSessionReplayModule {
|
|
|
56
60
|
sessionId: string,
|
|
57
61
|
sdkOptions: { [key: string]: any }, // options from SDK such as apiKey
|
|
58
62
|
sdkReplayConfig: { [key: string]: any }, // config from SDK
|
|
59
|
-
decideReplayConfig: { [key: string]: any } //
|
|
63
|
+
decideReplayConfig: { [key: string]: any } // replay runtime config
|
|
60
64
|
) => Promise<void>;
|
|
61
65
|
|
|
62
66
|
startSession: (sessionId: string) => Promise<void>;
|
|
63
67
|
|
|
64
68
|
endSession: () => Promise<void>;
|
|
65
69
|
|
|
70
|
+
flush: () => Promise<void>;
|
|
71
|
+
|
|
66
72
|
isEnabled: () => Promise<boolean>;
|
|
67
73
|
|
|
68
74
|
identify: (distinctId: string, anonymousId: string) => Promise<void>;
|
|
@@ -72,6 +78,7 @@ const PostHogReactNativeSessionReplay: PostHogReactNativeSessionReplayModule = {
|
|
|
72
78
|
start,
|
|
73
79
|
startSession,
|
|
74
80
|
endSession,
|
|
81
|
+
flush,
|
|
75
82
|
isEnabled,
|
|
76
83
|
identify,
|
|
77
84
|
};
|
package/src/types.ts
CHANGED
|
@@ -18,15 +18,27 @@ import type {
|
|
|
18
18
|
UnifiedBatchPayload
|
|
19
19
|
} from "@plushanalytics/javascript";
|
|
20
20
|
|
|
21
|
-
export type
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
export type SessionReplayMaskingConfig = {
|
|
22
|
+
textInputs?: boolean;
|
|
23
|
+
images?: boolean;
|
|
24
|
+
sandboxedViews?: boolean;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export type SessionReplayConfig = {
|
|
28
|
+
enabled?: boolean;
|
|
29
|
+
masking?: SessionReplayMaskingConfig;
|
|
25
30
|
captureLog?: boolean;
|
|
26
31
|
captureNetworkTelemetry?: boolean;
|
|
27
32
|
throttleDelayMs?: number;
|
|
28
33
|
};
|
|
29
34
|
|
|
35
|
+
export type MobileReplayConfig = SessionReplayConfig & {
|
|
36
|
+
// Legacy flat options are still supported for backward compatibility.
|
|
37
|
+
maskAllTextInputs?: boolean;
|
|
38
|
+
maskAllImages?: boolean;
|
|
39
|
+
maskAllSandboxedViews?: boolean;
|
|
40
|
+
};
|
|
41
|
+
|
|
30
42
|
export type SessionRecordingOptions = CoreSessionRecordingOptions & {
|
|
31
43
|
// Used by the bundled replay adapter (optional, replay still works without these when you pass a custom recorder).
|
|
32
44
|
replayHost?: string;
|
|
@@ -34,7 +46,9 @@ export type SessionRecordingOptions = CoreSessionRecordingOptions & {
|
|
|
34
46
|
replayConfig?: MobileReplayConfig;
|
|
35
47
|
};
|
|
36
48
|
|
|
37
|
-
export type PlushAnalyticsConfig = CoreConfig
|
|
49
|
+
export type PlushAnalyticsConfig = CoreConfig & {
|
|
50
|
+
sessionReplayConfig?: SessionReplayConfig;
|
|
51
|
+
};
|
|
38
52
|
|
|
39
53
|
export type {
|
|
40
54
|
EventEnvelope,
|