Overview
breadcrumbsIntegration builds the breadcrumb trail for you, so every captured exception arrives with a record of what the user and the app were doing right before it. It collects five independent sources:
| Source | Breadcrumb type | What's recorded |
|---|---|---|
console | console | Every console.log/info/warn/error/debug call, with its arguments |
dom | interaction | Clicks and key presses, with a short selector path to the target element and its accessible label |
fetch | fetch | Method, URL and status of each fetch() request (error level on failure or non-2xx) |
xhr | xhr | Same, for XMLHttpRequest |
history | navigation | SPA navigations (pushState and back/forward), with from and to URLs |
The SDK's own requests to /api/envelope are skipped, so they never clutter the trail. See Breadcrumbs for how the trail is stored and shown on the dashboard.
Usage
ts
import { use } from '@buglapse/browser'
import { breadcrumbsIntegration } from '@buglapse/browser/integrations'
use(breadcrumbsIntegration())
// or turn individual sources off:
use(breadcrumbsIntegration({ console: false, xhr: false }))Options
| Option | Type | Default | Description |
|---|---|---|---|
console | boolean | true | Record console calls |
dom | boolean | true | Record clicks and key presses |
fetch | boolean | true | Record fetch() requests |
xhr | boolean | true | Record XMLHttpRequest requests |
history | boolean | true | Record SPA navigations |
Console breadcrumbs and ConsoleIntegration can be enabled together — one adds a breadcrumb per call, the other sends a log event per call.