Skip to content

Commit

Permalink
fix: Fixes in 1.0.0 release candidate (#234)
Browse files Browse the repository at this point in the history
* docs: update send params in README

* docs: add Breadcrumbs info

* docs: change should by must
  • Loading branch information
miquelbeltran authored May 24, 2024
1 parent 8e37c10 commit f5c1307
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ They are explained in detail the following sections.

### Sending custom data

You can pass custom data in on the Send() function, as the second parameter. For instance (based off the call in test/raygun_test.js):
You can pass custom data in on the Send() function, as the `customData` parameter. For instance (based off the call in test/raygun_test.js):

```javascript
client.send(new Error(), { customData: { 'mykey': 'beta' } });
Expand All @@ -174,7 +174,8 @@ raygunClient.expressCustomData = function (err, req) {

### Sending request data

You can send the request data in the Send() function, as the fourth parameter. For example:
You can send the request data in the Send() function, as the `request` parameter. For example:

```javascript
client.send(new Error(), { request: request });
```
Expand All @@ -188,7 +189,8 @@ const raygunClient = new raygun.Client().init({ apiKey: 'YOUR_API_KEY', filters:

### Tags

You can add tags to your error in the Send() function, as the fifth parameter. For example:
You can add tags to your error in the Send() function, as the `tags` parameter. For example:

```javascript
client.send(new Error(), { tags: ['Custom Tag 1', 'Important Error'] });
```
Expand Down Expand Up @@ -331,7 +333,13 @@ BreadcrumbMessage: {
}
```

Breadcrumbs can be cleared with `client.clearBreadcrumbs()`.
#### Sending Breadcrumbs

When an error message is sent to Raygun Crash Reporting, all the registered Breadcrumbs will be attached automatically.

After the error message has been sent, the registered Breadcrumbs list be cleared automatically.

Otherwise, you can also clear Breadcrumbs with `client.clearBreadcrumbs()`.

#### Breadcrumbs and ExpressJS

Expand All @@ -349,7 +357,7 @@ app.use("/", routes);
```

This middleware can be used together with the provided ExpressJS error handler `expressHandler`.
The order in which the middlewares are configured is important. `expressHandlerBreadcrumbs` should go first to scope breadcrumbs correctly.
The order in which the middlewares are configured is important. `expressHandlerBreadcrumbs` must go first to scope breadcrumbs correctly.

```js
app.use(raygunClient.expressHandlerBreadcrumbs);
Expand Down

0 comments on commit f5c1307

Please sign in to comment.