@diegotsi/flint-react 2.9.0 → 2.9.1
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 +46 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -71,6 +71,52 @@ Pass a `ThemeOverride` object to fine-tune colors:
|
|
|
71
71
|
| P3 | Medium — noticeable but workable |
|
|
72
72
|
| P4 | Low — cosmetic or improvement |
|
|
73
73
|
|
|
74
|
+
## Error monitoring
|
|
75
|
+
|
|
76
|
+
When you initialize the SDK, uncaught errors and unhandled promise rejections are
|
|
77
|
+
captured automatically and grouped by fingerprint on the server. They show up in
|
|
78
|
+
the admin's **Errors** page with occurrence trends, breadcrumbs (recent console
|
|
79
|
+
logs + failed requests), and resolve/ignore triage.
|
|
80
|
+
|
|
81
|
+
```tsx
|
|
82
|
+
import { Flint } from "@diegotsi/flint-react"
|
|
83
|
+
|
|
84
|
+
Flint.init({
|
|
85
|
+
projectKey: "your-project-api-key",
|
|
86
|
+
serverUrl: "https://your-flint-server.com",
|
|
87
|
+
release: "v1.2.3", // enables regression detection and source maps
|
|
88
|
+
})
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Capture is on by default and storm-safe: per-error throttling (10/min),
|
|
92
|
+
in-batch dedup, a per-page cap, secret redaction, and a built-in ignore list
|
|
93
|
+
(`Script error.`, ResizeObserver noise, browser-extension frames). Events are
|
|
94
|
+
flushed in batches and via `sendBeacon` on page unload.
|
|
95
|
+
|
|
96
|
+
| Option | Default | Description |
|
|
97
|
+
|--------|---------|-------------|
|
|
98
|
+
| `enableErrorMonitoring` | `true` | Turn automatic capture off entirely |
|
|
99
|
+
| `errorMonitoring.sampleRate` | `1.0` | Fraction of captured errors to report (0–1) |
|
|
100
|
+
| `errorMonitoring.ignoreErrors` | — | `(string \| RegExp)[]` matched against the message; matches are dropped |
|
|
101
|
+
| `errorMonitoring.beforeSend` | — | `(event) => event \| null` — scrub fields or drop the event |
|
|
102
|
+
|
|
103
|
+
Server-side, projects can also define ignore rules (Errors page → "Ignore
|
|
104
|
+
rules") that drop matching events at ingest.
|
|
105
|
+
|
|
106
|
+
### Source maps
|
|
107
|
+
|
|
108
|
+
Errors arrive with minified stacks. Upload each bundle's source map after a
|
|
109
|
+
deploy and the admin shows the original frames (with a raw toggle):
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
curl -X POST -H "X-Project-Key: $FLINT_KEY" \
|
|
113
|
+
--data-binary @dist/assets/index-9f3a.js.map \
|
|
114
|
+
"https://your-flint-server.com/api/v1/sourcemaps?release=v1.2.3&file=index-9f3a.js"
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
`release` must match the value passed to `Flint.init`; `file` is the bundle's
|
|
118
|
+
basename, which is how stack frames are matched to their map.
|
|
119
|
+
|
|
74
120
|
## Development
|
|
75
121
|
|
|
76
122
|
```bash
|