@monoscopetech/browser 0.6.0 → 0.6.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.
package/dist/replay.js CHANGED
@@ -91,7 +91,9 @@ export class MonoscopeReplay {
91
91
  this.save();
92
92
  }, SAVE_INTERVAL);
93
93
  this.isConfigured = true;
94
- console.log("MonoscopeReplay configured successfully");
94
+ if (this.config.debug) {
95
+ console.log("MonoscopeReplay configured successfully");
96
+ }
95
97
  }
96
98
  catch (error) {
97
99
  console.error("Failed to configure MonoscopeReplay:", error);
@@ -106,7 +108,9 @@ export class MonoscopeReplay {
106
108
  return;
107
109
  }
108
110
  if (this.events.length > MAX_RETRY_EVENTS) {
109
- console.warn(`Event queue exceeded ${MAX_RETRY_EVENTS}, dropping middle events (preserving snapshots)`);
111
+ if (this.config.debug) {
112
+ console.warn(`Event queue exceeded ${MAX_RETRY_EVENTS}, dropping middle events (preserving snapshots)`);
113
+ }
110
114
  // Find full snapshot events (type 2) - these are critical for replay
111
115
  const fullSnapshots = this.events.filter((e) => e.type === 2);
112
116
  const otherEvents = this.events.filter((e) => e.type !== 2);
@@ -155,7 +159,9 @@ export class MonoscopeReplay {
155
159
  if (!response.ok) {
156
160
  throw new Error(`Failed to save replay events: ${response.status} ${response.statusText}`);
157
161
  }
158
- console.log(`Successfully saved ${eventsToSend.length} replay events`);
162
+ if (this.config.debug) {
163
+ console.log(`Successfully saved ${eventsToSend.length} replay events`);
164
+ }
159
165
  }
160
166
  }
161
167
  catch (error) {
@@ -188,7 +194,9 @@ export class MonoscopeReplay {
188
194
  window.removeEventListener("pagehide", this.handleUnload);
189
195
  document.removeEventListener("visibilitychange", this.handleVisibilityChange);
190
196
  this.isConfigured = false;
191
- console.log("MonoscopeReplay stopped");
197
+ if (this.config.debug) {
198
+ console.log("MonoscopeReplay stopped");
199
+ }
192
200
  }
193
201
  getEventCount() {
194
202
  return this.events.length;
package/dist/types.d.ts CHANGED
@@ -9,6 +9,7 @@ export type MonoscopeConfig = {
9
9
  replayEventsBaseUrl?: string;
10
10
  enableNetworkEvents?: boolean;
11
11
  user?: MonoscopeUser;
12
+ debug?: boolean;
12
13
  };
13
14
  export type MonoscopeUser = {
14
15
  email?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@monoscopetech/browser",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",