@luciq/react-native 19.0.0-286-SNAPSHOT → 19.1.0

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.
Files changed (39) hide show
  1. package/CHANGELOG.md +13 -1
  2. package/android/native.gradle +1 -1
  3. package/android/src/main/java/ai/luciq/reactlibrary/ArgsRegistry.java +14 -0
  4. package/android/src/main/java/ai/luciq/reactlibrary/RNLuciqSessionReplayModule.java +51 -0
  5. package/bin/index.js +0 -0
  6. package/dist/modules/APM.js +0 -12
  7. package/dist/modules/BugReporting.js +0 -38
  8. package/dist/modules/CrashReporting.js +0 -3
  9. package/dist/modules/FeatureRequests.js +0 -6
  10. package/dist/modules/Luciq.js +0 -58
  11. package/dist/modules/NetworkLogger.js +3 -21
  12. package/dist/modules/Replies.js +0 -15
  13. package/dist/modules/SessionReplay.d.ts +54 -0
  14. package/dist/modules/SessionReplay.js +59 -6
  15. package/dist/modules/Surveys.js +0 -10
  16. package/dist/native/NativeConstants.d.ts +11 -1
  17. package/dist/native/NativeSessionReplay.d.ts +3 -0
  18. package/dist/utils/Enums.d.ts +37 -0
  19. package/dist/utils/Enums.js +39 -0
  20. package/ios/RNLuciq/ArgsRegistry.h +2 -0
  21. package/ios/RNLuciq/ArgsRegistry.m +18 -0
  22. package/ios/RNLuciq/LuciqSessionReplayBridge.h +6 -0
  23. package/ios/RNLuciq/LuciqSessionReplayBridge.m +11 -0
  24. package/ios/RNLuciq/RCTConvert+LuciqEnums.m +14 -0
  25. package/ios/native.rb +1 -1
  26. package/package.json +2 -1
  27. package/plugin/build/index.js +42078 -0
  28. package/src/modules/APM.ts +0 -12
  29. package/src/modules/BugReporting.ts +0 -38
  30. package/src/modules/CrashReporting.ts +0 -3
  31. package/src/modules/FeatureRequests.ts +0 -6
  32. package/src/modules/Luciq.ts +0 -58
  33. package/src/modules/NetworkLogger.ts +3 -21
  34. package/src/modules/Replies.ts +0 -15
  35. package/src/modules/SessionReplay.ts +63 -6
  36. package/src/modules/Surveys.ts +0 -10
  37. package/src/native/NativeConstants.ts +15 -1
  38. package/src/native/NativeSessionReplay.ts +3 -0
  39. package/src/utils/Enums.ts +39 -0
@@ -1,5 +1,6 @@
1
1
  import { NativeSessionReplay, NativeEvents, emitter } from '../native/NativeSessionReplay';
2
2
  import type { SessionMetadata } from '../models/SessionMetadata';
3
+ import type { CapturingMode, ScreenshotQuality } from '../utils/Enums';
3
4
  /**
4
5
  * Enables or disables Session Replay for your Luciq integration.
5
6
  *
@@ -13,7 +14,6 @@ import type { SessionMetadata } from '../models/SessionMetadata';
13
14
  * ```
14
15
  */
15
16
  export const setEnabled = (isEnabled: boolean) => {
16
- console.log('[LCQ-RN] SessionReplay.setEnabled called', { isEnabled });
17
17
  NativeSessionReplay.setEnabled(isEnabled);
18
18
  };
19
19
 
@@ -30,7 +30,6 @@ export const setEnabled = (isEnabled: boolean) => {
30
30
  * ```
31
31
  */
32
32
  export const setNetworkLogsEnabled = (isEnabled: boolean) => {
33
- console.log('[LCQ-RN] SessionReplay.setNetworkLogsEnabled called', { isEnabled });
34
33
  NativeSessionReplay.setNetworkLogsEnabled(isEnabled);
35
34
  };
36
35
 
@@ -47,7 +46,6 @@ export const setNetworkLogsEnabled = (isEnabled: boolean) => {
47
46
  * ```
48
47
  */
49
48
  export const setLuciqLogsEnabled = (isEnabled: boolean) => {
50
- console.log('[LCQ-RN] SessionReplay.setLuciqLogsEnabled called', { isEnabled });
51
49
  NativeSessionReplay.setLuciqLogsEnabled(isEnabled);
52
50
  };
53
51
 
@@ -64,7 +62,6 @@ export const setLuciqLogsEnabled = (isEnabled: boolean) => {
64
62
  * ```
65
63
  */
66
64
  export const setUserStepsEnabled = (isEnabled: boolean) => {
67
- console.log('[LCQ-RN] SessionReplay.setUserStepsEnabled called', { isEnabled });
68
65
  NativeSessionReplay.setUserStepsEnabled(isEnabled);
69
66
  };
70
67
 
@@ -77,7 +74,6 @@ export const setUserStepsEnabled = (isEnabled: boolean) => {
77
74
  * ```
78
75
  */
79
76
  export const getSessionReplayLink = async (): Promise<string> => {
80
- console.log('[LCQ-RN] SessionReplay.getSessionReplayLink called');
81
77
  return NativeSessionReplay.getSessionReplayLink();
82
78
  };
83
79
 
@@ -99,7 +95,6 @@ export const getSessionReplayLink = async (): Promise<string> => {
99
95
  export const setSyncCallback = async (
100
96
  handler: (payload: SessionMetadata) => boolean,
101
97
  ): Promise<void> => {
102
- console.log('[LCQ-RN] SessionReplay.setSyncCallback called');
103
98
  emitter.addListener(NativeEvents.SESSION_REPLAY_ON_SYNC_CALLBACK_INVOCATION, (payload) => {
104
99
  const result = handler(payload);
105
100
  const shouldSync = Boolean(result);
@@ -115,3 +110,65 @@ export const setSyncCallback = async (
115
110
 
116
111
  return NativeSessionReplay.setSyncCallback();
117
112
  };
113
+
114
+ /**
115
+ * Sets the capturing mode for Session Replay screenshots.
116
+ *
117
+ * - `navigation`: Captures screenshots only when users navigate between screens (default).
118
+ * - `interactions`: Captures screenshots on screen navigation and user interactions.
119
+ * - `frequency`: Captures screenshots at a fixed time interval for video-like playback.
120
+ *
121
+ * Note: Should be called before SDK initialization for best results.
122
+ *
123
+ * @param mode The capturing mode to use.
124
+ *
125
+ * @example
126
+ * ```ts
127
+ * import { CapturingMode } from '@luciq/react-native';
128
+ *
129
+ * SessionReplay.setCapturingMode(CapturingMode.frequency);
130
+ * ```
131
+ */
132
+ export const setCapturingMode = (mode: CapturingMode) => {
133
+ NativeSessionReplay.setCapturingMode(mode);
134
+ };
135
+
136
+ /**
137
+ * Sets the visual quality of captured Session Replay screenshots.
138
+ *
139
+ * - `high`: 50% WebP compression - Best visual quality (~62 screenshots per session).
140
+ * - `normal`: 25% WebP compression - Balanced quality and storage (~104 screenshots per session, default).
141
+ * - `greyscale`: Grayscale + 25% WebP compression - Maximum storage efficiency (~130 screenshots per session).
142
+ *
143
+ * @param quality The screenshot quality profile to use.
144
+ *
145
+ * @example
146
+ * ```ts
147
+ * import { ScreenshotQuality } from '@luciq/react-native';
148
+ *
149
+ * SessionReplay.setScreenshotQuality(ScreenshotQuality.high);
150
+ * ```
151
+ */
152
+ export const setScreenshotQuality = (quality: ScreenshotQuality) => {
153
+ NativeSessionReplay.setScreenshotQuality(quality);
154
+ };
155
+
156
+ /**
157
+ * Sets the capture interval for Session Replay when using frequency capturing mode.
158
+ *
159
+ * This determines how often screenshots are captured when `CapturingMode.frequency` is set.
160
+ *
161
+ * @param intervalMs Time between captures in milliseconds. Minimum: 500ms, Default: 1000ms.
162
+ *
163
+ * @example
164
+ * ```ts
165
+ * // Capture every 500ms (2 FPS)
166
+ * SessionReplay.setScreenshotCaptureInterval(500);
167
+ *
168
+ * // Capture every 2 seconds
169
+ * SessionReplay.setScreenshotCaptureInterval(2000);
170
+ * ```
171
+ */
172
+ export const setScreenshotCaptureInterval = (intervalMs: number) => {
173
+ NativeSessionReplay.setScreenshotCaptureInterval(intervalMs);
174
+ };
@@ -15,7 +15,6 @@ export type { Survey };
15
15
  * @param isEnabled A boolean to set whether Luciq Surveys is enabled or disabled.
16
16
  */
17
17
  export const setEnabled = (isEnabled: boolean) => {
18
- console.log('[LCQ-RN] Surveys.setEnabled called', { isEnabled });
19
18
  NativeSurveys.setEnabled(isEnabled);
20
19
  };
21
20
 
@@ -26,7 +25,6 @@ export const setEnabled = (isEnabled: boolean) => {
26
25
  * in the current session.
27
26
  */
28
27
  export const showSurveyIfAvailable = () => {
29
- console.log('[LCQ-RN] Surveys.showSurveyIfAvailable called');
30
28
  NativeSurveys.showSurveysIfAvailable();
31
29
  };
32
30
 
@@ -34,7 +32,6 @@ export const showSurveyIfAvailable = () => {
34
32
  * Returns an array containing the available surveys.
35
33
  */
36
34
  export const getAvailableSurveys = async (): Promise<Survey[] | null> => {
37
- console.log('[LCQ-RN] Surveys.getAvailableSurveys called');
38
35
  const surveys = await NativeSurveys.getAvailableSurveys();
39
36
 
40
37
  return surveys;
@@ -46,7 +43,6 @@ export const getAvailableSurveys = async (): Promise<Survey[] | null> => {
46
43
  * surveys auto showing are enabled or not.
47
44
  */
48
45
  export const setAutoShowingEnabled = (autoShowingSurveysEnabled: boolean) => {
49
- console.log('[LCQ-RN] Surveys.setAutoShowingEnabled called', { autoShowingSurveysEnabled });
50
46
  NativeSurveys.setAutoShowingEnabled(autoShowingSurveysEnabled);
51
47
  };
52
48
 
@@ -58,7 +54,6 @@ export const setAutoShowingEnabled = (autoShowingSurveysEnabled: boolean) => {
58
54
  * presenting the survey's UI.
59
55
  */
60
56
  export const setOnShowHandler = (onShowHandler: () => void) => {
61
- console.log('[LCQ-RN] Surveys.setOnShowHandler called');
62
57
  emitter.addListener(NativeEvents.WILL_SHOW_SURVEY_HANDLER, onShowHandler);
63
58
  NativeSurveys.setOnShowHandler(onShowHandler);
64
59
  };
@@ -71,7 +66,6 @@ export const setOnShowHandler = (onShowHandler: () => void) => {
71
66
  * the survey's UI is dismissed.
72
67
  */
73
68
  export const setOnDismissHandler = (onDismissHandler: () => void) => {
74
- console.log('[LCQ-RN] Surveys.setOnDismissHandler called');
75
69
  emitter.addListener(NativeEvents.DID_DISMISS_SURVEY_HANDLER, onDismissHandler);
76
70
  NativeSurveys.setOnDismissHandler(onDismissHandler);
77
71
  };
@@ -84,7 +78,6 @@ export const setOnDismissHandler = (onDismissHandler: () => void) => {
84
78
  *
85
79
  */
86
80
  export const showSurvey = (surveyToken: string) => {
87
- console.log('[LCQ-RN] Surveys.showSurvey called', { surveyToken });
88
81
  NativeSurveys.showSurvey(surveyToken);
89
82
  };
90
83
 
@@ -96,7 +89,6 @@ export const showSurvey = (surveyToken: string) => {
96
89
  *
97
90
  */
98
91
  export const hasRespondedToSurvey = async (surveyToken: string): Promise<boolean | null> => {
99
- console.log('[LCQ-RN] Surveys.hasRespondedToSurvey called', { surveyToken });
100
92
  const hasResponded = await NativeSurveys.hasRespondedToSurvey(surveyToken);
101
93
 
102
94
  return hasResponded;
@@ -109,7 +101,6 @@ export const hasRespondedToSurvey = async (surveyToken: string): Promise<boolean
109
101
  * welcome screen should show.
110
102
  */
111
103
  export const setShouldShowWelcomeScreen = (shouldShowWelcomeScreen: boolean) => {
112
- console.log('[LCQ-RN] Surveys.setShouldShowWelcomeScreen called', { shouldShowWelcomeScreen });
113
104
  NativeSurveys.setShouldShowWelcomeScreen(shouldShowWelcomeScreen);
114
105
  };
115
106
 
@@ -121,7 +112,6 @@ export const setShouldShowWelcomeScreen = (shouldShowWelcomeScreen: boolean) =>
121
112
  */
122
113
 
123
114
  export const setAppStoreURL = (appStoreURL: string) => {
124
- console.log('[LCQ-RN] Surveys.setAppStoreURL called', { appStoreURL });
125
115
  if (Platform.OS === 'ios') {
126
116
  NativeSurveys.setAppStoreURL(appStoreURL);
127
117
  }
@@ -16,7 +16,9 @@ export type NativeConstants = NativeSdkDebugLogsLevel &
16
16
  NativeLaunchType &
17
17
  NativeOverAirUpdateServices &
18
18
  NativeAutoMaskingType &
19
- NativeUserConsentActionType;
19
+ NativeUserConsentActionType &
20
+ NativeCapturingMode &
21
+ NativeScreenshotQuality;
20
22
 
21
23
  interface NativeSdkDebugLogsLevel {
22
24
  sdkDebugLogsLevelVerbose: any;
@@ -213,3 +215,15 @@ interface NativeAutoMaskingType {
213
215
  media: any;
214
216
  none: any;
215
217
  }
218
+
219
+ interface NativeCapturingMode {
220
+ capturingModeNavigation: any;
221
+ capturingModeInteractions: any;
222
+ capturingModeFrequency: any;
223
+ }
224
+
225
+ interface NativeScreenshotQuality {
226
+ screenshotQualityHigh: any;
227
+ screenshotQualityNormal: any;
228
+ screenshotQualityGreyscale: any;
229
+ }
@@ -11,6 +11,9 @@ export interface SessionReplayNativeModule extends NativeModule {
11
11
  getSessionReplayLink(): Promise<string>;
12
12
  setSyncCallback(): Promise<void>;
13
13
  evaluateSync(shouldSync: boolean): void;
14
+ setCapturingMode(mode: any): void;
15
+ setScreenshotQuality(quality: any): void;
16
+ setScreenshotCaptureInterval(intervalMs: number): void;
14
17
  }
15
18
 
16
19
  export const NativeSessionReplay = NativeModules.LCQSessionReplay;
@@ -264,3 +264,42 @@ export enum AutoMaskingType {
264
264
  media = constants.media,
265
265
  none = constants.none,
266
266
  }
267
+
268
+ /**
269
+ * The capturing mode for Session Replay screenshots.
270
+ */
271
+ export enum CapturingMode {
272
+ /**
273
+ * Captures screenshots only when users navigate between screens.
274
+ * This is the default behavior and provides the lowest overhead.
275
+ */
276
+ navigation = constants.capturingModeNavigation,
277
+ /**
278
+ * Captures screenshots on screen navigation and user interactions.
279
+ * Includes debouncing to prevent excessive captures.
280
+ */
281
+ interactions = constants.capturingModeInteractions,
282
+ /**
283
+ * Captures screenshots at a fixed time interval for true video-like playback.
284
+ * Also captures on screen navigation.
285
+ */
286
+ frequency = constants.capturingModeFrequency,
287
+ }
288
+
289
+ /**
290
+ * The quality profile for Session Replay screenshots.
291
+ */
292
+ export enum ScreenshotQuality {
293
+ /**
294
+ * 50% WebP compression - Best visual quality.
295
+ */
296
+ high = constants.screenshotQualityHigh,
297
+ /**
298
+ * 25% WebP compression - Balanced quality and storage (default).
299
+ */
300
+ normal = constants.screenshotQualityNormal,
301
+ /**
302
+ * Grayscale + 25% WebP compression - Maximum storage efficiency.
303
+ */
304
+ greyscale = constants.screenshotQualityGreyscale,
305
+ }