@fogg/bug-reporter 1.0.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.
Files changed (50) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +114 -0
  3. package/dist/chunk-6TCI6T2U.cjs +45 -0
  4. package/dist/chunk-6TCI6T2U.cjs.map +1 -0
  5. package/dist/chunk-S2YRP4GT.js +22 -0
  6. package/dist/chunk-S2YRP4GT.js.map +1 -0
  7. package/dist/index.cjs +1963 -0
  8. package/dist/index.cjs.map +1 -0
  9. package/dist/index.d.cts +331 -0
  10. package/dist/index.d.ts +331 -0
  11. package/dist/index.js +1956 -0
  12. package/dist/index.js.map +1 -0
  13. package/dist/recording-ML63ZQ6A.cjs +120 -0
  14. package/dist/recording-ML63ZQ6A.cjs.map +1 -0
  15. package/dist/recording-YSR6IORT.js +118 -0
  16. package/dist/recording-YSR6IORT.js.map +1 -0
  17. package/dist/screenshot-F4W72WRK.js +176 -0
  18. package/dist/screenshot-F4W72WRK.js.map +1 -0
  19. package/dist/screenshot-FRAZAS6B.cjs +178 -0
  20. package/dist/screenshot-FRAZAS6B.cjs.map +1 -0
  21. package/dist/styles/index.css +495 -0
  22. package/dist/styles/index.css.map +1 -0
  23. package/dist/styles/index.d.cts +2 -0
  24. package/dist/styles/index.d.ts +2 -0
  25. package/docs/backend-local.md +16 -0
  26. package/docs/backend-s3.md +31 -0
  27. package/docs/browser-compatibility.md +8 -0
  28. package/docs/framework-cra.md +10 -0
  29. package/docs/framework-nextjs.md +16 -0
  30. package/docs/framework-remix.md +6 -0
  31. package/docs/framework-vite.md +21 -0
  32. package/docs/known-limitations.md +6 -0
  33. package/docs/quickstart.md +26 -0
  34. package/docs/security.md +9 -0
  35. package/examples/backend-local/README.md +11 -0
  36. package/examples/backend-local/package.json +13 -0
  37. package/examples/backend-local/src/server.mjs +31 -0
  38. package/examples/backend-s3-presign/README.md +14 -0
  39. package/examples/backend-s3-presign/package.json +13 -0
  40. package/examples/backend-s3-presign/src/server.mjs +53 -0
  41. package/examples/sandbox-vite/README.md +25 -0
  42. package/examples/sandbox-vite/index.html +12 -0
  43. package/examples/sandbox-vite/package-lock.json +1880 -0
  44. package/examples/sandbox-vite/package.json +24 -0
  45. package/examples/sandbox-vite/src/App.tsx +200 -0
  46. package/examples/sandbox-vite/src/main.tsx +10 -0
  47. package/examples/sandbox-vite/src/sandbox.css +74 -0
  48. package/examples/sandbox-vite/tsconfig.json +14 -0
  49. package/examples/sandbox-vite/vite.config.ts +9 -0
  50. package/package.json +93 -0
@@ -0,0 +1,331 @@
1
+ import * as react from 'react';
2
+ import { ComponentType, PropsWithChildren } from 'react';
3
+
4
+ type StorageMode = "s3-presigned" | "local-public" | "proxy";
5
+ type ReportEnvironment = "development" | "staging" | "production";
6
+ type AssetType = "screenshot" | "recording" | "attachment";
7
+ type FlowStep = "describe" | "screenshot" | "recording" | "review" | "submitting" | "success";
8
+ type DockSide = "left" | "right" | "top" | "bottom";
9
+ type LauncherPosition = "bottom-right" | "bottom-left" | "top-right" | "top-left";
10
+ type ThemeMode = "dark" | "light";
11
+ type FeatureFlags = {
12
+ screenshot?: boolean;
13
+ recording?: boolean;
14
+ annotations?: boolean;
15
+ consoleLogs?: boolean;
16
+ networkInfo?: boolean;
17
+ };
18
+ type ThemeConfig = {
19
+ primaryColor?: string;
20
+ position?: LauncherPosition;
21
+ zIndex?: number;
22
+ borderRadius?: string;
23
+ };
24
+ type StorageLimits = {
25
+ maxVideoSeconds?: number;
26
+ maxVideoBytes?: number;
27
+ maxScreenshotBytes?: number;
28
+ };
29
+ type UploadFile = {
30
+ id: string;
31
+ name: string;
32
+ type: AssetType;
33
+ mimeType: string;
34
+ size: number;
35
+ };
36
+ type UploadInstruction = {
37
+ id: string;
38
+ method: "PUT" | "POST";
39
+ uploadUrl: string;
40
+ headers?: Record<string, string>;
41
+ fields?: Record<string, string>;
42
+ key?: string;
43
+ publicUrl?: string;
44
+ type: AssetType;
45
+ };
46
+ type AssetReference = {
47
+ id: string;
48
+ type: AssetType;
49
+ url: string;
50
+ key?: string;
51
+ mimeType?: string;
52
+ size?: number;
53
+ };
54
+ interface StorageProvider {
55
+ prepareUploads(files: UploadFile[]): Promise<UploadInstruction[]>;
56
+ upload(instruction: UploadInstruction, blob: Blob, onProgress?: (progress: number) => void): Promise<AssetReference>;
57
+ }
58
+ type CapturedAsset = {
59
+ id: string;
60
+ type: AssetType;
61
+ blob: Blob;
62
+ previewUrl: string;
63
+ mimeType: string;
64
+ filename: string;
65
+ size: number;
66
+ };
67
+ type DiagnosticsSnapshot = {
68
+ url: string;
69
+ referrer: string;
70
+ timestamp: string;
71
+ timezone: string;
72
+ viewport: {
73
+ width: number;
74
+ height: number;
75
+ pixelRatio: number;
76
+ };
77
+ browser: string;
78
+ os: string;
79
+ language: string;
80
+ userAgent: string;
81
+ userAgentData?: {
82
+ brands?: Array<{
83
+ brand: string;
84
+ version: string;
85
+ }>;
86
+ mobile?: boolean;
87
+ platform?: string;
88
+ };
89
+ appVersion?: string;
90
+ environment?: ReportEnvironment;
91
+ projectId?: string;
92
+ logs?: ConsoleLogEntry[];
93
+ requests?: NetworkRequestEntry[];
94
+ navigationTiming?: {
95
+ domComplete?: number;
96
+ loadEventEnd?: number;
97
+ responseEnd?: number;
98
+ };
99
+ };
100
+ type ConsoleLogEntry = {
101
+ level: "log" | "info" | "warn" | "error";
102
+ message: string;
103
+ timestamp: string;
104
+ };
105
+ type DiagnosticsPreview = {
106
+ errorLogs: ConsoleLogEntry[];
107
+ failedRequests: NetworkRequestEntry[];
108
+ };
109
+ type NetworkRequestEntry = {
110
+ transport: "fetch" | "xhr";
111
+ method: string;
112
+ url: string;
113
+ status?: number;
114
+ ok?: boolean;
115
+ durationMs: number;
116
+ timestamp: string;
117
+ error?: string;
118
+ };
119
+ type ReportDraft = {
120
+ title: string;
121
+ description: string;
122
+ stepsToReproduce: string;
123
+ expectedBehavior: string;
124
+ actualBehavior: string;
125
+ };
126
+ type Reporter = {
127
+ id?: string;
128
+ name?: string;
129
+ email?: string;
130
+ role?: string;
131
+ ip?: string;
132
+ anonymous: boolean;
133
+ };
134
+ type CustomFormProps = {
135
+ attributes: Record<string, unknown>;
136
+ setAttributes: (next: Record<string, unknown>) => void;
137
+ updateAttribute: (key: string, value: unknown) => void;
138
+ };
139
+ type CustomFormComponent = ComponentType<CustomFormProps>;
140
+ type BugReportPayload = {
141
+ issue: {
142
+ title: string;
143
+ description: string;
144
+ projectId?: string;
145
+ environment?: ReportEnvironment;
146
+ appVersion?: string;
147
+ assets: AssetReference[];
148
+ };
149
+ context: {
150
+ url: string;
151
+ referrer: string;
152
+ timestamp: string;
153
+ timezone: string;
154
+ viewport: {
155
+ width: number;
156
+ height: number;
157
+ pixelRatio: number;
158
+ };
159
+ client: {
160
+ browser: string;
161
+ os: string;
162
+ language: string;
163
+ userAgent: string;
164
+ };
165
+ userAgentData?: DiagnosticsSnapshot["userAgentData"];
166
+ performance: {
167
+ navigationTiming?: DiagnosticsSnapshot["navigationTiming"];
168
+ };
169
+ logs?: ConsoleLogEntry[];
170
+ requests?: NetworkRequestEntry[];
171
+ };
172
+ reporter: Reporter;
173
+ attributes: Record<string, unknown>;
174
+ };
175
+ type BugReportResponse = {
176
+ id?: string;
177
+ message?: string;
178
+ [key: string]: unknown;
179
+ };
180
+ type BugReporterErrorCode = "VALIDATION_ERROR" | "CAPTURE_ERROR" | "RECORDING_ERROR" | "UPLOAD_ERROR" | "SUBMIT_ERROR" | "PERMISSION_DENIED" | "ABORTED";
181
+ declare class BugReporterError extends Error {
182
+ readonly code: BugReporterErrorCode;
183
+ readonly cause?: unknown;
184
+ constructor(code: BugReporterErrorCode, message: string, cause?: unknown);
185
+ }
186
+ type BugReporterConfig = {
187
+ apiEndpoint: string;
188
+ projectId?: string;
189
+ appVersion?: string;
190
+ environment?: ReportEnvironment;
191
+ storage?: {
192
+ mode: StorageMode;
193
+ s3?: {
194
+ presignEndpoint: string;
195
+ publicBaseUrl?: string;
196
+ };
197
+ local?: {
198
+ uploadEndpoint: string;
199
+ publicBaseUrl?: string;
200
+ };
201
+ proxy?: {
202
+ uploadEndpoint: string;
203
+ };
204
+ limits?: StorageLimits;
205
+ };
206
+ auth?: {
207
+ headers?: Record<string, string>;
208
+ withCredentials?: boolean;
209
+ };
210
+ theme?: ThemeConfig;
211
+ features?: FeatureFlags;
212
+ user?: {
213
+ id?: string;
214
+ email?: string;
215
+ name?: string;
216
+ role?: string;
217
+ ip?: string;
218
+ anonymous?: boolean;
219
+ };
220
+ attributes?: Record<string, unknown>;
221
+ privacy?: {
222
+ maskSelectors?: string[];
223
+ redactTextPatterns?: Array<string | RegExp>;
224
+ };
225
+ diagnostics?: {
226
+ consoleBufferSize?: number;
227
+ requestBufferSize?: number;
228
+ };
229
+ hooks?: {
230
+ beforeSubmit?: (payload: BugReportPayload) => Promise<BugReportPayload | null> | BugReportPayload | null;
231
+ onSuccess?: (response: BugReportResponse) => void;
232
+ onError?: (error: BugReporterError) => void;
233
+ };
234
+ };
235
+ type BugReporterState = {
236
+ isOpen: boolean;
237
+ dockSide: DockSide;
238
+ step: FlowStep;
239
+ draft: ReportDraft;
240
+ attributes: Record<string, unknown>;
241
+ assets: CapturedAsset[];
242
+ diagnostics?: DiagnosticsSnapshot;
243
+ uploadProgress: number;
244
+ isSubmitting: boolean;
245
+ error?: string;
246
+ };
247
+ type BugReporterContextValue = {
248
+ config: RequiredBugReporterConfig;
249
+ state: BugReporterState;
250
+ open: () => void;
251
+ close: () => void;
252
+ reset: () => void;
253
+ setDockSide: (dockSide: DockSide) => void;
254
+ setStep: (step: FlowStep) => void;
255
+ updateDraft: (next: Partial<ReportDraft>) => void;
256
+ setAttributes: (next: Record<string, unknown>) => void;
257
+ updateAttribute: (key: string, value: unknown) => void;
258
+ setScreenshot: (asset?: CapturedAsset) => void;
259
+ setRecording: (asset?: CapturedAsset) => void;
260
+ submit: () => Promise<void>;
261
+ retrySubmit: () => Promise<void>;
262
+ getDiagnosticsPreview: () => DiagnosticsPreview;
263
+ };
264
+ type RequiredBugReporterConfig = {
265
+ apiEndpoint: string;
266
+ projectId?: string;
267
+ appVersion?: string;
268
+ environment?: ReportEnvironment;
269
+ storage: {
270
+ mode: StorageMode;
271
+ s3?: {
272
+ presignEndpoint: string;
273
+ publicBaseUrl?: string;
274
+ };
275
+ local?: {
276
+ uploadEndpoint: string;
277
+ publicBaseUrl?: string;
278
+ };
279
+ proxy?: {
280
+ uploadEndpoint: string;
281
+ };
282
+ limits: Required<StorageLimits>;
283
+ };
284
+ auth: {
285
+ headers: Record<string, string>;
286
+ withCredentials: boolean;
287
+ };
288
+ theme: Required<ThemeConfig>;
289
+ features: Required<FeatureFlags>;
290
+ user?: {
291
+ id?: string;
292
+ email?: string;
293
+ name?: string;
294
+ role?: string;
295
+ ip?: string;
296
+ anonymous?: boolean;
297
+ };
298
+ attributes: Record<string, unknown>;
299
+ privacy: {
300
+ maskSelectors: string[];
301
+ redactTextPatterns: Array<string | RegExp>;
302
+ };
303
+ diagnostics: {
304
+ consoleBufferSize: number;
305
+ requestBufferSize: number;
306
+ };
307
+ hooks: {
308
+ beforeSubmit?: (payload: BugReportPayload) => Promise<BugReportPayload | null> | BugReportPayload | null;
309
+ onSuccess?: (response: BugReportResponse) => void;
310
+ onError?: (error: BugReporterError) => void;
311
+ };
312
+ };
313
+
314
+ type BugReporterProps = {
315
+ config: BugReporterConfig;
316
+ CustomForm?: CustomFormComponent;
317
+ launcherPosition?: LauncherPosition;
318
+ launcherText?: string;
319
+ themeMode?: ThemeMode;
320
+ buttonColor?: string;
321
+ };
322
+ declare function BugReporter({ config, CustomForm, launcherPosition, launcherText, themeMode, buttonColor }: BugReporterProps): react.JSX.Element;
323
+
324
+ type BugReporterProviderProps = PropsWithChildren<{
325
+ config: BugReporterConfig;
326
+ }>;
327
+ declare function BugReporterProvider({ config, children }: BugReporterProviderProps): react.JSX.Element;
328
+
329
+ declare function useBugReporter(): BugReporterContextValue;
330
+
331
+ export { type AssetReference, type BugReportPayload, type BugReportResponse, BugReporter, type BugReporterConfig, type BugReporterContextValue, BugReporterError, BugReporterProvider, type BugReporterState, type CapturedAsset, type CustomFormProps, type DiagnosticsSnapshot, type DockSide, type FeatureFlags, type LauncherPosition, type StorageMode, type StorageProvider, type ThemeConfig, type ThemeMode, type UploadFile, type UploadInstruction, useBugReporter };
@@ -0,0 +1,331 @@
1
+ import * as react from 'react';
2
+ import { ComponentType, PropsWithChildren } from 'react';
3
+
4
+ type StorageMode = "s3-presigned" | "local-public" | "proxy";
5
+ type ReportEnvironment = "development" | "staging" | "production";
6
+ type AssetType = "screenshot" | "recording" | "attachment";
7
+ type FlowStep = "describe" | "screenshot" | "recording" | "review" | "submitting" | "success";
8
+ type DockSide = "left" | "right" | "top" | "bottom";
9
+ type LauncherPosition = "bottom-right" | "bottom-left" | "top-right" | "top-left";
10
+ type ThemeMode = "dark" | "light";
11
+ type FeatureFlags = {
12
+ screenshot?: boolean;
13
+ recording?: boolean;
14
+ annotations?: boolean;
15
+ consoleLogs?: boolean;
16
+ networkInfo?: boolean;
17
+ };
18
+ type ThemeConfig = {
19
+ primaryColor?: string;
20
+ position?: LauncherPosition;
21
+ zIndex?: number;
22
+ borderRadius?: string;
23
+ };
24
+ type StorageLimits = {
25
+ maxVideoSeconds?: number;
26
+ maxVideoBytes?: number;
27
+ maxScreenshotBytes?: number;
28
+ };
29
+ type UploadFile = {
30
+ id: string;
31
+ name: string;
32
+ type: AssetType;
33
+ mimeType: string;
34
+ size: number;
35
+ };
36
+ type UploadInstruction = {
37
+ id: string;
38
+ method: "PUT" | "POST";
39
+ uploadUrl: string;
40
+ headers?: Record<string, string>;
41
+ fields?: Record<string, string>;
42
+ key?: string;
43
+ publicUrl?: string;
44
+ type: AssetType;
45
+ };
46
+ type AssetReference = {
47
+ id: string;
48
+ type: AssetType;
49
+ url: string;
50
+ key?: string;
51
+ mimeType?: string;
52
+ size?: number;
53
+ };
54
+ interface StorageProvider {
55
+ prepareUploads(files: UploadFile[]): Promise<UploadInstruction[]>;
56
+ upload(instruction: UploadInstruction, blob: Blob, onProgress?: (progress: number) => void): Promise<AssetReference>;
57
+ }
58
+ type CapturedAsset = {
59
+ id: string;
60
+ type: AssetType;
61
+ blob: Blob;
62
+ previewUrl: string;
63
+ mimeType: string;
64
+ filename: string;
65
+ size: number;
66
+ };
67
+ type DiagnosticsSnapshot = {
68
+ url: string;
69
+ referrer: string;
70
+ timestamp: string;
71
+ timezone: string;
72
+ viewport: {
73
+ width: number;
74
+ height: number;
75
+ pixelRatio: number;
76
+ };
77
+ browser: string;
78
+ os: string;
79
+ language: string;
80
+ userAgent: string;
81
+ userAgentData?: {
82
+ brands?: Array<{
83
+ brand: string;
84
+ version: string;
85
+ }>;
86
+ mobile?: boolean;
87
+ platform?: string;
88
+ };
89
+ appVersion?: string;
90
+ environment?: ReportEnvironment;
91
+ projectId?: string;
92
+ logs?: ConsoleLogEntry[];
93
+ requests?: NetworkRequestEntry[];
94
+ navigationTiming?: {
95
+ domComplete?: number;
96
+ loadEventEnd?: number;
97
+ responseEnd?: number;
98
+ };
99
+ };
100
+ type ConsoleLogEntry = {
101
+ level: "log" | "info" | "warn" | "error";
102
+ message: string;
103
+ timestamp: string;
104
+ };
105
+ type DiagnosticsPreview = {
106
+ errorLogs: ConsoleLogEntry[];
107
+ failedRequests: NetworkRequestEntry[];
108
+ };
109
+ type NetworkRequestEntry = {
110
+ transport: "fetch" | "xhr";
111
+ method: string;
112
+ url: string;
113
+ status?: number;
114
+ ok?: boolean;
115
+ durationMs: number;
116
+ timestamp: string;
117
+ error?: string;
118
+ };
119
+ type ReportDraft = {
120
+ title: string;
121
+ description: string;
122
+ stepsToReproduce: string;
123
+ expectedBehavior: string;
124
+ actualBehavior: string;
125
+ };
126
+ type Reporter = {
127
+ id?: string;
128
+ name?: string;
129
+ email?: string;
130
+ role?: string;
131
+ ip?: string;
132
+ anonymous: boolean;
133
+ };
134
+ type CustomFormProps = {
135
+ attributes: Record<string, unknown>;
136
+ setAttributes: (next: Record<string, unknown>) => void;
137
+ updateAttribute: (key: string, value: unknown) => void;
138
+ };
139
+ type CustomFormComponent = ComponentType<CustomFormProps>;
140
+ type BugReportPayload = {
141
+ issue: {
142
+ title: string;
143
+ description: string;
144
+ projectId?: string;
145
+ environment?: ReportEnvironment;
146
+ appVersion?: string;
147
+ assets: AssetReference[];
148
+ };
149
+ context: {
150
+ url: string;
151
+ referrer: string;
152
+ timestamp: string;
153
+ timezone: string;
154
+ viewport: {
155
+ width: number;
156
+ height: number;
157
+ pixelRatio: number;
158
+ };
159
+ client: {
160
+ browser: string;
161
+ os: string;
162
+ language: string;
163
+ userAgent: string;
164
+ };
165
+ userAgentData?: DiagnosticsSnapshot["userAgentData"];
166
+ performance: {
167
+ navigationTiming?: DiagnosticsSnapshot["navigationTiming"];
168
+ };
169
+ logs?: ConsoleLogEntry[];
170
+ requests?: NetworkRequestEntry[];
171
+ };
172
+ reporter: Reporter;
173
+ attributes: Record<string, unknown>;
174
+ };
175
+ type BugReportResponse = {
176
+ id?: string;
177
+ message?: string;
178
+ [key: string]: unknown;
179
+ };
180
+ type BugReporterErrorCode = "VALIDATION_ERROR" | "CAPTURE_ERROR" | "RECORDING_ERROR" | "UPLOAD_ERROR" | "SUBMIT_ERROR" | "PERMISSION_DENIED" | "ABORTED";
181
+ declare class BugReporterError extends Error {
182
+ readonly code: BugReporterErrorCode;
183
+ readonly cause?: unknown;
184
+ constructor(code: BugReporterErrorCode, message: string, cause?: unknown);
185
+ }
186
+ type BugReporterConfig = {
187
+ apiEndpoint: string;
188
+ projectId?: string;
189
+ appVersion?: string;
190
+ environment?: ReportEnvironment;
191
+ storage?: {
192
+ mode: StorageMode;
193
+ s3?: {
194
+ presignEndpoint: string;
195
+ publicBaseUrl?: string;
196
+ };
197
+ local?: {
198
+ uploadEndpoint: string;
199
+ publicBaseUrl?: string;
200
+ };
201
+ proxy?: {
202
+ uploadEndpoint: string;
203
+ };
204
+ limits?: StorageLimits;
205
+ };
206
+ auth?: {
207
+ headers?: Record<string, string>;
208
+ withCredentials?: boolean;
209
+ };
210
+ theme?: ThemeConfig;
211
+ features?: FeatureFlags;
212
+ user?: {
213
+ id?: string;
214
+ email?: string;
215
+ name?: string;
216
+ role?: string;
217
+ ip?: string;
218
+ anonymous?: boolean;
219
+ };
220
+ attributes?: Record<string, unknown>;
221
+ privacy?: {
222
+ maskSelectors?: string[];
223
+ redactTextPatterns?: Array<string | RegExp>;
224
+ };
225
+ diagnostics?: {
226
+ consoleBufferSize?: number;
227
+ requestBufferSize?: number;
228
+ };
229
+ hooks?: {
230
+ beforeSubmit?: (payload: BugReportPayload) => Promise<BugReportPayload | null> | BugReportPayload | null;
231
+ onSuccess?: (response: BugReportResponse) => void;
232
+ onError?: (error: BugReporterError) => void;
233
+ };
234
+ };
235
+ type BugReporterState = {
236
+ isOpen: boolean;
237
+ dockSide: DockSide;
238
+ step: FlowStep;
239
+ draft: ReportDraft;
240
+ attributes: Record<string, unknown>;
241
+ assets: CapturedAsset[];
242
+ diagnostics?: DiagnosticsSnapshot;
243
+ uploadProgress: number;
244
+ isSubmitting: boolean;
245
+ error?: string;
246
+ };
247
+ type BugReporterContextValue = {
248
+ config: RequiredBugReporterConfig;
249
+ state: BugReporterState;
250
+ open: () => void;
251
+ close: () => void;
252
+ reset: () => void;
253
+ setDockSide: (dockSide: DockSide) => void;
254
+ setStep: (step: FlowStep) => void;
255
+ updateDraft: (next: Partial<ReportDraft>) => void;
256
+ setAttributes: (next: Record<string, unknown>) => void;
257
+ updateAttribute: (key: string, value: unknown) => void;
258
+ setScreenshot: (asset?: CapturedAsset) => void;
259
+ setRecording: (asset?: CapturedAsset) => void;
260
+ submit: () => Promise<void>;
261
+ retrySubmit: () => Promise<void>;
262
+ getDiagnosticsPreview: () => DiagnosticsPreview;
263
+ };
264
+ type RequiredBugReporterConfig = {
265
+ apiEndpoint: string;
266
+ projectId?: string;
267
+ appVersion?: string;
268
+ environment?: ReportEnvironment;
269
+ storage: {
270
+ mode: StorageMode;
271
+ s3?: {
272
+ presignEndpoint: string;
273
+ publicBaseUrl?: string;
274
+ };
275
+ local?: {
276
+ uploadEndpoint: string;
277
+ publicBaseUrl?: string;
278
+ };
279
+ proxy?: {
280
+ uploadEndpoint: string;
281
+ };
282
+ limits: Required<StorageLimits>;
283
+ };
284
+ auth: {
285
+ headers: Record<string, string>;
286
+ withCredentials: boolean;
287
+ };
288
+ theme: Required<ThemeConfig>;
289
+ features: Required<FeatureFlags>;
290
+ user?: {
291
+ id?: string;
292
+ email?: string;
293
+ name?: string;
294
+ role?: string;
295
+ ip?: string;
296
+ anonymous?: boolean;
297
+ };
298
+ attributes: Record<string, unknown>;
299
+ privacy: {
300
+ maskSelectors: string[];
301
+ redactTextPatterns: Array<string | RegExp>;
302
+ };
303
+ diagnostics: {
304
+ consoleBufferSize: number;
305
+ requestBufferSize: number;
306
+ };
307
+ hooks: {
308
+ beforeSubmit?: (payload: BugReportPayload) => Promise<BugReportPayload | null> | BugReportPayload | null;
309
+ onSuccess?: (response: BugReportResponse) => void;
310
+ onError?: (error: BugReporterError) => void;
311
+ };
312
+ };
313
+
314
+ type BugReporterProps = {
315
+ config: BugReporterConfig;
316
+ CustomForm?: CustomFormComponent;
317
+ launcherPosition?: LauncherPosition;
318
+ launcherText?: string;
319
+ themeMode?: ThemeMode;
320
+ buttonColor?: string;
321
+ };
322
+ declare function BugReporter({ config, CustomForm, launcherPosition, launcherText, themeMode, buttonColor }: BugReporterProps): react.JSX.Element;
323
+
324
+ type BugReporterProviderProps = PropsWithChildren<{
325
+ config: BugReporterConfig;
326
+ }>;
327
+ declare function BugReporterProvider({ config, children }: BugReporterProviderProps): react.JSX.Element;
328
+
329
+ declare function useBugReporter(): BugReporterContextValue;
330
+
331
+ export { type AssetReference, type BugReportPayload, type BugReportResponse, BugReporter, type BugReporterConfig, type BugReporterContextValue, BugReporterError, BugReporterProvider, type BugReporterState, type CapturedAsset, type CustomFormProps, type DiagnosticsSnapshot, type DockSide, type FeatureFlags, type LauncherPosition, type StorageMode, type StorageProvider, type ThemeConfig, type ThemeMode, type UploadFile, type UploadInstruction, useBugReporter };