⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
f9ab73d
chore: init
Dobrunia Jan 14, 2026
05ab9be
chore: lint fix
Dobrunia Jan 14, 2026
3c22e78
chore: add comprehensive testing for all breadcrumb types
Dobrunia Jan 15, 2026
9392108
style: update button labels and adjust breadcrumb output margin
Dobrunia Jan 15, 2026
69cfaea
chore: update @hawk.so/types to version 0.5.1
Dobrunia Jan 19, 2026
5422298
feat(breadcrumbs): add breadcrumbs tracking configuration and API
Dobrunia Jan 19, 2026
2ef54f3
refactor(breadcrumbs): streamline breadcrumb API and enhance type def…
Dobrunia Jan 19, 2026
c8cbdd8
chore: update @hawk.so/types to version 0.5.2 and enhance BreadcrumbM…
Dobrunia Jan 19, 2026
519d4ed
chore: add commented configuration options for breadcrumbs tracking i…
Dobrunia Jan 19, 2026
2894069
chore: upgrade Node.js version to 24.x in CI workflows
Dobrunia Jan 19, 2026
bd00cd8
chore: lint fix
Dobrunia Jan 19, 2026
e828b4f
docs: add detailed comments for breadcrumb test functions in sample-e…
Dobrunia Jan 19, 2026
968dd50
refactor(breadcrumbs): update breadcrumb API usage in sample-errors.j…
Dobrunia Jan 20, 2026
57feedf
style: update button labels for clarity and enhance breadcrumb output…
Dobrunia Jan 20, 2026
6fbf221
chore: upgrade Node.js version to 24.12.0 and update CI workflows to …
Dobrunia Jan 21, 2026
a92e833
chore: update CI workflows to use actions/setup-node@v3 for improved …
Dobrunia Jan 21, 2026
8ddd59d
chore: lint fix
Dobrunia Jan 21, 2026
f3fe1b9
feat: add breadcrumbs-tests.js script and integrate it into index.html
Dobrunia Jan 21, 2026
897b05b
feat: enable tracking for UI clicks in breadcrumbs by default
Dobrunia Jan 21, 2026
f0d9315
chore: bump version to 3.2.13 in package.json
Dobrunia Jan 21, 2026
2d76796
refactor(breadcrumbs): remove maxValueLength option and related logic…
Dobrunia Jan 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ jobs:
CI_JOB_NUMBER: 1
steps:
- uses: actions/checkout@v1
- name: Use Node.js 20.x
uses: actions/setup-node@v1
- name: Use Node.js from .nvmrc
uses: actions/setup-node@v3
with:
node-version: 20.x
node-version-file: '.nvmrc'
- run: yarn install
- run: yarn lint-test

Expand All @@ -21,9 +21,9 @@ jobs:
CI_JOB_NUMBER: 2
steps:
- uses: actions/checkout@v1
- name: Use Node.js 20.x
uses: actions/setup-node@v1
- name: Use Node.js from .nvmrc
uses: actions/setup-node@v3
with:
node-version: 20.x
node-version-file: '.nvmrc'
- run: yarn install
- run: yarn build
4 changes: 2 additions & 2 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/setup-node@v3
with:
node-version: 20
node-version-file: '.nvmrc'
registry-url: https://registry.npmjs.org/
- run: yarn
- run: yarn lint-test
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v20.18.0
24.12.0
87 changes: 87 additions & 0 deletions packages/javascript/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ Initialization settings:
| `disableGlobalErrorsHandling` | boolean | optional | Do not initialize global errors handling |
| `disableVueErrorHandler` | boolean | optional | Do not initialize Vue errors handling |
| `consoleTracking` | boolean | optional | Initialize console logs tracking |
| `breadcrumbs` | false or BreadcrumbsOptions object | optional | Configure breadcrumbs tracking (see below) |
| `beforeSend` | function(event) => event | optional | This Method allows you to filter any data you don't want sending to Hawk |

Other available [initial settings](types/hawk-initial-settings.d.ts) are described at the type definition.
Expand Down Expand Up @@ -145,6 +146,92 @@ hawk.setContext({
});
```

## Breadcrumbs

Breadcrumbs track user interactions and events leading up to an error, providing context for debugging.

### Default Configuration

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

```js
const hawk = new HawkCatcher({
token: 'INTEGRATION_TOKEN'
// breadcrumbs enabled by default
});
```

### Disabling Breadcrumbs

To disable breadcrumbs entirely:

```js
const hawk = new HawkCatcher({
token: 'INTEGRATION_TOKEN',
breadcrumbs: false
});
```

### Custom Configuration

Configure breadcrumbs tracking behavior:

```js
const hawk = new HawkCatcher({
token: 'INTEGRATION_TOKEN',
breadcrumbs: {
maxBreadcrumbs: 20, // Maximum breadcrumbs to store (default: 15)
trackFetch: true, // Track fetch/XHR requests (default: true)
trackNavigation: true, // Track navigation events (default: true)
trackClicks: true, // Track UI clicks (default: true)
beforeBreadcrumb: (breadcrumb, hint) => {
// Filter or modify breadcrumbs before storing
if (breadcrumb.category === 'fetch' && breadcrumb.data?.url?.includes('/sensitive')) {
return null; // Discard this breadcrumb
}
return breadcrumb;
}
}
});
```

### Breadcrumbs Options

| Option | Type | Default | Description |
|--------|------|---------|-------------|
| `maxBreadcrumbs` | `number` | `15` | Maximum number of breadcrumbs to store. When the limit is reached, oldest breadcrumbs are removed (FIFO). |
| `trackFetch` | `boolean` | `true` | Automatically track `fetch()` and `XMLHttpRequest` calls as breadcrumbs. Captures request URL, method, status code, and response time. |
| `trackNavigation` | `boolean` | `true` | Automatically track navigation events (History API: `pushState`, `replaceState`, `popstate`). Captures route changes. |
| `trackClicks` | `boolean` | `true` | Automatically track UI click events. Captures element selector, coordinates, and other click metadata. |
| `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. |

### Manual Breadcrumbs

Add custom breadcrumbs manually:

```js
hawk.breadcrumbs.add({
type: 'logic',
category: 'auth',
message: 'User logged in',
level: 'info',
data: { userId: '123' }
});
```

### Breadcrumb Methods

```js
// Add a breadcrumb
hawk.breadcrumbs.add(breadcrumb, hint);

// Get current breadcrumbs
const breadcrumbs = hawk.breadcrumbs.get();

// Clear all breadcrumbs
hawk.breadcrumbs.clear();
```

## Source maps consuming

If your bundle is minified, it is useful to pass source-map files to the Hawk. After that you will see beautiful
Expand Down
Loading
Loading