@bugspotter/sdk 2.0.0 → 2.0.5

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/index.js CHANGED
@@ -149,17 +149,20 @@ class BugSpotter {
149
149
  * Fetches replay settings from backend before initialization
150
150
  */
151
151
  static async createInstance(config) {
152
- var _a, _b, _c;
152
+ var _a, _b;
153
153
  // Fetch replay quality settings from backend if replay is enabled
154
154
  let backendSettings = null;
155
155
  const replayEnabled = (_b = (_a = config.replay) === null || _a === void 0 ? void 0 : _a.enabled) !== null && _b !== void 0 ? _b : true;
156
156
  if (replayEnabled && config.endpoint) {
157
- // Validate auth is configured before attempting fetch
158
- if (!((_c = config.auth) === null || _c === void 0 ? void 0 : _c.apiKey)) {
157
+ // SECURITY: Don't send API key over insecure connection
158
+ if (!(0, url_helpers_1.isSecureEndpoint)(config.endpoint)) {
159
+ logger.warn('Insecure endpoint — skipping backend settings fetch to protect API key.');
160
+ }
161
+ else if (!config.apiKey) {
159
162
  logger.warn('Endpoint provided but no API key configured. Skipping backend settings fetch.');
160
163
  }
161
164
  else {
162
- backendSettings = await fetchReplaySettings(config.endpoint, config.auth.apiKey);
165
+ backendSettings = await fetchReplaySettings(config.endpoint, config.apiKey);
163
166
  }
164
167
  }
165
168
  // Merge backend settings with user config (user config takes precedence)
@@ -2,14 +2,13 @@
2
2
  * Configuration Validation Utilities
3
3
  * Validates BugSpotter configuration before use
4
4
  */
5
- import type { AuthConfig } from '../core/transport';
6
5
  import type { DeduplicationConfig } from './deduplicator';
7
6
  export interface ValidationContext {
8
7
  endpoint?: string;
9
- auth?: AuthConfig;
8
+ apiKey?: string;
10
9
  }
11
10
  /**
12
- * Validate authentication configuration
11
+ * Validate configuration before submitting a bug report
13
12
  * @throws Error if configuration is invalid
14
13
  */
15
14
  export declare function validateAuthConfig(context: ValidationContext): void;
@@ -8,7 +8,7 @@ exports.validateAuthConfig = validateAuthConfig;
8
8
  exports.validateDeduplicationConfig = validateDeduplicationConfig;
9
9
  const url_helpers_1 = require("./url-helpers");
10
10
  /**
11
- * Validate authentication configuration
11
+ * Validate configuration before submitting a bug report
12
12
  * @throws Error if configuration is invalid
13
13
  */
14
14
  function validateAuthConfig(context) {
@@ -16,15 +16,11 @@ function validateAuthConfig(context) {
16
16
  throw new Error('No endpoint configured for bug report submission');
17
17
  }
18
18
  // SECURITY: Ensure endpoint uses HTTPS
19
- // This prevents credentials and sensitive data from being sent over plain HTTP
20
19
  if (!(0, url_helpers_1.isSecureEndpoint)(context.endpoint)) {
21
20
  throw new url_helpers_1.InsecureEndpointError(context.endpoint);
22
21
  }
23
- if (!context.auth) {
24
- throw new Error('API key authentication is required');
25
- }
26
- if (!context.auth.apiKey) {
27
- throw new Error('API key is required in auth configuration');
22
+ if (!context.apiKey) {
23
+ throw new Error('API key is required');
28
24
  }
29
25
  }
30
26
  /**
package/dist/version.d.ts CHANGED
@@ -5,4 +5,4 @@
5
5
  * This file is automatically generated during the build process.
6
6
  * To update the version, modify package.json
7
7
  */
8
- export declare const VERSION = "2.0.0";
8
+ export declare const VERSION = "2.0.5";
package/dist/version.js CHANGED
@@ -8,4 +8,4 @@
8
8
  */
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.VERSION = void 0;
11
- exports.VERSION = '2.0.0';
11
+ exports.VERSION = '2.0.5';
package/eslint.config.js CHANGED
@@ -62,6 +62,13 @@ export default [
62
62
  Console: 'readonly',
63
63
  BlobPart: 'readonly',
64
64
  BodyInit: 'readonly',
65
+ RequestInfo: 'readonly',
66
+ RequestInit: 'readonly',
67
+ MutationObserver: 'readonly',
68
+ MutationRecord: 'readonly',
69
+ DocumentFragment: 'readonly',
70
+ performance: 'readonly',
71
+ atob: 'readonly',
65
72
  },
66
73
  },
67
74
  plugins: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bugspotter/sdk",
3
- "version": "2.0.0",
3
+ "version": "2.0.5",
4
4
  "description": "Professional bug reporting SDK with screenshots, session replay, and automatic error capture for web applications",
5
5
  "packageManager": "pnpm@9.15.0",
6
6
  "main": "dist/index.js",
package/release_notes.md CHANGED
@@ -1,4 +1,4 @@
1
- ## Release 2.0.0
1
+ ## Release 2.0.5
2
2
 
3
3
  ### Changes
4
4