Skip to content

Commit 897b05b

Browse files
committed
feat: enable tracking for UI clicks in breadcrumbs by default
1 parent f3fe1b9 commit 897b05b

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

packages/javascript/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ Breadcrumbs track user interactions and events leading up to an error, providing
152152

153153
### Default Configuration
154154

155-
By default, breadcrumbs are enabled with tracking for fetch/XHR requests and navigation:
155+
By default, breadcrumbs are enabled with tracking for fetch/XHR requests, navigation, and UI clicks:
156156

157157
```js
158158
const hawk = new HawkCatcher({
@@ -184,7 +184,7 @@ const hawk = new HawkCatcher({
184184
maxValueLength: 512, // Max string length (default: 1024)
185185
trackFetch: true, // Track fetch/XHR requests (default: true)
186186
trackNavigation: true, // Track navigation events (default: true)
187-
trackClicks: false, // Track UI clicks (default: false)
187+
trackClicks: true, // Track UI clicks (default: true)
188188
beforeBreadcrumb: (breadcrumb, hint) => {
189189
// Filter or modify breadcrumbs before storing
190190
if (breadcrumb.category === 'fetch' && breadcrumb.data?.url?.includes('/sensitive')) {
@@ -204,7 +204,7 @@ const hawk = new HawkCatcher({
204204
| `maxValueLength` | `number` | `1024` | Maximum length for string values in breadcrumb data. Longer strings will be trimmed with `` suffix. |
205205
| `trackFetch` | `boolean` | `true` | Automatically track `fetch()` and `XMLHttpRequest` calls as breadcrumbs. Captures request URL, method, status code, and response time. |
206206
| `trackNavigation` | `boolean` | `true` | Automatically track navigation events (History API: `pushState`, `replaceState`, `popstate`). Captures route changes. |
207-
| `trackClicks` | `boolean` | `false` | Automatically track UI click events. Captures element selector, coordinates, and other click metadata. |
207+
| `trackClicks` | `boolean` | `true` | Automatically track UI click events. Captures element selector, coordinates, and other click metadata. |
208208
| `beforeBreadcrumb` | `function` | `undefined` | Hook called before each breadcrumb is stored. Receives `(breadcrumb, hint)` and can return modified breadcrumb, `null` to discard it, or the original breadcrumb. Useful for filtering sensitive data or PII. |
209209

210210
### Manual Breadcrumbs

packages/javascript/example/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ <h2>Test Vue integration: &lt;test-component&gt;</h2>
309309
// maxValueLength: 512, // Max string length (default: 1024)
310310
// trackFetch: true, // Track fetch/XHR requests (default: true)
311311
// trackNavigation: true, // Track navigation events (default: true)
312-
// trackClicks: false, // Track UI clicks (default: false)
312+
// trackClicks: true, // Track UI clicks (default: true)
313313
// beforeBreadcrumb: (breadcrumb, hint) => {
314314
// // Filter or modify breadcrumbs before storing
315315
// if (breadcrumb.category === 'fetch' && breadcrumb.data?.url?.includes('/sensitive')) {

packages/javascript/src/addons/breadcrumbs.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ export interface BreadcrumbsOptions {
8383
/**
8484
* Enable automatic UI click breadcrumbs
8585
*
86-
* @default false
86+
* @default true
8787
*/
8888
trackClicks?: boolean;
8989
}
@@ -175,7 +175,7 @@ export class BreadcrumbManager {
175175
maxValueLength: DEFAULT_MAX_VALUE_LENGTH,
176176
trackFetch: true,
177177
trackNavigation: true,
178-
trackClicks: false,
178+
trackClicks: true,
179179
};
180180
}
181181

@@ -206,7 +206,7 @@ export class BreadcrumbManager {
206206
beforeBreadcrumb: options.beforeBreadcrumb,
207207
trackFetch: options.trackFetch ?? true,
208208
trackNavigation: options.trackNavigation ?? true,
209-
trackClicks: options.trackClicks ?? false,
209+
trackClicks: options.trackClicks ?? true,
210210
};
211211

212212
this.isInitialized = true;

0 commit comments

Comments
 (0)