Skip to content

Commit 4e541c5

Browse files
committed
feat: add Bugsnag error reporting service
Initialize Bugsnag SDK for error reporting. Reads configuration from environment variables.
1 parent cce4863 commit 4e541c5

7 files changed

Lines changed: 313 additions & 12 deletions

File tree

.env.example

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,22 @@ VITE_DEFAULT_REMOTE_COMPONENT_LIBRARY_BETA=<boolean>
3434

3535
# Dev Tools
3636
VITE_ENABLE_DEBUG_MODE=<boolean>
37+
38+
# =============================================================================
39+
# BUGSNAG ERROR REPORTING (OPTIONAL)
40+
# =============================================================================
41+
# Bugsnag error reporting is disabled by default. To enable, set your API key
42+
# below.
43+
44+
# Required: Your Bugsnag API key
45+
# Get this from your Bugsnag project settings
46+
# VITE_BUGSNAG_API_KEY=
47+
48+
# Optional: Custom endpoints (defaults to Bugsnag)
49+
# VITE_BUGSNAG_NOTIFY_ENDPOINT=https://notify.bugsnag.com
50+
# VITE_BUGSNAG_SESSIONS_ENDPOINT=https://sessions.bugsnag.com
51+
52+
# Optional: Custom grouping key for metadata
53+
# If set, the normalized error message will also be added to metadata.custom[key]
54+
# Useful for integration with platforms that use custom grouping keys
55+
# VITE_BUGSNAG_CUSTOM_GROUPING_KEY=

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,14 @@ If you find you are blocked by CORS, you will, for now, need to use the manual s
5454

5555
If you complete these steps the app will launch on `127.0.0.1:8000` with the latest build you've created on the frontend.
5656

57+
### Reporting errors to Bugsnag (Optional)
58+
59+
To enable error reporting, add your API key to your `.env` file:
60+
61+
```bash
62+
VITE_BUGSNAG_API_KEY=your-api-key
63+
```
64+
5765
## App features:
5866

5967
- Build and edit pipelines using drag and drop visual editor

package-lock.json

Lines changed: 159 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@
4949
"hydrate-component-library": "tsx scripts/hydrate-component-library.ts public/component_library.original.yaml public/component_library.yaml"
5050
},
5151
"dependencies": {
52+
"@bugsnag/js": "^8.8.1",
53+
"@bugsnag/plugin-react": "^8.8.0",
5254
"@dnd-kit/core": "^6.3.1",
5355
"@hey-api/client-fetch": "^0.13.1",
5456
"@hyperjump/browser": "^1.3.1",

src/index.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ import ReactDOM from "react-dom/client";
88
import { scan } from "react-scan";
99

1010
import { router } from "./routes/router";
11+
import { initializeBugsnag } from "./services/errorManagement/bugsnag";
12+
13+
// Initialize error reporting early
14+
initializeBugsnag();
1115

1216
const queryClient = new QueryClient();
1317

0 commit comments

Comments
 (0)