@betterbugs/web-sdk 0.0.43 → 0.0.45
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 +81 -2
- package/index.js +1 -1
- package/package.json +1 -1
- package/recorder.js +1 -1
- package/types/index.d.ts +45 -0
- package/types/loginData.d.ts +3 -0
- package/types/user.d.ts +19 -0
package/types/index.d.ts
CHANGED
|
@@ -30,6 +30,21 @@ declare module '@betterbugs/web-sdk' {
|
|
|
30
30
|
descriptionFieldPlaceholder?: string;
|
|
31
31
|
metaData?: Record<string | number, string | number | null>;
|
|
32
32
|
// captureRewindOnScreenshot?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* How a screen recording is captured.
|
|
35
|
+
*
|
|
36
|
+
* - `recordVideo` — real video via `MediaRecorder`. Supported on every
|
|
37
|
+
* desktop browser: WebM on Chrome, Edge, Opera, Brave and Firefox, MP4 on
|
|
38
|
+
* Safari. **Not** available on mobile, where no browser implements
|
|
39
|
+
* `getDisplayMedia`.
|
|
40
|
+
* - `domRecord` — rrweb DOM replay. Works everywhere, including mobile.
|
|
41
|
+
*
|
|
42
|
+
* Set explicitly and the SDK honours it as given, warning in the console if
|
|
43
|
+
* the browser can't support it. Leave it unset and the SDK picks the best
|
|
44
|
+
* mode the current browser can actually deliver.
|
|
45
|
+
*
|
|
46
|
+
* @default `recordVideo` where supported, otherwise `domRecord`
|
|
47
|
+
*/
|
|
33
48
|
recordType?: 'recordVideo' | 'domRecord';
|
|
34
49
|
// bugSuccessComponent?: React.ReactNode | string;
|
|
35
50
|
successMessageHeaderText?: string;
|
|
@@ -50,6 +65,36 @@ declare module '@betterbugs/web-sdk' {
|
|
|
50
65
|
actionButtonComponent?: React.ReactNode | string;
|
|
51
66
|
disableScreenshot?: boolean;
|
|
52
67
|
disableRecording?: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Require the reporter to attach media before the bug can be submitted.
|
|
70
|
+
* A screenshot **or** a screen recording satisfies it; file attachments do
|
|
71
|
+
* not. When nothing is captured, submitting shows an inline error next to
|
|
72
|
+
* the evidence buttons instead of sending the report.
|
|
73
|
+
*
|
|
74
|
+
* Has no effect if both `disableScreenshot` and `disableRecording` are
|
|
75
|
+
* `true` — there would be no way to satisfy it, so the SDK warns and
|
|
76
|
+
* leaves media optional.
|
|
77
|
+
*
|
|
78
|
+
* @default false
|
|
79
|
+
*/
|
|
80
|
+
mediaRequired?: boolean;
|
|
81
|
+
/**
|
|
82
|
+
* Capture screenshots from the browser's own rendered pixels
|
|
83
|
+
* (`getDisplayMedia`) rather than by re-rendering the DOM. Far more
|
|
84
|
+
* accurate — cross-origin iframes, video, WebGL and modern CSS all come
|
|
85
|
+
* out correct — at the cost of one permission prompt per capture.
|
|
86
|
+
*
|
|
87
|
+
* Available on all desktop browsers. Chromium shares this tab directly;
|
|
88
|
+
* Safari and Firefox have no tab surface to offer, so the user shares a
|
|
89
|
+
* screen or window and the SDK crops the viewport out of it — which means
|
|
90
|
+
* an extra click in the picker, and an automatic fall back to DOM
|
|
91
|
+
* rendering if the viewport cannot be located reliably. Mobile has no
|
|
92
|
+
* screen capture at all and always uses DOM rendering.
|
|
93
|
+
*
|
|
94
|
+
* Set to `false` to always use DOM rendering and never prompt.
|
|
95
|
+
* @default true
|
|
96
|
+
*/
|
|
97
|
+
preferNativeCapture?: boolean;
|
|
53
98
|
}
|
|
54
99
|
|
|
55
100
|
export interface BugReportData {
|
package/types/loginData.d.ts
CHANGED
|
@@ -12,6 +12,9 @@ export interface LoginSuccessResponseLimits {
|
|
|
12
12
|
export interface LoginSuccessResponse {
|
|
13
13
|
id: string;
|
|
14
14
|
projectId: string;
|
|
15
|
+
// Returned by /sdk/auth/verify-api-key alongside the key's project. Optional
|
|
16
|
+
// so older API deployments that omit it stay type-safe.
|
|
17
|
+
workspaceId?: string;
|
|
15
18
|
subscriptionPlanId?: string;
|
|
16
19
|
limits?: LoginSuccessResponseLimits;
|
|
17
20
|
}
|
package/types/user.d.ts
CHANGED
|
@@ -8,3 +8,22 @@ export interface UserObject {
|
|
|
8
8
|
createdAt: string;
|
|
9
9
|
updatedAt: string;
|
|
10
10
|
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* A project/workspace member as returned by `GET /sdk/user`. Deliberately not
|
|
14
|
+
* `UserObject`: that endpoint returns a narrow projection (no status /
|
|
15
|
+
* lastLogin / isDeleted) plus avatar fields the full user record lacks.
|
|
16
|
+
*/
|
|
17
|
+
export interface MemberObject {
|
|
18
|
+
id: string;
|
|
19
|
+
name?: string;
|
|
20
|
+
email?: string;
|
|
21
|
+
/** S3 key, or an absolute URL for OAuth profile pictures. */
|
|
22
|
+
image?: string;
|
|
23
|
+
role?: string;
|
|
24
|
+
/** Server-assigned colours for the initials fallback. */
|
|
25
|
+
avatarColor?: {
|
|
26
|
+
bgColor?: string;
|
|
27
|
+
color?: string;
|
|
28
|
+
};
|
|
29
|
+
}
|