@fixback/sdk 0.3.0 → 0.4.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.
- package/README.md +11 -10
- package/dist/annotation.d.ts +1 -1
- package/dist/boot.d.ts +6 -0
- package/dist/error-capture.d.ts +31 -1
- package/dist/fixback.umd.js +109 -62
- package/dist/fixback.umd.js.map +1 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.mjs +4868 -1824
- package/dist/index.mjs.map +1 -1
- package/dist/init.d.ts +21 -1
- package/dist/launcher.d.ts +2 -2
- package/dist/overlay-styles.d.ts +1 -1
- package/dist/overlay.d.ts +12 -0
- package/dist/replay.d.ts +101 -0
- package/dist/report.d.ts +47 -5
- package/dist/styles.d.ts +2 -2
- package/dist/submit.d.ts +8 -0
- package/dist/version.d.ts +1 -1
- package/package.json +3 -1
package/README.md
CHANGED
|
@@ -8,9 +8,9 @@ launcher **only when it would**. Nothing renders when the origin isn't
|
|
|
8
8
|
allowlisted or the Gate turns the visitor away, and if Fixback can't be reached
|
|
9
9
|
the SDK stays completely silent — it never throws into the host page.
|
|
10
10
|
|
|
11
|
-
Activating the launcher opens the **report overlay**: the Reporter
|
|
12
|
-
**
|
|
13
|
-
|
|
11
|
+
Activating the launcher opens the **report overlay**: the Reporter writes a
|
|
12
|
+
comment, optionally **points at the element** they mean, and hits **Send** —
|
|
13
|
+
which captures a **masked screenshot**
|
|
14
14
|
of the current view, assembles the annotation, and submits it to Fixback. A
|
|
15
15
|
successful send shows a confirmation; a refusal or an unreachable Fixback fails
|
|
16
16
|
quietly, leaving the host page untouched.
|
|
@@ -79,11 +79,12 @@ fixback.destroy();
|
|
|
79
79
|
|
|
80
80
|
The launcher is a bottom-right **Feedback** pill, and it stays out of the way:
|
|
81
81
|
|
|
82
|
-
- **Hover-peek & tuck-away** — the pill's
|
|
83
|
-
small edge nub
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
the
|
|
82
|
+
- **Hover-peek & tuck-away** — the pill's chevron tucks it off-screen to the
|
|
83
|
+
right behind a small edge nub, pointing **right** to tuck away and flipping to
|
|
84
|
+
point **left** while tucked. Hovering the bottom-right corner (or the nub)
|
|
85
|
+
peeks it back, where clicking that same chevron — or the nub, or pressing
|
|
86
|
+
Enter/Space on the nub — restores the launcher, which also covers pointers that
|
|
87
|
+
can't hover (touch, keyboard).
|
|
87
88
|
- **First-visit welcome** — a one-time toast greets a new visitor, drawing the
|
|
88
89
|
eye with a gentle pulse. It shows once per publishable key per browser.
|
|
89
90
|
- **Reduce motion** — pass `reduceMotion: true` to still the pulse and the
|
|
@@ -111,8 +112,8 @@ document.addEventListener(LAUNCH_EVENT, () => {
|
|
|
111
112
|
|
|
112
113
|
The SDK's signature capability: **errors report themselves, with no prompt.** Two
|
|
113
114
|
capture-phase global handlers (`error` + `unhandledrejection`) turn uncaught
|
|
114
|
-
exceptions and unhandled promise rejections into `source: auto
|
|
115
|
-
|
|
115
|
+
exceptions and unhandled promise rejections into `source: auto` Feedback
|
|
116
|
+
(classified `Kind = bug` server-side) for the current session's reporter — carrying the same masked screenshot
|
|
116
117
|
and trace buffer a manual report does, plus a per-session fingerprint. It is
|
|
117
118
|
**on by default across every Gate**; pass `autoCapture: false` to turn it off.
|
|
118
119
|
|
package/dist/annotation.d.ts
CHANGED
|
@@ -66,7 +66,7 @@ export type Mark = ArrowMark | BoxMark | PenMark | TextMark;
|
|
|
66
66
|
/**
|
|
67
67
|
* The structured Annotation carried on a report's content (spec §D): the three
|
|
68
68
|
* optional layers. Every field is optional — a report may carry any subset or
|
|
69
|
-
* none (a bare
|
|
69
|
+
* none (a bare comment is a valid Send).
|
|
70
70
|
*/
|
|
71
71
|
export interface Annotation {
|
|
72
72
|
readonly element?: SelectedElement;
|
package/dist/boot.d.ts
CHANGED
|
@@ -37,6 +37,12 @@ export interface BootRequest extends IdentityInputs {
|
|
|
37
37
|
export interface CaptureConfig {
|
|
38
38
|
readonly console: boolean;
|
|
39
39
|
readonly network: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* The Project's session-replay toggle (issue #189, ADR-0024). Optional on the
|
|
42
|
+
* wire: a server predating replay omits it, which — like the other streams —
|
|
43
|
+
* means **capture on**.
|
|
44
|
+
*/
|
|
45
|
+
readonly replay?: boolean;
|
|
40
46
|
}
|
|
41
47
|
/**
|
|
42
48
|
* The boot answer: whether this origin is allowlisted, the Project's Gate, the
|
package/dist/error-capture.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*
|
|
6
6
|
* Exactly **two capture-phase listeners** (`window` `error` +
|
|
7
7
|
* `unhandledrejection`) turn uncaught exceptions and unhandled rejections into
|
|
8
|
-
* `source: auto
|
|
8
|
+
* `source: auto` Feedback (stamped `Kind = bug` server-side, ADR-0023) for the current session's Reporter — no
|
|
9
9
|
* native-API monkeypatching, no library. Each firing is deduped by a per-session
|
|
10
10
|
* fingerprint, rate-limited by a token-bucket burst limiter and a per-session cap,
|
|
11
11
|
* scrubbed through the same `beforeSend` choke point as manual reports (§C), and
|
|
@@ -26,6 +26,9 @@
|
|
|
26
26
|
*/
|
|
27
27
|
import type { IdentityInputs } from "./boot";
|
|
28
28
|
import { type BreadcrumbBuffer, type Teardown } from "./breadcrumbs";
|
|
29
|
+
import type { ReporterDisplay } from "./invite";
|
|
30
|
+
import { type CapturedFrame } from "./report";
|
|
31
|
+
import type { ReplaySource } from "./replay";
|
|
29
32
|
import { type BeforeSend } from "./scrub";
|
|
30
33
|
import { type Capture, type CaptureOptions } from "./screenshot";
|
|
31
34
|
import { type SubmitInput, type SubmitResult } from "./submit";
|
|
@@ -57,6 +60,15 @@ export declare function hashString(input: string): string;
|
|
|
57
60
|
* a session. Returns `""` when there is no usable stack (message-only fallback).
|
|
58
61
|
*/
|
|
59
62
|
export declare function extractTopFrames(stack: string | undefined, limit?: number): string;
|
|
63
|
+
/**
|
|
64
|
+
* Extract **structured** frames from a stack for the wire (#117, ADR-0024) —
|
|
65
|
+
* unlike {@link extractTopFrames} (a compact fingerprint signature that drops the
|
|
66
|
+
* origin), these keep the full script URL, because server-side symbolication
|
|
67
|
+
* matches it against uploaded sourcemap paths. URLs are scrubbed (query dropped,
|
|
68
|
+
* PII redacted) before they leave the page; unlocatable frames (`native`,
|
|
69
|
+
* `<anonymous>`, eval) are skipped; the count is capped.
|
|
70
|
+
*/
|
|
71
|
+
export declare function extractStructuredFrames(stack: string | undefined, limit?: number): CapturedFrame[];
|
|
60
72
|
/**
|
|
61
73
|
* The per-session fingerprint (research §7.2):
|
|
62
74
|
* `hash(errorType + "|" + normalize(value) + "|" + topFrames)`. Stack frames
|
|
@@ -95,13 +107,31 @@ export interface AutoCaptureConfig {
|
|
|
95
107
|
readonly apiUrl: string;
|
|
96
108
|
readonly key: string;
|
|
97
109
|
readonly identity?: IdentityInputs;
|
|
110
|
+
/**
|
|
111
|
+
* The Reporter's self-provided display name / email (spec §F). Carried on
|
|
112
|
+
* auto-captured Feedback too, so a machine-filed crash still names whose session it
|
|
113
|
+
* was — display only, never a trust signal.
|
|
114
|
+
*/
|
|
115
|
+
readonly display?: ReporterDisplay;
|
|
98
116
|
/** The window whose global handlers are installed. Defaults to `window`. */
|
|
99
117
|
readonly win?: Window;
|
|
100
118
|
/** The document used for capture + environment. Defaults to the window's. */
|
|
101
119
|
readonly doc?: Document;
|
|
102
120
|
readonly sdkVersion?: string;
|
|
121
|
+
/**
|
|
122
|
+
* The host app's **Release** (#117, ADR-0024) — already validated by `init`
|
|
123
|
+
* (`normaliseRelease`). Stamped into every auto report's environment so the
|
|
124
|
+
* server can symbolicate the captured frames against this build's sourcemaps.
|
|
125
|
+
*/
|
|
126
|
+
readonly release?: string;
|
|
103
127
|
/** The shared trace buffer; the failing error is added to it before filing. */
|
|
104
128
|
readonly buffer?: BreadcrumbBuffer | null;
|
|
129
|
+
/**
|
|
130
|
+
* The shared replay recorder (ADR-0024); the buffered window rides on a rich
|
|
131
|
+
* first report — the moment before an uncaught error is exactly what replay
|
|
132
|
+
* exists to show. Light count-update flushes never re-send it.
|
|
133
|
+
*/
|
|
134
|
+
readonly replay?: ReplaySource | null;
|
|
105
135
|
/** Per-project client scrub hook, run at the `beforeSend` choke point (§C). */
|
|
106
136
|
readonly beforeSend?: BeforeSend;
|
|
107
137
|
/** Run the built-in default scrubbers. Defaults to `true` (private-by-default). */
|