Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
36 changes: 35 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,41 @@ const hawk = new HawkCatcher({token: 'INTEGRATION_TOKEN'});

// somewhere in try-catch block or other custom place
hawk.send(new Error('Something went wrong'), {
myOwnDebugInfo: '1234'
myOwnDebugInfo: '1234',
});
```

## User Management

You can dynamically manage user information after the catcher is initialized:

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

// Set user information
hawk.setUser({
id: 'user123',
name: 'John Doe',
url: '/users/123',
image: 'https://example.com/avatar.jpg',
});

// Clear user (revert to generated user)
hawk.clearUser();
```

## Context Management

You can dynamically update context data that will be sent with all events:

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

// Set context data
hawk.setContext({
feature: 'user-dashboard',
version: '2.1.0',
environment: 'production',
});
```

Expand Down
Loading
Loading