@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
@@ -12,7 +12,6 @@ import { NativeSessionReplay, NativeEvents, emitter } from '../native/NativeSess
12
12
  * ```
13
13
  */
14
14
  export const setEnabled = (isEnabled) => {
15
- console.log('[LCQ-RN] SessionReplay.setEnabled called', { isEnabled });
16
15
  NativeSessionReplay.setEnabled(isEnabled);
17
16
  };
18
17
  /**
@@ -28,7 +27,6 @@ export const setEnabled = (isEnabled) => {
28
27
  * ```
29
28
  */
30
29
  export const setNetworkLogsEnabled = (isEnabled) => {
31
- console.log('[LCQ-RN] SessionReplay.setNetworkLogsEnabled called', { isEnabled });
32
30
  NativeSessionReplay.setNetworkLogsEnabled(isEnabled);
33
31
  };
34
32
  /**
@@ -44,7 +42,6 @@ export const setNetworkLogsEnabled = (isEnabled) => {
44
42
  * ```
45
43
  */
46
44
  export const setLuciqLogsEnabled = (isEnabled) => {
47
- console.log('[LCQ-RN] SessionReplay.setLuciqLogsEnabled called', { isEnabled });
48
45
  NativeSessionReplay.setLuciqLogsEnabled(isEnabled);
49
46
  };
50
47
  /**
@@ -60,7 +57,6 @@ export const setLuciqLogsEnabled = (isEnabled) => {
60
57
  * ```
61
58
  */
62
59
  export const setUserStepsEnabled = (isEnabled) => {
63
- console.log('[LCQ-RN] SessionReplay.setUserStepsEnabled called', { isEnabled });
64
60
  NativeSessionReplay.setUserStepsEnabled(isEnabled);
65
61
  };
66
62
  /**
@@ -72,7 +68,6 @@ export const setUserStepsEnabled = (isEnabled) => {
72
68
  * ```
73
69
  */
74
70
  export const getSessionReplayLink = async () => {
75
- console.log('[LCQ-RN] SessionReplay.getSessionReplayLink called');
76
71
  return NativeSessionReplay.getSessionReplayLink();
77
72
  };
78
73
  /**
@@ -91,7 +86,6 @@ export const getSessionReplayLink = async () => {
91
86
  * ```
92
87
  */
93
88
  export const setSyncCallback = async (handler) => {
94
- console.log('[LCQ-RN] SessionReplay.setSyncCallback called');
95
89
  emitter.addListener(NativeEvents.SESSION_REPLAY_ON_SYNC_CALLBACK_INVOCATION, (payload) => {
96
90
  const result = handler(payload);
97
91
  const shouldSync = Boolean(result);
@@ -102,3 +96,62 @@ export const setSyncCallback = async (handler) => {
102
96
  });
103
97
  return NativeSessionReplay.setSyncCallback();
104
98
  };
99
+ /**
100
+ * Sets the capturing mode for Session Replay screenshots.
101
+ *
102
+ * - `navigation`: Captures screenshots only when users navigate between screens (default).
103
+ * - `interactions`: Captures screenshots on screen navigation and user interactions.
104
+ * - `frequency`: Captures screenshots at a fixed time interval for video-like playback.
105
+ *
106
+ * Note: Should be called before SDK initialization for best results.
107
+ *
108
+ * @param mode The capturing mode to use.
109
+ *
110
+ * @example
111
+ * ```ts
112
+ * import { CapturingMode } from '@luciq/react-native';
113
+ *
114
+ * SessionReplay.setCapturingMode(CapturingMode.frequency);
115
+ * ```
116
+ */
117
+ export const setCapturingMode = (mode) => {
118
+ NativeSessionReplay.setCapturingMode(mode);
119
+ };
120
+ /**
121
+ * Sets the visual quality of captured Session Replay screenshots.
122
+ *
123
+ * - `high`: 50% WebP compression - Best visual quality (~62 screenshots per session).
124
+ * - `normal`: 25% WebP compression - Balanced quality and storage (~104 screenshots per session, default).
125
+ * - `greyscale`: Grayscale + 25% WebP compression - Maximum storage efficiency (~130 screenshots per session).
126
+ *
127
+ * @param quality The screenshot quality profile to use.
128
+ *
129
+ * @example
130
+ * ```ts
131
+ * import { ScreenshotQuality } from '@luciq/react-native';
132
+ *
133
+ * SessionReplay.setScreenshotQuality(ScreenshotQuality.high);
134
+ * ```
135
+ */
136
+ export const setScreenshotQuality = (quality) => {
137
+ NativeSessionReplay.setScreenshotQuality(quality);
138
+ };
139
+ /**
140
+ * Sets the capture interval for Session Replay when using frequency capturing mode.
141
+ *
142
+ * This determines how often screenshots are captured when `CapturingMode.frequency` is set.
143
+ *
144
+ * @param intervalMs Time between captures in milliseconds. Minimum: 500ms, Default: 1000ms.
145
+ *
146
+ * @example
147
+ * ```ts
148
+ * // Capture every 500ms (2 FPS)
149
+ * SessionReplay.setScreenshotCaptureInterval(500);
150
+ *
151
+ * // Capture every 2 seconds
152
+ * SessionReplay.setScreenshotCaptureInterval(2000);
153
+ * ```
154
+ */
155
+ export const setScreenshotCaptureInterval = (intervalMs) => {
156
+ NativeSessionReplay.setScreenshotCaptureInterval(intervalMs);
157
+ };
@@ -10,7 +10,6 @@ import { NativeEvents, NativeSurveys, emitter } from '../native/NativeSurveys';
10
10
  * @param isEnabled A boolean to set whether Luciq Surveys is enabled or disabled.
11
11
  */
12
12
  export const setEnabled = (isEnabled) => {
13
- console.log('[LCQ-RN] Surveys.setEnabled called', { isEnabled });
14
13
  NativeSurveys.setEnabled(isEnabled);
15
14
  };
16
15
  /**
@@ -20,14 +19,12 @@ export const setEnabled = (isEnabled) => {
20
19
  * in the current session.
21
20
  */
22
21
  export const showSurveyIfAvailable = () => {
23
- console.log('[LCQ-RN] Surveys.showSurveyIfAvailable called');
24
22
  NativeSurveys.showSurveysIfAvailable();
25
23
  };
26
24
  /**
27
25
  * Returns an array containing the available surveys.
28
26
  */
29
27
  export const getAvailableSurveys = async () => {
30
- console.log('[LCQ-RN] Surveys.getAvailableSurveys called');
31
28
  const surveys = await NativeSurveys.getAvailableSurveys();
32
29
  return surveys;
33
30
  };
@@ -37,7 +34,6 @@ export const getAvailableSurveys = async () => {
37
34
  * surveys auto showing are enabled or not.
38
35
  */
39
36
  export const setAutoShowingEnabled = (autoShowingSurveysEnabled) => {
40
- console.log('[LCQ-RN] Surveys.setAutoShowingEnabled called', { autoShowingSurveysEnabled });
41
37
  NativeSurveys.setAutoShowingEnabled(autoShowingSurveysEnabled);
42
38
  };
43
39
  /**
@@ -48,7 +44,6 @@ export const setAutoShowingEnabled = (autoShowingSurveysEnabled) => {
48
44
  * presenting the survey's UI.
49
45
  */
50
46
  export const setOnShowHandler = (onShowHandler) => {
51
- console.log('[LCQ-RN] Surveys.setOnShowHandler called');
52
47
  emitter.addListener(NativeEvents.WILL_SHOW_SURVEY_HANDLER, onShowHandler);
53
48
  NativeSurveys.setOnShowHandler(onShowHandler);
54
49
  };
@@ -60,7 +55,6 @@ export const setOnShowHandler = (onShowHandler) => {
60
55
  * the survey's UI is dismissed.
61
56
  */
62
57
  export const setOnDismissHandler = (onDismissHandler) => {
63
- console.log('[LCQ-RN] Surveys.setOnDismissHandler called');
64
58
  emitter.addListener(NativeEvents.DID_DISMISS_SURVEY_HANDLER, onDismissHandler);
65
59
  NativeSurveys.setOnDismissHandler(onDismissHandler);
66
60
  };
@@ -72,7 +66,6 @@ export const setOnDismissHandler = (onDismissHandler) => {
72
66
  *
73
67
  */
74
68
  export const showSurvey = (surveyToken) => {
75
- console.log('[LCQ-RN] Surveys.showSurvey called', { surveyToken });
76
69
  NativeSurveys.showSurvey(surveyToken);
77
70
  };
78
71
  /**
@@ -83,7 +76,6 @@ export const showSurvey = (surveyToken) => {
83
76
  *
84
77
  */
85
78
  export const hasRespondedToSurvey = async (surveyToken) => {
86
- console.log('[LCQ-RN] Surveys.hasRespondedToSurvey called', { surveyToken });
87
79
  const hasResponded = await NativeSurveys.hasRespondedToSurvey(surveyToken);
88
80
  return hasResponded;
89
81
  };
@@ -94,7 +86,6 @@ export const hasRespondedToSurvey = async (surveyToken) => {
94
86
  * welcome screen should show.
95
87
  */
96
88
  export const setShouldShowWelcomeScreen = (shouldShowWelcomeScreen) => {
97
- console.log('[LCQ-RN] Surveys.setShouldShowWelcomeScreen called', { shouldShowWelcomeScreen });
98
89
  NativeSurveys.setShouldShowWelcomeScreen(shouldShowWelcomeScreen);
99
90
  };
100
91
  /**
@@ -104,7 +95,6 @@ export const setShouldShowWelcomeScreen = (shouldShowWelcomeScreen) => {
104
95
  * @param appStoreURL A String url for the published iOS app on AppStore
105
96
  */
106
97
  export const setAppStoreURL = (appStoreURL) => {
107
- console.log('[LCQ-RN] Surveys.setAppStoreURL called', { appStoreURL });
108
98
  if (Platform.OS === 'ios') {
109
99
  NativeSurveys.setAppStoreURL(appStoreURL);
110
100
  }
@@ -1,4 +1,4 @@
1
- export type NativeConstants = NativeSdkDebugLogsLevel & NativeInvocationEvent & NativeInvocationOption & NativeColorTheme & NativeFloatingButtonPosition & NativeRecordingButtonPosition & NativeWelcomeMessageMode & NativeReportType & NativeDismissType & NativeActionType & NativeExtendedBugReportMode & NativeReproStepsMode & NativeLocale & NativeNonFatalErrorLevel & NativeStringKey & NativeLaunchType & NativeOverAirUpdateServices & NativeAutoMaskingType & NativeUserConsentActionType;
1
+ export type NativeConstants = NativeSdkDebugLogsLevel & NativeInvocationEvent & NativeInvocationOption & NativeColorTheme & NativeFloatingButtonPosition & NativeRecordingButtonPosition & NativeWelcomeMessageMode & NativeReportType & NativeDismissType & NativeActionType & NativeExtendedBugReportMode & NativeReproStepsMode & NativeLocale & NativeNonFatalErrorLevel & NativeStringKey & NativeLaunchType & NativeOverAirUpdateServices & NativeAutoMaskingType & NativeUserConsentActionType & NativeCapturingMode & NativeScreenshotQuality;
2
2
  interface NativeSdkDebugLogsLevel {
3
3
  sdkDebugLogsLevelVerbose: any;
4
4
  sdkDebugLogsLevelDebug: any;
@@ -179,4 +179,14 @@ interface NativeAutoMaskingType {
179
179
  media: any;
180
180
  none: any;
181
181
  }
182
+ interface NativeCapturingMode {
183
+ capturingModeNavigation: any;
184
+ capturingModeInteractions: any;
185
+ capturingModeFrequency: any;
186
+ }
187
+ interface NativeScreenshotQuality {
188
+ screenshotQualityHigh: any;
189
+ screenshotQualityNormal: any;
190
+ screenshotQualityGreyscale: any;
191
+ }
182
192
  export {};
@@ -8,6 +8,9 @@ export interface SessionReplayNativeModule extends NativeModule {
8
8
  getSessionReplayLink(): Promise<string>;
9
9
  setSyncCallback(): Promise<void>;
10
10
  evaluateSync(shouldSync: boolean): void;
11
+ setCapturingMode(mode: any): void;
12
+ setScreenshotQuality(quality: any): void;
13
+ setScreenshotCaptureInterval(intervalMs: number): void;
11
14
  }
12
15
  export declare const NativeSessionReplay: SessionReplayNativeModule;
13
16
  export declare enum NativeEvents {
@@ -242,3 +242,40 @@ export declare enum AutoMaskingType {
242
242
  media,
243
243
  none
244
244
  }
245
+ /**
246
+ * The capturing mode for Session Replay screenshots.
247
+ */
248
+ export declare enum CapturingMode {
249
+ /**
250
+ * Captures screenshots only when users navigate between screens.
251
+ * This is the default behavior and provides the lowest overhead.
252
+ */
253
+ navigation,
254
+ /**
255
+ * Captures screenshots on screen navigation and user interactions.
256
+ * Includes debouncing to prevent excessive captures.
257
+ */
258
+ interactions,
259
+ /**
260
+ * Captures screenshots at a fixed time interval for true video-like playback.
261
+ * Also captures on screen navigation.
262
+ */
263
+ frequency
264
+ }
265
+ /**
266
+ * The quality profile for Session Replay screenshots.
267
+ */
268
+ export declare enum ScreenshotQuality {
269
+ /**
270
+ * 50% WebP compression - Best visual quality.
271
+ */
272
+ high,
273
+ /**
274
+ * 25% WebP compression - Balanced quality and storage (default).
275
+ */
276
+ normal,
277
+ /**
278
+ * Grayscale + 25% WebP compression - Maximum storage efficiency.
279
+ */
280
+ greyscale
281
+ }
@@ -264,3 +264,42 @@ export var AutoMaskingType;
264
264
  AutoMaskingType[AutoMaskingType["media"] = constants.media] = "media";
265
265
  AutoMaskingType[AutoMaskingType["none"] = constants.none] = "none";
266
266
  })(AutoMaskingType || (AutoMaskingType = {}));
267
+ /**
268
+ * The capturing mode for Session Replay screenshots.
269
+ */
270
+ export var CapturingMode;
271
+ (function (CapturingMode) {
272
+ /**
273
+ * Captures screenshots only when users navigate between screens.
274
+ * This is the default behavior and provides the lowest overhead.
275
+ */
276
+ CapturingMode[CapturingMode["navigation"] = constants.capturingModeNavigation] = "navigation";
277
+ /**
278
+ * Captures screenshots on screen navigation and user interactions.
279
+ * Includes debouncing to prevent excessive captures.
280
+ */
281
+ CapturingMode[CapturingMode["interactions"] = constants.capturingModeInteractions] = "interactions";
282
+ /**
283
+ * Captures screenshots at a fixed time interval for true video-like playback.
284
+ * Also captures on screen navigation.
285
+ */
286
+ CapturingMode[CapturingMode["frequency"] = constants.capturingModeFrequency] = "frequency";
287
+ })(CapturingMode || (CapturingMode = {}));
288
+ /**
289
+ * The quality profile for Session Replay screenshots.
290
+ */
291
+ export var ScreenshotQuality;
292
+ (function (ScreenshotQuality) {
293
+ /**
294
+ * 50% WebP compression - Best visual quality.
295
+ */
296
+ ScreenshotQuality[ScreenshotQuality["high"] = constants.screenshotQualityHigh] = "high";
297
+ /**
298
+ * 25% WebP compression - Balanced quality and storage (default).
299
+ */
300
+ ScreenshotQuality[ScreenshotQuality["normal"] = constants.screenshotQualityNormal] = "normal";
301
+ /**
302
+ * Grayscale + 25% WebP compression - Maximum storage efficiency.
303
+ */
304
+ ScreenshotQuality[ScreenshotQuality["greyscale"] = constants.screenshotQualityGreyscale] = "greyscale";
305
+ })(ScreenshotQuality || (ScreenshotQuality = {}));
@@ -28,5 +28,7 @@ typedef NSDictionary<NSString*, NSNumber*> ArgsDictionary;
28
28
 
29
29
  + (NSDictionary<NSString *, NSString *> *) placeholders;
30
30
  + (ArgsDictionary *)autoMaskingTypes;
31
+ + (ArgsDictionary *)capturingModes;
32
+ + (ArgsDictionary *)screenshotQualities;
31
33
 
32
34
  @end
@@ -25,6 +25,8 @@
25
25
 
26
26
  [all addEntriesFromDictionary:ArgsRegistry.autoMaskingTypes];
27
27
  [all addEntriesFromDictionary:ArgsRegistry.userConsentActionTypes];
28
+ [all addEntriesFromDictionary:ArgsRegistry.capturingModes];
29
+ [all addEntriesFromDictionary:ArgsRegistry.screenshotQualities];
28
30
 
29
31
  return all;
30
32
  }
@@ -273,4 +275,20 @@
273
275
  @"none" : @(LCQAutoMaskScreenshotOptionMaskNothing)
274
276
  };
275
277
  }
278
+
279
+ + (ArgsDictionary *)capturingModes {
280
+ return @{
281
+ @"capturingModeNavigation" : @(LCQScreenshotCapturingModeNavigation),
282
+ @"capturingModeInteractions" : @(LCQScreenshotCapturingModeInteraction),
283
+ @"capturingModeFrequency" : @(LCQScreenshotCapturingModeFrequency)
284
+ };
285
+ }
286
+
287
+ + (ArgsDictionary *)screenshotQualities {
288
+ return @{
289
+ @"screenshotQualityHigh" : @(LCQScreenshotQualityModeHigh),
290
+ @"screenshotQualityNormal" : @(LCQScreenshotQualityModeNormal),
291
+ @"screenshotQualityGreyscale" : @(LCQScreenshotQualityModeGreyScale)
292
+ };
293
+ }
276
294
  @end
@@ -25,6 +25,12 @@
25
25
 
26
26
  - (void)evaluateSync:(BOOL)result;
27
27
 
28
+ - (void)setCapturingMode:(LCQScreenshotCapturingMode)mode;
29
+
30
+ - (void)setScreenshotQuality:(LCQScreenshotQualityMode)quality;
31
+
32
+ - (void)setScreenshotCaptureInterval:(NSInteger)intervalMs;
33
+
28
34
  @property (atomic, copy) SessionEvaluationCompletion sessionEvaluationCompletion;
29
35
 
30
36
  @end
@@ -95,6 +95,17 @@ RCT_EXPORT_METHOD(evaluateSync:(BOOL)result) {
95
95
  }
96
96
  }
97
97
 
98
+ RCT_EXPORT_METHOD(setCapturingMode:(LCQScreenshotCapturingMode)mode) {
99
+ LCQSessionReplay.screenshotCapturingMode = mode;
100
+ }
101
+
102
+ RCT_EXPORT_METHOD(setScreenshotQuality:(LCQScreenshotQualityMode)quality) {
103
+ LCQSessionReplay.screenshotQualityMode = quality;
104
+ }
105
+
106
+ RCT_EXPORT_METHOD(setScreenshotCaptureInterval:(NSInteger)intervalMs) {
107
+ LCQSessionReplay.screenshotCaptureInterval = intervalMs;
108
+ }
98
109
 
99
110
  @synthesize description;
100
111
 
@@ -123,5 +123,19 @@ RCT_ENUM_CONVERTER(
123
123
  integerValue
124
124
  );
125
125
 
126
+ RCT_ENUM_CONVERTER(
127
+ LCQScreenshotCapturingMode,
128
+ ArgsRegistry.capturingModes,
129
+ LCQScreenshotCapturingModeNavigation,
130
+ integerValue
131
+ );
132
+
133
+ RCT_ENUM_CONVERTER(
134
+ LCQScreenshotQualityMode,
135
+ ArgsRegistry.screenshotQualities,
136
+ LCQScreenshotQualityModeNormal,
137
+ integerValue
138
+ );
139
+
126
140
  @end
127
141
 
package/ios/native.rb CHANGED
@@ -1,4 +1,4 @@
1
- $luciq= { :version => '19.2.0' }
1
+ $luciq= { :version => '19.3.0' }
2
2
 
3
3
  def use_luciq! (spec = nil)
4
4
  version = $luciq[:version]
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@luciq/react-native",
3
3
  "description": "Luciq is the Agentic Observability Platform built for Mobile.",
4
- "version": "19.0.0-286-SNAPSHOT",
4
+ "version": "19.1.0",
5
5
  "author": "Luciq (https://luciq.ai)",
6
6
  "repository": "github:luciqai/luciq-reactnative-sdk",
7
7
  "homepage": "https://www.luciq.ai/platforms/react-native",
@@ -43,6 +43,7 @@
43
43
  },
44
44
  "devDependencies": {
45
45
  "@apollo/client": "^3.7.0",
46
+ "@instabug/danger-plugin-coverage": "Instabug/danger-plugin-coverage",
46
47
  "@react-native-community/eslint-config": "^3.1.0",
47
48
  "@react-navigation/native": "^6.1.7",
48
49
  "@rollup/plugin-commonjs": "^25.0.3",