@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/README.md +15 -45
- package/dist/bugspotter.min.js +1 -1
- package/dist/bugspotter.min.js.map +1 -1
- package/dist/core/bug-reporter.js +6 -4
- package/dist/index.d.ts +5 -7
- package/dist/index.esm.js +17 -16
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +7 -4
- package/dist/utils/config-validator.d.ts +2 -3
- package/dist/utils/config-validator.js +3 -7
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/eslint.config.js +7 -0
- package/package.json +1 -1
- package/release_notes.md +1 -1
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
|
|
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
|
-
//
|
|
158
|
-
if (!(
|
|
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.
|
|
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
|
-
|
|
8
|
+
apiKey?: string;
|
|
10
9
|
}
|
|
11
10
|
/**
|
|
12
|
-
* Validate
|
|
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
|
|
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.
|
|
24
|
-
throw new Error('API key
|
|
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
package/dist/version.js
CHANGED
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.
|
|
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