@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 CHANGED
@@ -23,7 +23,7 @@ pnpm add @bugspotter/sdk
23
23
 
24
24
  ```html
25
25
  <!-- BugSpotter CDN (versioned - recommended for production) -->
26
- <script src="https://cdn.bugspotter.io/sdk/bugspotter-1.0.0.min.js"></script>
26
+ <script src="https://cdn.bugspotter.io/sdk/bugspotter-2.0.0.min.js"></script>
27
27
 
28
28
  <!-- Latest version (for development only) -->
29
29
  <script src="https://cdn.bugspotter.io/sdk/bugspotter-latest.min.js"></script>
@@ -57,12 +57,8 @@ import BugSpotter from '@bugspotter/sdk';
57
57
 
58
58
  // Initialize with auto-widget (note: init is async)
59
59
  const bugSpotter = await BugSpotter.init({
60
- endpoint: 'https://api.bugspotter.com/api/v1/reports',
61
- auth: {
62
- type: 'api-key',
63
- apiKey: 'bgs_your_api_key',
64
- projectId: 'your-project-uuid',
65
- },
60
+ endpoint: 'https://api.bugspotter.com',
61
+ apiKey: 'bgs_your_api_key',
66
62
  showWidget: true,
67
63
  });
68
64
  ```
@@ -73,12 +69,8 @@ const bugSpotter = await BugSpotter.init({
73
69
  const BugSpotter = require('@bugspotter/sdk');
74
70
 
75
71
  const bugSpotter = await BugSpotter.init({
76
- endpoint: 'https://api.bugspotter.com/api/v1/reports',
77
- auth: {
78
- type: 'api-key',
79
- apiKey: 'bgs_your_api_key',
80
- projectId: 'your-project-uuid',
81
- },
72
+ endpoint: 'https://api.bugspotter.com',
73
+ apiKey: 'bgs_your_api_key',
82
74
  showWidget: true,
83
75
  });
84
76
  ```
@@ -91,12 +83,8 @@ const bugSpotter = await BugSpotter.init({
91
83
  // Initialize with auto-widget
92
84
  (async () => {
93
85
  const bugSpotter = await BugSpotter.init({
94
- endpoint: 'https://api.bugspotter.com/api/v1/reports',
95
- auth: {
96
- type: 'api-key',
97
- apiKey: 'bgs_your_api_key',
98
- projectId: 'your-project-uuid',
99
- },
86
+ endpoint: 'https://api.bugspotter.com',
87
+ apiKey: 'bgs_your_api_key',
100
88
  showWidget: true,
101
89
  });
102
90
  })();
@@ -112,12 +100,8 @@ import BugSpotter from '@bugspotter/sdk';
112
100
 
113
101
  // 1. Initialize SDK with required auth
114
102
  const bugSpotter = await BugSpotter.init({
115
- endpoint: 'https://api.bugspotter.com/api/v1/reports',
116
- auth: {
117
- type: 'api-key',
118
- apiKey: 'bgs_your_api_key',
119
- projectId: 'your-project-uuid', // Required for file uploads
120
- },
103
+ endpoint: 'https://api.bugspotter.com',
104
+ apiKey: 'bgs_your_api_key',
121
105
  showWidget: true,
122
106
  });
123
107
 
@@ -142,12 +126,8 @@ const bugSpotter = await BugSpotter.init({
142
126
  ```javascript
143
127
  // Initialize without widget
144
128
  const bugSpotter = await BugSpotter.init({
145
- endpoint: 'https://api.bugspotter.com/api/v1/reports',
146
- auth: {
147
- type: 'api-key',
148
- apiKey: 'bgs_your_api_key',
149
- projectId: 'your-project-uuid',
150
- },
129
+ endpoint: 'https://api.bugspotter.com',
130
+ apiKey: 'bgs_your_api_key',
151
131
  showWidget: false,
152
132
  });
153
133
 
@@ -177,12 +157,8 @@ await bugSpotter.submit({
177
157
  ```javascript
178
158
  // Widget appears automatically with showWidget: true
179
159
  const bugSpotter = await BugSpotter.init({
180
- endpoint: 'https://api.bugspotter.com/api/v1/reports',
181
- auth: {
182
- type: 'api-key',
183
- apiKey: 'bgs_your_api_key',
184
- projectId: 'your-project-uuid',
185
- },
160
+ endpoint: 'https://api.bugspotter.com',
161
+ apiKey: 'bgs_your_api_key',
186
162
  showWidget: true,
187
163
  widgetOptions: {
188
164
  position: 'bottom-right',
@@ -283,13 +259,8 @@ Initialize the SDK. **This method is async** to support fetching backend-control
283
259
 
284
260
  ```typescript
285
261
  interface BugSpotterConfig {
286
- endpoint: string; // Required: Backend API URL
287
- auth: {
288
- // Required: Authentication configuration
289
- type: 'api-key';
290
- apiKey: string; // API key (bgs_...)
291
- projectId: string; // Project UUID (required for file uploads)
292
- };
262
+ apiKey: string; // Required: API key (bgs_...)
263
+ endpoint?: string; // Base URL of BugSpotter API (e.g., https://api.example.com)
293
264
  showWidget?: boolean; // Auto-show widget (default: true)
294
265
  widgetOptions?: FloatingButtonOptions;
295
266
  replay?: {
@@ -492,7 +463,6 @@ new DirectUploader(config: DirectUploadConfig)
492
463
  interface DirectUploadConfig {
493
464
  apiEndpoint: string; // Backend API URL
494
465
  apiKey: string; // bgs_... API key
495
- projectId: string; // Project UUID
496
466
  bugId: string; // Bug report UUID
497
467
  }
498
468
  ```