@cxpinsight/react-native 0.17.8 → 0.18.1

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 (58) hide show
  1. package/CHANGELOG.md +49 -0
  2. package/CXPinsightReactNative.podspec +24 -0
  3. package/README.md +10 -5
  4. package/android/build.gradle +33 -0
  5. package/android/src/main/AndroidManifest.xml +1 -0
  6. package/android/src/main/java/com/cxpinsight/reactnative/CXPScreenshotModule.java +134 -0
  7. package/android/src/main/java/com/cxpinsight/reactnative/CXPinsightPackage.java +25 -0
  8. package/ios/CXPScreenshot.m +99 -0
  9. package/lib/CXPinsight.d.ts +18 -0
  10. package/lib/CXPinsight.d.ts.map +1 -1
  11. package/lib/CXPinsight.js +124 -10
  12. package/lib/CXPinsight.js.map +1 -1
  13. package/lib/CXPinsightProvider.d.ts.map +1 -1
  14. package/lib/CXPinsightProvider.js +215 -10
  15. package/lib/CXPinsightProvider.js.map +1 -1
  16. package/lib/core/mobileRecorder.d.ts +19 -0
  17. package/lib/core/mobileRecorder.d.ts.map +1 -1
  18. package/lib/core/mobileRecorder.js +51 -3
  19. package/lib/core/mobileRecorder.js.map +1 -1
  20. package/lib/core/nativeScreenshot.d.ts +9 -0
  21. package/lib/core/nativeScreenshot.d.ts.map +1 -0
  22. package/lib/core/nativeScreenshot.js +76 -0
  23. package/lib/core/nativeScreenshot.js.map +1 -0
  24. package/lib/core/networkCapture.d.ts +1 -0
  25. package/lib/core/networkCapture.d.ts.map +1 -1
  26. package/lib/core/networkCapture.js +18 -1
  27. package/lib/core/networkCapture.js.map +1 -1
  28. package/lib/core/triggerEngine.d.ts +17 -0
  29. package/lib/core/triggerEngine.d.ts.map +1 -1
  30. package/lib/core/triggerEngine.js +17 -3
  31. package/lib/core/triggerEngine.js.map +1 -1
  32. package/lib/core/viewShot.d.ts +10 -0
  33. package/lib/core/viewShot.d.ts.map +1 -0
  34. package/lib/core/viewShot.js +56 -0
  35. package/lib/core/viewShot.js.map +1 -0
  36. package/lib/instrumented/interactionObserver.d.ts.map +1 -1
  37. package/lib/instrumented/interactionObserver.js +32 -9
  38. package/lib/instrumented/interactionObserver.js.map +1 -1
  39. package/lib/survey/SurveyModal.d.ts +72 -1
  40. package/lib/survey/SurveyModal.d.ts.map +1 -1
  41. package/lib/survey/SurveyModal.js +1162 -392
  42. package/lib/survey/SurveyModal.js.map +1 -1
  43. package/lib/survey/fadeGradient.d.ts +35 -0
  44. package/lib/survey/fadeGradient.d.ts.map +1 -0
  45. package/lib/survey/fadeGradient.js +68 -0
  46. package/lib/survey/fadeGradient.js.map +1 -0
  47. package/lib/survey/styleContract.d.ts +49 -1
  48. package/lib/survey/styleContract.d.ts.map +1 -1
  49. package/lib/survey/styleContract.js +76 -17
  50. package/lib/survey/styleContract.js.map +1 -1
  51. package/lib/types.d.ts +11 -2
  52. package/lib/types.d.ts.map +1 -1
  53. package/lib/types.js.map +1 -1
  54. package/lib/version.d.ts +9 -0
  55. package/lib/version.d.ts.map +1 -0
  56. package/lib/version.js +12 -0
  57. package/lib/version.js.map +1 -0
  58. package/package.json +13 -5
package/CHANGELOG.md CHANGED
@@ -1,5 +1,54 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.18.1
4
+
5
+ Needs one native rebuild after upgrading: the package now ships native code.
6
+
7
+ ### Added
8
+
9
+ - **Screenshots without host code.** The SDK carries its own native module
10
+ (`CXPScreenshot`, iOS and Android) and captures replay screenshots itself.
11
+ Before, screenshots existed only when the app passed `captureScreen`; an app
12
+ that did not recorded timelines with no pictures while the dashboard said
13
+ screenshots were on. Order: your `captureScreen` → the SDK's module →
14
+ `react-native-view-shot` if installed → none. Frames are JPEG, 720 px wide,
15
+ with text inputs masked while `recordMaskInputs` is on. Android windows with
16
+ `FLAG_SECURE` are skipped. The dashboard's Screenshots switch turns all of it off.
17
+ - **`session_start` says which build and wiring produced it**: `sdk_version`,
18
+ `screenshot_source`, `provider_mounted`, `navigation_source`, `tap_capture`.
19
+
20
+ ### Fixed
21
+
22
+ - **A session that starts by rollover knows its screen.** Coming back after the
23
+ inactivity timeout started a new session with no `page_view`, so every event
24
+ in it carried the previous session's screen and funnels never saw an entry.
25
+ The current screen is now re-announced (`session_resumed: true`) without
26
+ firing screen-view survey triggers. That `session_start` also carries
27
+ `is_first_visit` and the diagnostics above, like the one at launch.
28
+ - **Connectivity probes are not api_call events.** NetInfo's reachability check
29
+ (`generate_204`) and captive-portal checks are dropped from network capture.
30
+
31
+ ## 0.18.0
32
+
33
+ Requires `@cxpinsight/survey-spec@^0.9.0` — it calls resolveBranding,
34
+ resolveThemeDecision, showsClose, rewardTerms and others that 0.8.0 does not
35
+ export, so installing it against 0.8.0 fails at run time.
36
+
37
+ ### Added
38
+
39
+ - **`survey_closed`** on the event timeline, with `outcome` (`completed` /
40
+ `dismissed`) and, for a dismissal, `reason` (swipe, close, backdrop, auto,
41
+ defer…). Previously a close was only a tally in the survey service and a frame
42
+ in the replay. Same name and fields as the web SDK.
43
+ - **`survey_shown`** as an event, not only a replay frame.
44
+ - **`field_blur`** on leaving an instrumented `TextInput`: dwell, whether
45
+ anything changed, whether it was left empty — never the contents.
46
+
47
+ ### Fixed
48
+
49
+ - **One press is one event.** A press reaching the SDK by more than one path —
50
+ one that knew the testID and one that did not — was stored two or three times.
51
+
3
52
  ## 0.14.0
4
53
 
5
54
  Requires `@cxpinsight/survey-spec@^0.8.0`.
@@ -0,0 +1,24 @@
1
+ require 'json'
2
+
3
+ package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
4
+
5
+ # The SDK's own native code: one module, CXPScreenshot, so replay screenshots
6
+ # work from installing the package alone — no captureScreen callback and no
7
+ # second native dependency in the host app.
8
+ Pod::Spec.new do |s|
9
+ s.name = 'CXPinsightReactNative'
10
+ s.version = package['version']
11
+ s.summary = package['description']
12
+ s.license = package['license']
13
+ s.authors = 'CXPinsight'
14
+ s.homepage = package['homepage']
15
+ s.platforms = { :ios => '13.4' }
16
+ s.source = { :git => 'https://github.com/SaifDalli2/CX_Platform.git', :tag => "react-native-v#{s.version}" }
17
+ s.source_files = 'ios/**/*.{h,m,mm}'
18
+
19
+ if respond_to?(:install_modules_dependencies, true)
20
+ install_modules_dependencies(s)
21
+ else
22
+ s.dependency 'React-Core'
23
+ end
24
+ end
package/README.md CHANGED
@@ -34,7 +34,6 @@ Taps on everything else — `TouchableHighlight`, `Button`, and any touchable in
34
34
 
35
35
  ```js
36
36
  import { CXPinsight } from '@cxpinsight/react-native';
37
- import { captureScreen } from 'react-native-view-shot';
38
37
 
39
38
  CXPinsight.init({
40
39
  applicationId: 'YOUR_APPLICATION_ID',
@@ -42,12 +41,18 @@ CXPinsight.init({
42
41
  apiBase: 'https://your-gateway.example.com',
43
42
 
44
43
  record: true, // session replay: screens, taps, scroll, inputs
45
- recordMaskInputs: true, // never store typed text
46
- captureScreen: () => // optional screenshots in the replay timeline
47
- captureScreen({ format: 'jpg', quality: 0.3, result: 'base64' }),
44
+ recordMaskInputs: true, // never store typed text; also masks inputs in screenshots
48
45
  });
49
46
  ```
50
47
 
48
+ Screenshots in the replay are taken by the SDK's own native module — no extra
49
+ package and no capture code. It links automatically; rebuild the app once after
50
+ installing (`npx expo prebuild` / `pod install`). Text inputs are covered in
51
+ every frame while `recordMaskInputs` is on, and an Android screen with
52
+ `FLAG_SECURE` is never captured. Turn screenshots off from the dashboard
53
+ (Recording → Screenshots). To use your own capturer instead, pass
54
+ `captureScreen: () => Promise<base64 jpeg>`; it always takes precedence.
55
+
51
56
  On a physical device `apiBase` must be reachable from the device — use your machine's LAN IP, not `localhost`. The SDK checks this at startup and logs a specific message if it looks wrong.
52
57
 
53
58
  ### 3. Report screen changes
@@ -215,7 +220,7 @@ as partial rather than absent.
215
220
  | `apiBase` | — | Your CXPinsight gateway URL. |
216
221
  | `record` | dashboard | Session replay. Omit to follow the dashboard toggle. |
217
222
  | `recordMaskInputs` | `true` | Never persist typed text. |
218
- | `captureScreen` | — | Screenshot provider; omit for a timeline-only replay. |
223
+ | `captureScreen` | built in | Your own screenshot provider. Omit it: the SDK captures screenshots itself. |
219
224
  | `captureNetwork` | `true` | Sanitised `api_call` events — method, host, path, status. Never bodies or headers. |
220
225
  | `requireConsent` | `false` | Hold all capture until `optIn()`. |
221
226
  | `autoCaptureTaps` | `true` | Capture taps on touch components the babel plugin cannot reach, including inside UI libraries. |
@@ -0,0 +1,33 @@
1
+ // The SDK's own native code: one module, CXPScreenshot (see
2
+ // src/main/java/com/cxpinsight/reactnative/CXPScreenshotModule.java).
3
+
4
+ def safeExtGet(prop, fallback) {
5
+ rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
6
+ }
7
+
8
+ apply plugin: 'com.android.library'
9
+
10
+ android {
11
+ namespace "com.cxpinsight.reactnative"
12
+ compileSdkVersion safeExtGet('compileSdkVersion', 35)
13
+
14
+ defaultConfig {
15
+ minSdkVersion safeExtGet('minSdkVersion', 24)
16
+ targetSdkVersion safeExtGet('targetSdkVersion', 35)
17
+ }
18
+
19
+ compileOptions {
20
+ sourceCompatibility JavaVersion.VERSION_17
21
+ targetCompatibility JavaVersion.VERSION_17
22
+ }
23
+ }
24
+
25
+ repositories {
26
+ google()
27
+ mavenCentral()
28
+ }
29
+
30
+ dependencies {
31
+ // Resolved to the app's React Native version by the React Native Gradle plugin.
32
+ implementation "com.facebook.react:react-android"
33
+ }
@@ -0,0 +1 @@
1
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android" />
@@ -0,0 +1,134 @@
1
+ package com.cxpinsight.reactnative;
2
+
3
+ import android.app.Activity;
4
+ import android.graphics.Bitmap;
5
+ import android.graphics.Canvas;
6
+ import android.graphics.Paint;
7
+ import android.util.Base64;
8
+ import android.view.View;
9
+ import android.view.ViewGroup;
10
+ import android.view.WindowManager;
11
+ import android.widget.EditText;
12
+
13
+ import androidx.annotation.NonNull;
14
+
15
+ import com.facebook.react.bridge.Promise;
16
+ import com.facebook.react.bridge.ReactApplicationContext;
17
+ import com.facebook.react.bridge.ReactContextBaseJavaModule;
18
+ import com.facebook.react.bridge.ReactMethod;
19
+
20
+ import java.io.ByteArrayOutputStream;
21
+ import java.util.concurrent.ExecutorService;
22
+ import java.util.concurrent.Executors;
23
+
24
+ /**
25
+ * Replay screenshots taken by the SDK itself — the Android half of
26
+ * ios/CXPScreenshot.m. capture(quality, maxWidth, maskInputs) resolves a base64
27
+ * JPEG of the current activity's window, or null. Null means "no frame this
28
+ * time", never an error: a recording must not fail over a frame.
29
+ */
30
+ public class CXPScreenshotModule extends ReactContextBaseJavaModule {
31
+ static final String NAME = "CXPScreenshot";
32
+
33
+ private final ExecutorService encoder = Executors.newSingleThreadExecutor();
34
+
35
+ CXPScreenshotModule(ReactApplicationContext context) {
36
+ super(context);
37
+ }
38
+
39
+ @NonNull
40
+ @Override
41
+ public String getName() {
42
+ return NAME;
43
+ }
44
+
45
+ @ReactMethod
46
+ public void capture(final double quality, final double maxWidth, final boolean maskInputs, final Promise promise) {
47
+ final Activity activity = getReactApplicationContext().getCurrentActivity();
48
+ if (activity == null) {
49
+ promise.resolve(null);
50
+ return;
51
+ }
52
+ // FLAG_SECURE is the app saying "never capture this screen". The OS already
53
+ // blanks it from screenshots and recents; the SDK does the same.
54
+ if ((activity.getWindow().getAttributes().flags & WindowManager.LayoutParams.FLAG_SECURE) != 0) {
55
+ promise.resolve(null);
56
+ return;
57
+ }
58
+ activity.runOnUiThread(new Runnable() {
59
+ @Override
60
+ public void run() {
61
+ final Bitmap bitmap;
62
+ try {
63
+ bitmap = draw(activity.getWindow().getDecorView().getRootView(), maxWidth, maskInputs);
64
+ } catch (Throwable t) {
65
+ promise.resolve(null);
66
+ return;
67
+ }
68
+ if (bitmap == null) {
69
+ promise.resolve(null);
70
+ return;
71
+ }
72
+ encoder.execute(new Runnable() {
73
+ @Override
74
+ public void run() {
75
+ try {
76
+ ByteArrayOutputStream out = new ByteArrayOutputStream();
77
+ int q = (int) Math.round((quality > 0 && quality <= 1 ? quality : 0.5) * 100);
78
+ bitmap.compress(Bitmap.CompressFormat.JPEG, q, out);
79
+ promise.resolve(Base64.encodeToString(out.toByteArray(), Base64.NO_WRAP));
80
+ } catch (Throwable t) {
81
+ promise.resolve(null);
82
+ } finally {
83
+ bitmap.recycle();
84
+ }
85
+ }
86
+ });
87
+ }
88
+ });
89
+ }
90
+
91
+ // Draws straight at the output width rather than full resolution and scaling
92
+ // after: fewer pixels, drawn once.
93
+ private static Bitmap draw(View root, double maxWidth, boolean maskInputs) {
94
+ int w = root.getWidth();
95
+ int h = root.getHeight();
96
+ if (w <= 0 || h <= 0) return null;
97
+ float scale = maxWidth > 0 ? Math.min(1f, (float) (maxWidth / w)) : 1f;
98
+ int ow = Math.max(1, Math.round(w * scale));
99
+ int oh = Math.max(1, Math.round(h * scale));
100
+
101
+ Bitmap bitmap = Bitmap.createBitmap(ow, oh, Bitmap.Config.ARGB_8888);
102
+ Canvas canvas = new Canvas(bitmap);
103
+ canvas.scale(scale, scale);
104
+ root.draw(canvas);
105
+
106
+ // Text inputs are covered, not photographed: what someone types is theirs.
107
+ if (maskInputs) {
108
+ Paint paint = new Paint();
109
+ paint.setColor(0xFF8C8C8C);
110
+ int[] rootAt = new int[2];
111
+ root.getLocationInWindow(rootAt);
112
+ maskInputs(root, canvas, paint, rootAt);
113
+ }
114
+ return bitmap;
115
+ }
116
+
117
+ private static void maskInputs(View view, Canvas canvas, Paint paint, int[] rootAt) {
118
+ if (view.getVisibility() != View.VISIBLE) return;
119
+ if (view instanceof EditText) {
120
+ int[] at = new int[2];
121
+ view.getLocationInWindow(at);
122
+ float x = at[0] - rootAt[0];
123
+ float y = at[1] - rootAt[1];
124
+ canvas.drawRect(x, y, x + view.getWidth(), y + view.getHeight(), paint);
125
+ return;
126
+ }
127
+ if (view instanceof ViewGroup) {
128
+ ViewGroup group = (ViewGroup) view;
129
+ for (int i = 0; i < group.getChildCount(); i++) {
130
+ maskInputs(group.getChildAt(i), canvas, paint, rootAt);
131
+ }
132
+ }
133
+ }
134
+ }
@@ -0,0 +1,25 @@
1
+ package com.cxpinsight.reactnative;
2
+
3
+ import androidx.annotation.NonNull;
4
+
5
+ import com.facebook.react.ReactPackage;
6
+ import com.facebook.react.bridge.NativeModule;
7
+ import com.facebook.react.bridge.ReactApplicationContext;
8
+ import com.facebook.react.uimanager.ViewManager;
9
+
10
+ import java.util.Collections;
11
+ import java.util.List;
12
+
13
+ public class CXPinsightPackage implements ReactPackage {
14
+ @NonNull
15
+ @Override
16
+ public List<NativeModule> createNativeModules(@NonNull ReactApplicationContext reactContext) {
17
+ return Collections.<NativeModule>singletonList(new CXPScreenshotModule(reactContext));
18
+ }
19
+
20
+ @NonNull
21
+ @Override
22
+ public List<ViewManager> createViewManagers(@NonNull ReactApplicationContext reactContext) {
23
+ return Collections.emptyList();
24
+ }
25
+ }
@@ -0,0 +1,99 @@
1
+ // Replay screenshots taken by the SDK itself.
2
+ //
3
+ // Screenshots used to exist only when the host app passed a captureScreen
4
+ // callback backed by a second native package. An app that followed the setup
5
+ // guide without it — or with it installed but not wired — recorded timelines
6
+ // with no pictures, while the dashboard said screenshots were on.
7
+ //
8
+ // So the SDK carries its own. One method, capture(quality, maxWidth,
9
+ // maskInputs), resolving a base64 JPEG of the key window or null. Null means
10
+ // "no frame this time", never an error: a recording must not fail over a frame.
11
+
12
+ #import <React/RCTBridgeModule.h>
13
+ #import <UIKit/UIKit.h>
14
+
15
+ @interface CXPScreenshot : NSObject <RCTBridgeModule>
16
+ @end
17
+
18
+ @implementation CXPScreenshot
19
+
20
+ RCT_EXPORT_MODULE(CXPScreenshot)
21
+
22
+ + (BOOL)requiresMainQueueSetup { return NO; }
23
+
24
+ // UIKit drawing belongs on the main queue. Encoding does not, and is moved off it below.
25
+ - (dispatch_queue_t)methodQueue { return dispatch_get_main_queue(); }
26
+
27
+ static UIWindow *CXPKeyWindow(void)
28
+ {
29
+ for (UIScene *scene in [UIApplication sharedApplication].connectedScenes) {
30
+ if (scene.activationState != UISceneActivationStateForegroundActive) continue;
31
+ if (![scene isKindOfClass:[UIWindowScene class]]) continue;
32
+ for (UIWindow *w in ((UIWindowScene *)scene).windows) {
33
+ if (w.isKeyWindow) return w;
34
+ }
35
+ }
36
+ return nil;
37
+ }
38
+
39
+ // Text inputs are covered, not photographed: what someone types is theirs, and
40
+ // a masked recording is the SDK's default everywhere else.
41
+ static void CXPCollectInputs(UIView *view, UIWindow *window, NSMutableArray<NSValue *> *out)
42
+ {
43
+ if (view.hidden || view.alpha < 0.01) return;
44
+ BOOL isInput = [view isKindOfClass:[UITextField class]] ||
45
+ ([view isKindOfClass:[UITextView class]] && ((UITextView *)view).isEditable);
46
+ if (isInput) {
47
+ [out addObject:[NSValue valueWithCGRect:[view convertRect:view.bounds toView:window]]];
48
+ return;
49
+ }
50
+ for (UIView *child in view.subviews) CXPCollectInputs(child, window, out);
51
+ }
52
+
53
+ RCT_EXPORT_METHOD(capture:(double)quality
54
+ maxWidth:(double)maxWidth
55
+ maskInputs:(BOOL)maskInputs
56
+ resolve:(RCTPromiseResolveBlock)resolve
57
+ reject:(__unused RCTPromiseRejectBlock)reject)
58
+ {
59
+ // Backgrounded: iOS shows a snapshot, not the app, and drawing now is wasted.
60
+ if ([UIApplication sharedApplication].applicationState != UIApplicationStateActive) {
61
+ resolve([NSNull null]);
62
+ return;
63
+ }
64
+ UIWindow *window = CXPKeyWindow();
65
+ CGSize size = window.bounds.size;
66
+ if (!window || size.width < 1 || size.height < 1) {
67
+ resolve([NSNull null]);
68
+ return;
69
+ }
70
+
71
+ // Render straight at the output width rather than at the screen's 3x and
72
+ // scaling down after: a third of the pixels, drawn once.
73
+ CGFloat scale = window.screen.scale;
74
+ if (maxWidth > 0) scale = MIN(scale, maxWidth / size.width);
75
+ UIGraphicsImageRendererFormat *format = [UIGraphicsImageRendererFormat preferredFormat];
76
+ format.scale = scale;
77
+ format.opaque = YES;
78
+
79
+ NSMutableArray<NSValue *> *masks = [NSMutableArray new];
80
+ if (maskInputs) CXPCollectInputs(window, window, masks);
81
+
82
+ UIGraphicsImageRenderer *renderer = [[UIGraphicsImageRenderer alloc] initWithSize:size format:format];
83
+ UIImage *image = [renderer imageWithActions:^(UIGraphicsImageRendererContext *ctx) {
84
+ [window drawViewHierarchyInRect:window.bounds afterScreenUpdates:NO];
85
+ if (masks.count) {
86
+ [[UIColor colorWithWhite:0.55 alpha:1] setFill];
87
+ for (NSValue *r in masks) UIRectFill(r.CGRectValue);
88
+ }
89
+ }];
90
+
91
+ double q = quality > 0 && quality <= 1 ? quality : 0.5;
92
+ dispatch_async(dispatch_get_global_queue(QOS_CLASS_UTILITY, 0), ^{
93
+ NSData *jpeg = UIImageJPEGRepresentation(image, q);
94
+ if (!jpeg) { resolve([NSNull null]); return; }
95
+ resolve([jpeg base64EncodedStringWithOptions:0]);
96
+ });
97
+ }
98
+
99
+ @end
@@ -13,7 +13,12 @@ declare class CXPinsightSDK {
13
13
  private surveyPresenter;
14
14
  private setupPresenter;
15
15
  private autoEventUnsub;
16
+ /** The field currently focused, so blur can report dwell + changed. */
17
+ private fieldVisit;
16
18
  private currentScreen;
19
+ private screenshotsOff;
20
+ private screenshotSource;
21
+ private integration;
17
22
  private previousScreen;
18
23
  private engagementStartTs;
19
24
  private engagementAccumMs;
@@ -60,6 +65,13 @@ declare class CXPinsightSDK {
60
65
  private applyServerSdkConfig;
61
66
  /** Roll the recording + engagement clock onto a freshly-started session. */
62
67
  private onSessionRollover;
68
+ /** Which build, and how it is wired — so a gap in a session can be read, not guessed. */
69
+ private sessionDiagnostics;
70
+ /** @internal Called by CXPinsightProvider so session_start can report how screens are tracked. */
71
+ _noteIntegration(i: Partial<{
72
+ provider: boolean;
73
+ navigation: 'ref' | 'screen_prop' | 'none';
74
+ }>): void;
63
75
  /** Emit everything buffered before init() resolved, oldest first. */
64
76
  private flushPending;
65
77
  /** Wire native signals → typed analytics events (shared taxonomy). */
@@ -74,6 +86,12 @@ declare class CXPinsightSDK {
74
86
  track(eventName: string, data?: Record<string, unknown>, eventType?: string, teeToRecording?: boolean,
75
87
  /** Internal: preserves the original time of a call buffered before init(). */
76
88
  eventTimestamp?: string): void;
89
+ /**
90
+ * The screenshot capturer for a recording that is starting now: the host's
91
+ * captureScreen, else the SDK's own (nativeScreenshot.ts), unless the
92
+ * dashboard turned screenshots off.
93
+ */
94
+ private screenshotProvider;
77
95
  /** Track a screen view (triggers remote page_view rules) */
78
96
  trackScreen(screenName: string, data?: Record<string, unknown>): void;
79
97
  /** Identify the current user */
@@ -1 +1 @@
1
- {"version":3,"file":"CXPinsight.d.ts","sourceRoot":"","sources":["../src/CXPinsight.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,mBAAmB,EACnB,YAAY,EAGZ,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,SAAS,CAAC;AAuBjB,OAAO,EAGe,KAAK,UAAU,EAAE,KAAK,eAAe,EAC1D,MAAM,gBAAgB,CAAC;AAiBxB,KAAK,eAAe,GAAG,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;AAClD,KAAK,cAAc,GAAG,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;AAE9C,cAAM,aAAa;IACjB,OAAO,CAAC,WAAW,CAAS;IAC5B,2EAA2E;IAC3E,OAAO,CAAC,aAAa,CAAqG;IAC1H,OAAO,CAAC,MAAM,CAAiC;IAC/C,OAAO,CAAC,SAAS,CAA2B;IAC5C,OAAO,CAAC,MAAM,CAAc;IAK5B,OAAO,CAAC,YAAY,CAA6B;IACjD,OAAO,CAAC,eAAe,CAAgC;IACvD,OAAO,CAAC,cAAc,CAA+B;IAErD,OAAO,CAAC,cAAc,CAA6B;IAEnD,OAAO,CAAC,aAAa,CAAuB;IAC5C,OAAO,CAAC,cAAc,CAAuB;IAG7C,OAAO,CAAC,iBAAiB,CAAK;IAC9B,OAAO,CAAC,iBAAiB,CAAK;IAC9B,OAAO,CAAC,gBAAgB,CAAS;IAEjC,OAAO,CAAC,oBAAoB;IAC5B,OAAO,CAAC,oBAAo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