@cxpinsight/react-native 0.18.0 → 0.18.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.
Files changed (54) hide show
  1. package/CHANGELOG.md +44 -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 +30 -0
  10. package/lib/CXPinsight.d.ts.map +1 -1
  11. package/lib/CXPinsight.js +217 -16
  12. package/lib/CXPinsight.js.map +1 -1
  13. package/lib/CXPinsightProvider.d.ts.map +1 -1
  14. package/lib/CXPinsightProvider.js +18 -1
  15. package/lib/CXPinsightProvider.js.map +1 -1
  16. package/lib/core/captureLedger.d.ts +75 -0
  17. package/lib/core/captureLedger.d.ts.map +1 -0
  18. package/lib/core/captureLedger.js +74 -0
  19. package/lib/core/captureLedger.js.map +1 -0
  20. package/lib/core/captureStatus.d.ts +197 -0
  21. package/lib/core/captureStatus.d.ts.map +1 -0
  22. package/lib/core/captureStatus.js +168 -0
  23. package/lib/core/captureStatus.js.map +1 -0
  24. package/lib/core/consent.d.ts +2 -0
  25. package/lib/core/consent.d.ts.map +1 -1
  26. package/lib/core/consent.js +6 -0
  27. package/lib/core/consent.js.map +1 -1
  28. package/lib/core/eventQueue.d.ts +11 -0
  29. package/lib/core/eventQueue.d.ts.map +1 -1
  30. package/lib/core/eventQueue.js +30 -0
  31. package/lib/core/eventQueue.js.map +1 -1
  32. package/lib/core/mobileRecorder.d.ts +2 -0
  33. package/lib/core/mobileRecorder.d.ts.map +1 -1
  34. package/lib/core/mobileRecorder.js +21 -3
  35. package/lib/core/mobileRecorder.js.map +1 -1
  36. package/lib/core/nativeScreenshot.d.ts +9 -0
  37. package/lib/core/nativeScreenshot.d.ts.map +1 -0
  38. package/lib/core/nativeScreenshot.js +76 -0
  39. package/lib/core/nativeScreenshot.js.map +1 -0
  40. package/lib/core/networkCapture.d.ts +9 -0
  41. package/lib/core/networkCapture.d.ts.map +1 -1
  42. package/lib/core/networkCapture.js +37 -1
  43. package/lib/core/networkCapture.js.map +1 -1
  44. package/lib/core/triggerEngine.d.ts +1 -1
  45. package/lib/core/triggerEngine.d.ts.map +1 -1
  46. package/lib/core/triggerEngine.js +7 -0
  47. package/lib/core/triggerEngine.js.map +1 -1
  48. package/lib/types.d.ts +1 -2
  49. package/lib/types.d.ts.map +1 -1
  50. package/lib/version.d.ts +9 -0
  51. package/lib/version.d.ts.map +1 -0
  52. package/lib/version.js +12 -0
  53. package/lib/version.js.map +1 -0
  54. package/package.json +5 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,49 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.18.2
4
+
5
+ ### Added
6
+
7
+ - **The SDK reports what it is capturing, per event type, and why not.** On
8
+ every launch, and whenever it changes, the SDK sends a capture status: for
9
+ session start, app lifecycle, screen views, taps, scrolls, form fields, custom
10
+ events, API calls, recording, screenshots and surveys, either `on` or the one
11
+ reason in force — `off_in_app`, `off_in_dashboard`, `declined`,
12
+ `waiting_for_consent`, `install_failed`, `not_connected`, `sampled_out`,
13
+ `start_failed`, `not_started`, `no_capturer` — plus whether events are
14
+ leaving the device (`sending`, `held_for_consent`, `retrying`). The dashboard
15
+ shows it on the Mobile SDK card. It carries no user, session or device
16
+ identifier, and is sent even while consent holds everything else, because
17
+ that is the case it exists to show.
18
+
19
+ ## 0.18.1
20
+
21
+ Needs one native rebuild after upgrading: the package now ships native code.
22
+
23
+ ### Added
24
+
25
+ - **Screenshots without host code.** The SDK carries its own native module
26
+ (`CXPScreenshot`, iOS and Android) and captures replay screenshots itself.
27
+ Before, screenshots existed only when the app passed `captureScreen`; an app
28
+ that did not recorded timelines with no pictures while the dashboard said
29
+ screenshots were on. Order: your `captureScreen` → the SDK's module →
30
+ `react-native-view-shot` if installed → none. Frames are JPEG, 720 px wide,
31
+ with text inputs masked while `recordMaskInputs` is on. Android windows with
32
+ `FLAG_SECURE` are skipped. The dashboard's Screenshots switch turns all of it off.
33
+ - **`session_start` says which build and wiring produced it**: `sdk_version`,
34
+ `screenshot_source`, `provider_mounted`, `navigation_source`, `tap_capture`.
35
+
36
+ ### Fixed
37
+
38
+ - **A session that starts by rollover knows its screen.** Coming back after the
39
+ inactivity timeout started a new session with no `page_view`, so every event
40
+ in it carried the previous session's screen and funnels never saw an entry.
41
+ The current screen is now re-announced (`session_resumed: true`) without
42
+ firing screen-view survey triggers. That `session_start` also carries
43
+ `is_first_visit` and the diagnostics above, like the one at launch.
44
+ - **Connectivity probes are not api_call events.** NetInfo's reachability check
45
+ (`generate_204`) and captive-portal checks are dropped from network capture.
46
+
3
47
  ## 0.18.0
4
48
 
5
49
  Requires `@cxpinsight/survey-spec@^0.9.0` — it calls resolveBranding,
@@ -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
@@ -16,6 +16,9 @@ declare class CXPinsightSDK {
16
16
  /** The field currently focused, so blur can report dwell + changed. */
17
17
  private fieldVisit;
18
18
  private currentScreen;
19
+ private screenshotsOff;
20
+ private screenshotSource;
21
+ private integration;
19
22
  private previousScreen;
20
23
  private engagementStartTs;
21
24
  private engagementAccumMs;
@@ -30,6 +33,20 @@ declare class CXPinsightSDK {
30
33
  private pendingDropped;
31
34
  /** Initialize the SDK. Call once at app startup. */
32
35
  init(config: CXPinsightConfig, callbacks?: CXPinsightCallbacks): Promise<void>;
36
+ /** What is being captured right now and, for anything that is not, which layer said no. */
37
+ private captureStatus;
38
+ /**
39
+ * Send the capture status — directly, NOT through the event queue: the queue
40
+ * is exactly what consent holds back, and "held back by consent" is the case
41
+ * this report exists to show. Carries no user, session or device identifier
42
+ * (see core/captureStatus.ts). Once per distinct state per launch.
43
+ */
44
+ private lastCaptureStatus;
45
+ private initReported;
46
+ private recordingStarting;
47
+ private reportCaptureStatus;
48
+ /** A consent change starts or stops things asynchronously; report once they have settled. */
49
+ private reportAfterConsent;
33
50
  /**
34
51
  * P1 — merge the server's canonical SdkConfig into `config`, filling only the
35
52
  * flat init() fields the app left undefined (client always wins). Bounded to a
@@ -62,6 +79,13 @@ declare class CXPinsightSDK {
62
79
  private applyServerSdkConfig;
63
80
  /** Roll the recording + engagement clock onto a freshly-started session. */
64
81
  private onSessionRollover;
82
+ /** Which build, and how it is wired — so a gap in a session can be read, not guessed. */
83
+ private sessionDiagnostics;
84
+ /** @internal Called by CXPinsightProvider so session_start can report how screens are tracked. */
85
+ _noteIntegration(i: Partial<{
86
+ provider: boolean;
87
+ navigation: 'ref' | 'screen_prop' | 'none';
88
+ }>): void;
65
89
  /** Emit everything buffered before init() resolved, oldest first. */
66
90
  private flushPending;
67
91
  /** Wire native signals → typed analytics events (shared taxonomy). */
@@ -76,6 +100,12 @@ declare class CXPinsightSDK {
76
100
  track(eventName: string, data?: Record<string, unknown>, eventType?: string, teeToRecording?: boolean,
77
101
  /** Internal: preserves the original time of a call buffered before init(). */
78
102
  eventTimestamp?: string): void;
103
+ /**
104
+ * The screenshot capturer for a recording that is starting now: the host's
105
+ * captureScreen, else the SDK's own (nativeScreenshot.ts), unless the
106
+ * dashboard turned screenshots off.
107
+ */
108
+ private screenshotProvider;
79
109
  /** Track a screen view (triggers remote page_view rules) */
80
110
  trackScreen(screenName: string, data?: Record<string, unknown>): void;
81
111
  /** 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,OAA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