@scalebun/react-native 1.2.3 → 1.3.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.
@@ -14031,6 +14031,12 @@ var SHAPE = {
14031
14031
  }
14032
14032
  },
14033
14033
  captureInteractionHeatmap: bool(true),
14034
+ // Opt-in: intercept console.* and ship the lines to the Diagnose → Logs lane in SaaS
14035
+ // mode. OFF by default — console output can carry PII/secrets and adds ingest volume,
14036
+ // so capturing it is the host's explicit choice, not a silent default. When true and a
14037
+ // clientKey is present, the bootstrapper arms the console integration (previously only
14038
+ // reachable through the desktop-debug tooling, so stock SaaS apps captured nothing).
14039
+ captureConsoleLogs: bool(false),
14034
14040
  ota: {
14035
14041
  kind: "obj",
14036
14042
  opt: true,
@@ -15283,6 +15289,9 @@ function uninstallAlertInstrumentation() {
15283
15289
  installed = false;
15284
15290
  }
15285
15291
 
15292
+ // lib/module/bootstrap/SDKBootstrapper.js
15293
+ init_consoleIntegration();
15294
+
15286
15295
  // lib/module/features/session/BackendSessionAdapter.js
15287
15296
  init_internalLogger();
15288
15297
 
@@ -16795,6 +16804,9 @@ var SDKBootstrapper = class {
16795
16804
  }
16796
16805
  });
16797
16806
  sessionManager.setBackendTransport(backendAdapter);
16807
+ if (this.config.clientKey && this.config.captureConsoleLogs) {
16808
+ installConsoleIntegration();
16809
+ }
16798
16810
  backendAdapter.recoverPersistedFrames().catch(() => {
16799
16811
  });
16800
16812
  if (this.config.clientKey) {
@@ -16981,6 +16993,7 @@ var SDKBootstrapper = class {
16981
16993
  this._deepLinkUnsubscribe?.();
16982
16994
  this._deepLinkUnsubscribe = null;
16983
16995
  uninstallAlertInstrumentation();
16996
+ uninstallConsoleIntegration();
16984
16997
  this.featureRegistry.teardownAll();
16985
16998
  }
16986
16999
  };
@@ -20321,8 +20334,29 @@ var ScaleBunFacade = class {
20321
20334
  }
20322
20335
  });
20323
20336
  }
20324
- /** Log a message (convenience wrapper over track) */
20337
+ /**
20338
+ * Log a message. Delivered to BOTH lanes:
20339
+ * - the Diagnose → Logs lane (tagged `source: 'sdk'`), so an explicit `log()` call shows
20340
+ * up where a developer looks for logs. The method name promised this, but it previously
20341
+ * only emitted a `$log` analytics EVENT and never reached the Logs page.
20342
+ * - the analytics `$log` event (unchanged), so anything already built on it keeps working.
20343
+ * `queueLog` self-gates on `clientKey`, so the Logs-lane write is a no-op outside SaaS mode.
20344
+ */
20325
20345
  log(level, message, data) {
20346
+ try {
20347
+ const transport = SessionManager.getExistingInstance()?.getBackendTransport();
20348
+ transport?.queueLog({
20349
+ level,
20350
+ message,
20351
+ source: "sdk",
20352
+ platform: "js",
20353
+ timestamp: (/* @__PURE__ */ new Date()).toISOString(),
20354
+ ...data ? {
20355
+ metadata: data
20356
+ } : {}
20357
+ });
20358
+ } catch {
20359
+ }
20326
20360
  return this.track("$log", {
20327
20361
  level,
20328
20362
  message,