Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

raygun

MindscapeHQ67.9k2.1.2TypeScript support: included

Raygun package for Node.js, written in TypeScript

APM, crash, debug, error, logging, raygun, reporting, tracking

readme

Raygun4Node

GitHub CI

Raygun.com package for Node, written in TypeScript.

Where is my app API key?

When sending exceptions to the Raygun service, an app API key is required to map the messages to your application.

When you create a new application in your Raygun dashboard, your app API key is displayed within the instructions page. You can also find the API key by clicking the "Application Settings" button in the side bar of the Raygun dashboard.

Getting Started

Install the module with: npm install raygun

const raygun = require('raygun');

const raygunClient = new raygun.Client().init({
  apiKey: 'YOUR_API_KEY'
});

You can also use import, which is useful for loading TypeScript definitions. In order to load type definitions, you can use import * as Raygun from 'raygun', or import the Client class directly from the module.

import * as Raygun from 'raygun';

const raygunClient = new Raygun.Client().init({
  apiKey: 'YOUR_API_KEY'
});

You can directly send errors to Raygun, either by making the error yourself or passing a caught error.

raygunClient.send(new Error('Something impossible happened!'));

If you use express, you can report the errors that express catches to Raygun by using the middleware.

// Add at the end of the middleware definitions, just above app.listen:
app.use(raygunClient.expressHandler);

You can directly catch errors in your application code and report them to Raygun.

try {
  // run some code that might throw an error we want to report
} catch (e) {
  raygunClient.send(e);
}

A similar example for Node style callbacks:

function handleResult(error, result) {
  if (error) {
    raygunClient.send(error);
    return;
  }

  // process result
}

If you're working directly with promises, you can pass raygunClient.send directly to .catch.

const axios = require('axios');

axios
  .get('example.com')
  .then(handleResponse)
  .catch(raygunClient.send);

Expressjs 4.0 and above

The Express documentation says Though not strictly required, by convention you define error-handling middleware last, after other app.use() calls, but that is incorrect. If the app.use(raygunClient.expressHandler); call is not immediately before the app.listen call, then errors will not be handled by Raygun.

Note that the Express middleware handler will pick up and transmit any err objects that reach it. If the app code itself chooses to handle states that result in 4xx/5xx status codes, these will not result in an error payload sent to Raygun.

Documentation

Send

The send() function is asynchronous and returns a Promise of type IncomingMessage.

Note that IncomingMessage can be null if the request was stored because the application was offline.

IncomingMessage is the response from the Raygun API - there's nothing in the body, it's just a status code response. If everything went ok, you'll get a 202 response code. Otherwise, we return 401 for incorrect API keys, 403 if you're over your plan limits, or anything in the 500+ range for internal errors.

We use the nodejs http/https library to make the POST to Raygun, you can see more documentation about that callback here: https://nodejs.org/api/http.html#http_http_request_options_callback .

You can await the call to obtain the result, or use then/catch.

The default timeout for the transport layer is 5000ms. You can override this value by setting a custom timeout (also in ms) when you initialize the Raygun client:

import * as Raygun from 'raygun';

const raygunClient = new Raygun.Client().init({
  apiKey: 'YOUR_API_KEY',
  ...
  timeout: 3000 // defaults to 5000ms
});

Using await

Use await to obtain the IncomingMessage, remember to catch any possible thrown errors from the send() method.

try {
  let message = await client.send(error);
} catch (e) {
  // error sending message
}

Using then/catch

You can also use then() to obtain the IncomingMessage, as well, use catch() to catch any possible thrown errors from the send() method.

client.send(error)
  .then((message) => {
    // message sent to Raygun
  })
  .catch((error) => {
      // error sending message
  });

Send Parameters

The send() method accepts a series of optional named parameters, defined as follows:

client.send(error, { customData, request, tags, timestamp, userInfo });

Each one of these parameters is optional. They are explained in detail the following sections.

Sending custom data

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):

client.send(new Error(), { customData: { 'mykey': 'beta' } });

Sending custom data with Expressjs

If you're using the raygunClient.expressHandler, you can send custom data along by setting raygunClient.expressCustomData to a function. The function will get two parameters, the error being thrown, and the request object.

const raygunClient = new raygun.Client().init({apiKey: "YOUR_API_KEY"});

raygunClient.expressCustomData = function (err, req) {
  return { 'level': err.level };
};

Sending request data

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

client.send(new Error(), { request: request });

If you want to filter any of the request data then you can pass in an array of keys to filter when you init the client. For example:

const raygun = require('raygun');
const raygunClient = new raygun.Client().init({ apiKey: 'YOUR_API_KEY', filters: ['password', 'creditcard'] });

Tags

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

client.send(new Error(), { tags: ['Custom Tag 1', 'Important Error'] });

Tags can also be set globally using setTags

client.setTags(['Tag1', 'Tag2']);

Timestamp

You can specify the exact time your error occurred in the Send() function with the timestamp parameter. Otherwise, the current time will be used.

This can be useful when combining Raygun together with other logger tools that provide a timestamp.

In milliseconds since epoch:

client.send(new Error(), { timestamp: 1718268992929 });

As Date object:

client.send(new Error(), { timestamp: new Date(2024, 5, 13, 10, 0, 0) });

Customers

You can attach user information to every Raygun Crash Report.

It will be transmitted with the error sent, and a count of affected customers will appear on the dashboard in the error group view. If you provide an email address, and the user has associated a Gravatar with it, their picture will be also displayed.

This package offers two different ways to do that:

  1. Provide the userInfo parameter in the send() method.
  2. Implement the user(request) method.

User information object

The following properties can be provided as user information:

  • identifier: Unique identifier for the user is the user identifier.
  • email: User's email address.
  • isAnonymous: Flag indicating if the user is anonymous or not.
  • firstName: User's first name (what you would use if you were emailing them - "Hi {{firstName}}, ...")
  • fullName: User's full name.
  • uuid: Device unique identifier. Useful if sending errors from a mobile device.

All properties are strings except isAnonymous, which is a boolean. As well, they are all optional. Any other properties will be discarded.

Example:

userInfo = {
    identifier: "123",
    email: "user@example.com",
    isAnonymous: false,
    firstName: "First name",
    fullName: "Fullname",
    uuid: "a25dfe58-8db3-496c-8768-375595139375",
}

For legacy support reasons, you can also provide the string identifier directly as the user information:

raygunClient.send(error, { userInfo: "123" });

userInfo parameter in send()

Provide the userInfo optional parameter in the send() method call:

client.send(new Error(), { userInfo });

This provided user information will take priority over the user(request) method.

Implement raygunClient.user(req)

You can set raygunClient.user to a function that returns the user name or email address of the currently logged in user.

An example, using the Passport.js middleware:

const raygunClient = new raygun.Client().init({apiKey: "YOUR_API_KEY"});

raygunClient.user = function (req) {
  if (req.user) {
    return {
      identifier: req.user.username,
      email: req.user.email,
      isAnonymous: false,
      fullName: req.user.fullName,
      firstName: req.user.firstName,
      uuid: req.user.deviceID
    };
  }
}

Param: req: the current request. Returns: The current user's identifier, or an object that describes the user.

Version tracking

Call setVersion(string) on a RaygunClient to set the version of the calling application. This is expected to be of the format x.x.x.x, where x is a positive integer. The version will be visible in the dashboard.

Inner Errors

Starting from 0.10.0 support for inner errors was added. Provide option innerErrorFieldName to specify a field or a function on the error object to use for retrieval of an inner error. Inner errors will be retrieved recursively until there is no more errors. Option innerErrorFieldName defaults to cause which is used in VError, therefore VError is supported out of the box.

Reporting uncaught exceptions

You can enable reporting uncaught exceptions to Raygun by setting the reportUncaughtExceptions option to true when initializing the client.

const {Raygun} = require('raygun');

const raygunClient = new Raygun.Client().init({
  apiKey: 'YOUR_API_KEY',
  reportUncaughtExceptions: true
});

This will cause any uncaught exceptions to be sent to Raygun prior to the process exiting.

Please note that this feature requires raygun>=0.13.0 and at least Node v12.17.0 or v13.7.0. This is due to the use of the uncaughtExceptionMonitor event, which allows monitoring uncaught exceptions without impacting standard process exit logic.

This feature is preferable to using the domains module for this purpose, as domains is both deprecated and carries a heavy performance overhead.

Changing the API endpoint

You can change the endpoint that error messages are sent to by specifying the host, port, and useSSL properties in the raygunClient.init() options hash. By default, host is api.raygun.com, port is 443, and useSSL is true.

onBeforeSend

Call Raygun.onBeforeSend(), passing in a function which takes up to 5 parameters (see the example below). This callback function will be called immediately before the payload is sent. The first parameter it gets will be the payload that is about to be sent. Thus from your function you can inspect the payload and decide whether or not to send it.

You can also pass this in as an option to init() like this: raygunClient.init({ onBeforeSend: function(payload) { return payload; } });

From the supplied function, you should return either the payload (intact or mutated as per your needs), or null.

If your function returns a truthy object, Raygun4Node will attempt to send it as supplied. Thus, you can mutate it as per your needs - preferably only the values if you wish to filter out data that is not taken care of by the filters. You can also of course return it as supplied.

If, after inspecting the payload, you wish to discard it and abort sending it to Raygun, simply return null.

For example:

const myBeforeSend = function (payload, exception, customData, request, tags) {
  console.log(payload); // Modify the payload here if necessary
  return payload; // Return null here instead of payload to abort the send
}

Raygun.onBeforeSend(myBeforeSend);

Breadcrumbs can be sent to Raygun to provide additional information to look into and debug issues stemming from crash reports.

Breadcrumbs can be created in two ways.

Simple string:

Call client.addBreadcrumb(message), where message is just a string:

client.addBreadcrumb('test breadcrumb');

Using BreadcrumbMessage:

Create your own BreadcrumbMessage object and send more than just a message with client.addBreadcrumb(BreadcrumbMessage).

The structure of the type BreadcrumbMessage is as shown here:

BreadcrumbMessage: {
    level: "debug" | "info" | "warning" | "error";
    category: string;
    message: string;
    customData?: CustomData;
}

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().

Raygun4Node provides a custom ExpressJS middleware that helps to scope Breadcrumbs to a specific request. As well, this middleware will add a Breadcrumb with information about the performed request.

To set up, add the Raygun Breadcrumbs ExpressJS handler before configuring any endpoints.

// Add the Raygun Breadcrumb ExpressJS handler
app.use(raygunClient.expressHandlerBreadcrumbs);

// Setup the rest of the app, e.g.
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 must go first to scope breadcrumbs correctly.

app.use(raygunClient.expressHandlerBreadcrumbs);
app.use(raygunClient.expressHandler);

Batched error transport

You can enable a batched transport mode for the Raygun client by passing {batch: true} when initializing.

const raygunClient = new raygun.Client().init({
  apiKey: 'YOUR_API_KEY',
  batch: true,
  batchFrequency: 5000 // defaults to 1000ms (every second)
});

The batch transport mode will collect errors in a queue and process them asynchronously. Rather than sending each error one at a time as they occur, errors will be batched and sent at regular intervals.

If your application generates and reports large volumes of errors, especially in a short duration, the batch transport mode will perform better and operate with less network overhead.

You can control how often batches are processed and sent by providing a batchFrequency option, which is a number in milliseconds.

The default timeout for batch transport calls is 5000ms. You can override this value by setting a custom timeout (also in ms) when you initialize the Raygun client:

import * as Raygun from 'raygun';

const raygunClient = new Raygun.Client().init({
  apiKey: 'YOUR_API_KEY',
  batch: true,
  batchFrequency: 5000, // defaults to 1000ms (every second)
  timeout: 10000 // defaults to 5000ms
});

Offline caching

Raygun can cache errors thrown by your Node application when it's running in 'offline' mode. By default the offline cache is disabled. Raygun4Node does not detect nor manage network state for you. It is up to the application using the library's functionality to manage online/offline state changes.

Raygun includes an on-disk cache provider out of the box, which requires write permissions to the folder you wish to use. You can also pass in your own cache storage. The default, on-disk cache provider will store crash reports as individual .json files in the specified directory.

Getting setup with the default offline provide

When creating your Raygun client you need to pass through a cache path

const raygunClient = new raygun.Client().init({
  apiKey: 'YOUR_API_KEY',
  isOffline: true,
  offlineStorageOptions: {
    cachePath: 'raygunCache/',
    cacheLimit: 1000 // defaults to 100 errors if you don't set this
  }
});

Setting isOffline: true tells the provider to start in offline mode. It will also trigger the initialisation of the cache, respectively - if the cache directory already exists - it will connect to the cache as specified in offlineStorageOptions.

Changing online/offline state

The Raygun client allows you to set its online state when your application is running.

To mark as offline

raygunClient.offline();

To mark as online

raygunClient.online();

When marking as online any cached errors from the currently configured cache provider will be forwarded to Raygun. This action will respect whatever transport mode (batched or individual HTTP requests) you have currently configured.

If you change between different cache providers or change the storage directory of the on-disk cache provider, please make sure to trigger processing the offline reports before making such a change.

Custom cache provider

You're able to provide your own cache provider if you can't access to the disk. When creating your Raygun client, pass in the storage provider on the offlineStorage property

Example:

const sqlStorageProvider = new SQLStorageProvider();

const raygunClient = new raygun.Client().init({
  apiKey: 'YOUR_API_KEY',
  isOffline: false,
  offlineStorage: sqlStorageProvider,
  offlineStorageOptions: {
    table: 'RaygunCache'
  }
});

Required methods

  • init(offlineStorageOptions) - Called when Raygun is marked as offline. offlineStorageOptions is an object with properties specific to each offline provider
  • save(transportItem, callback) - Called when marked as offline
  • retrieve(callback) - Returns an array of cached item filenames/ids
  • send(callback) - Sends the backlog of errors to Raygun

See lib/raygun.offline.ts for an example.

We recommend that you limit the number of errors that you are caching so that you don't swamp the client's internet connection sending errors.

Custom error grouping

You can provide your own grouping key if you wish. We only recommend this you're having issues with errors not being grouped properly.

When initializing Raygun, pass through a groupingKey function.

const raygunClient = new raygun.Client().init({
  apiKey: 'YOUR_API_KEY',
  groupingKey: function(message, exception, customData, request, tags) {
    return "CUSTOMKEY";
  }
});

Custom error objects

By default Raygun4Node tries to convert unknown objects into a human readable string to help with grouping, this doesn't always make sense.

To disable it:

const raygunClient = new raygun.Client().init({
  apiKey: 'YOUR_API_KEY',
  useHumanStringForObject: false
});

If your custom error object inherits from Error as its parent prototype, this isn't necessary however and these will be sent correctly.

Report column numbers

By default Raygun4Node doesn't include column numbers in the stack trace. To include column numbers add the option reportColumnNumbers set to true to the configuration.

const raygunClient = new raygun.Client().init({
  apiKey: 'YOUR_API_KEY',
  reportColumnNumbers: true
});

Including column numbers can enable source mapping if you have minified or transpiled code in your stack traces.

Source maps

Raygun supports source mapping for Node.js stacktraces which include column numbers. To enable this feature you will need to upload your map files to the JavaScript Source Map Center and enable the processing of Node.js error stacktraces.

Using Private Source Maps with Node.js apps

Raygun supports source mapping for Node.js stacktraces which include column numbers. To enable this feature simply upload your map files as per the instructions on this page and enable the processing of Node.js errors with this setting in Raygun.

Node.js source maps

Managing files in the JavaScript Source Map Center Files in the JavaScript Source Map Center can be managed via a few API calls.

A GET request to https://app.raygun.com/jssymbols/[applicationIdentifier] will return a JSON object listing all files within the center. eg.

curl
  -X GET
  -u my@email.com:mypassword
  https://app.raygun.com/jssymbols/[applicationIdentifier]

Returns:

{
  "Count": totalNumberOfItems,
  "Items": [
    {
       "Url": "https://urlOfItem",
       "FileName": "fileName.js",
       "UploadedOn": "2016-01-01..."
    },
    ...
  ]
}

A DELETE request to https://app.raygun.com/jssymbols/[applicationIdentifier]/all will remove all files within the center. eg.

curl
  -X DELETE
  -u my@email.com:mypassword
  https://app.raygun.com/jssymbols/[applicationIdentifier]/all

A DELETE request to https://app.raygun.com/jssymbols/[applicationIdentifier] will remove files with the specified URLS from the center. eg.

curl
  -X DELETE
  -u my@email.com:mypassword
  -F "url=https://example.com/js/myjs.min.map"
  https://app.raygun.com/jssymbols/[applicationIdentifier]

All requests use the same authentication methods as the upload call (Basic Authentication and Token Authentication).

Known Issues

  • Node will show compilation warnings when using Raygun4Node in Webpack applications.
  • Although Breadcrumbs report the source filename, code line and function name, these are not processed using source maps like with stack traces.

Examples

View a screencast on creating an app with Node.js and Express.js, then hooking up the error handling and sending them at https://raygun.com/blog/2013/07/video-nodejs-error-handling-with-raygun/

Debug Logging

You can enable logging of debug information from the Raygun client by setting the environment variable DEBUG=raygun. The client will then log information about transporting and storing errors, including timing information.

Release History

View the changelog here

License

Copyright (c) 2016 Raygun Limited

Licensed under the MIT license.

changelog

2.1.2

  • fix(sdk): Add host to headers if specified (#373) (2025-04-08)
  • docs: add Releasing and Contributing (#365) (2025-03-21)
  • chore(deps-dev): bump typescript from 5.7.3 to 5.8.2 (#371) (2025-04-04)
  • chore(deps-dev): bump prettier from 3.4.2 to 3.5.3 (#370) (2025-04-01)
  • chore(deps): bump express and @types/express (#369) (2025-04-01)
  • chore(deps-dev): bump @eslint/js from 9.17.0 to 9.23.0 (#368) (2025-04-01)
  • chore(deps-dev): bump eslint from 9.17.0 to 9.23.0 (#367) (2025-04-01)
  • chore(deps): bump body-parser in /examples/express-sample (#366) (2025-04-01)
  • chore(deps-dev): bump prismjs from 1.29.0 to 1.30.0 (#364) (2025-03-11)
  • chore(deps-dev): bump @stylistic/eslint-plugin-ts from 2.11.0 to 4.1.0 (#362) (2025-03-03)
  • chore(deps-dev): bump typescript-eslint from 8.19.0 to 8.25.0 (#360) (2025-03-01)
  • chore(deps): bump uuid from 11.0.2 to 11.1.0 (#359) (2025-03-01)
  • chore(deps-dev): bump tap from 21.0.1 to 21.1.0 (#361) (2025-03-01)
  • chore(deps-dev): bump semver from 7.6.3 to 7.7.1 (#363) (2025-03-01)
  • chore(deps-dev): bump nock from 13.5.6 to 14.0.0 (#358) (2025-02-07)
  • chore(deps-dev): bump @types/node from 22.0.2 to 22.13.0 (#357) (2025-02-02)
  • chore(deps-dev): bump eslint-plugin-tsdoc from 0.3.0 to 0.4.0 (#355) (2025-02-02)
  • chore(deps-dev): bump typescript from 5.7.2 to 5.7.3 (#356) (2025-02-02)
  • chore(deps-dev): bump prettier from 3.4.1 to 3.4.2 (#354) (2025-02-02)

2.1.1

  • docs: Some documentation improvements around online/offline behaviour. (#333) (2024-10-23)
  • chore(deps): bump cross-spawn from 7.0.3 to 7.0.6 in /examples/express-sample (#345) (2024-12-02)
  • chore(deps): bump debug from 4.3.7 to 4.4.0 (#346) (2025-01-06)
  • chore(deps): bump uuid from 10.0.0 to 11.0.2 (#338) (2024-11-01)
  • chore(deps): bump @types/express from 4.17.21 to 5.0.0 (#335) (2024-11-01)
  • chore(deps-dev): bump typescript from 5.6.3 to 5.7.2 (#349) (2025-01-06)
  • chore(deps-dev): bump typescript-eslint from 8.17.0 to 8.19.0 (#348) (2025-01-06)
  • chore(deps-dev): bump eslint from 9.16.0 to 9.17.0 (#350) (2025-01-06)
  • chore(deps-dev): bump eslint from 9.11.1 to 9.16.0 (#340) (2024-12-03)
  • chore(deps-dev): bump nock from 13.5.5 to 13.5.6 (#341) (2024-12-02)
  • chore(deps-dev): bump prettier from 3.3.3 to 3.4.1 (#342) (2024-12-02)
  • chore(deps-dev): bump @eslint/js from 9.13.0 to 9.16.0 (#343) (2024-12-02)
  • chore(deps-dev): bump @stylistic/eslint-plugin from 2.8.0 to 2.11.0 (#344) (2024-12-02)
  • chore(deps-dev): bump typescript-eslint from 8.3.0 to 8.12.2 (#339) (2024-11-01)
  • chore(deps-dev): bump @eslint/js from 9.11.1 to 9.13.0 (#337) (2024-11-01)
  • chore(deps-dev): bump typescript from 5.5.4 to 5.6.3 (#336) (2024-11-01)
  • chore: Updated package.json to deal with vuln in express dependency (#352) (2025-01-14)

2.1.0

  • chore(deps): bump cookie and express (#329) (2024-10-10)
  • chore(deps): bump cookie, cookie-parser and express in /examples/express-sample (#328) (2024-10-10)

2.1.0-alpha

  • feat: Add configurable timeouts (#320) (2024-10-03)
  • feat: Support Node v22 (#317) (2024-09-25)
  • ci: Set dependabot interval to "monthly" (#295) (2024-07-23)
  • chore(deps-dev): bump @stylistic/eslint-plugin-ts from 2.7.2 to 2.8.0 (#323) (2024-10-01)
  • chore(deps-dev): bump @stylistic/eslint-plugin from 2.7.2 to 2.8.0 (#325) (2024-10-01)
  • chore(deps): bump debug from 4.3.5 to 4.3.7 (#324) (2024-10-01)
  • chore(deps-dev): bump eslint from 8.57.0 to 9.11.1 (#326) (2024-10-01)
  • chore(deps): bump serve-static and express (#315) (2024-09-23)
  • chore(deps): bump body-parser and express in /examples/express-sample (#314) (2024-09-23)
  • chore(deps-dev): bump typescript-eslint from 7.17.0 to 8.3.0 (#310) (2024-09-02)
  • chore(deps-dev): bump tap from 21.0.0 to 21.0.1 (#309) (2024-09-02)
  • chore(deps-dev): bump @stylistic/eslint-plugin-ts from 2.6.0 to 2.7.2 (#308) (2024-09-02)
  • chore(deps-dev): bump nock from 13.5.4 to 13.5.5 (#307) (2024-09-02)
  • chore(deps-dev): bump @stylistic/eslint-plugin from 2.6.0 to 2.7.2 (#306) (2024-09-02)
  • chore(deps-dev): bump @types/node from 20.14.11 to 22.0.2 (#303) (2024-08-01)
  • chore(deps-dev): bump @stylistic/eslint-plugin from 2.3.0 to 2.6.0 (#302) (2024-08-01)
  • chore(deps-dev): bump @eslint/js from 9.7.0 to 9.8.0 (#301) (2024-08-01)
  • chore(deps-dev): bump typescript-eslint from 7.16.1 to 7.17.0 (#300) (2024-07-23)
  • chore(deps-dev): bump typescript from 5.5.3 to 5.5.4 (#299) (2024-07-23)
  • chore(deps-dev): bump semver from 7.6.2 to 7.6.3 (#298) (2024-07-22)
  • chore(deps-dev): bump @types/node from 20.14.10 to 20.14.11 (#296) (2024-07-22)
  • chore(deps-dev): bump typescript-eslint from 7.16.0 to 7.16.1 (#297) (2024-07-22)
  • chore(deps-dev): bump tap from 20.0.3 to 21.0.0 (#294) (2024-07-17)
  • chore(deps-dev): bump typescript-eslint from 7.15.0 to 7.16.0 (#293) (2024-07-17)
  • chore(deps-dev): bump prettier from 3.3.2 to 3.3.3 (#292) (2024-07-17)
  • chore(deps-dev): bump @eslint/js from 9.6.0 to 9.7.0 (#291) (2024-07-17)

2.0.0

  • refactor!: #262 remove deprecated methods (#288)
  • fix: #273 enable isAnonymous parameter (#284)
  • docs: #161 Document methods using tsdoc format (#274)
  • chore(deps): bump config in /examples/express-sample (#276)
  • chore(deps): bump config in /examples/using-domains (#282)
  • chore(deps-dev): bump @eslint/js from 9.4.0 to 9.6.0 (#279)
  • chore(deps-dev): bump @stylistic/eslint-plugin from 2.2.2 to 2.3.0 (#286)
  • chore(deps-dev): bump @stylistic/eslint-plugin-ts from 2.2.2 to 2.3.0 (#280)
  • chore(deps-dev): bump @types/node from 20.14.8 to 20.14.9 (#278)
  • chore(deps-dev): bump @types/node from 20.14.9 to 20.14.10 (#285)
  • chore(deps-dev): bump tap from 19.2.5 to 20.0.3 (#277)
  • chore(deps-dev): bump typescript from 5.5.2 to 5.5.3 (#287)
  • chore(deps-dev): bump typescript-eslint from 7.13.1 to 7.15.0 (#283)

BREAKING CHANGE

  • Removed deprecated methods setUser() and sendWithCallback()

1.2.0

  • feat: #218 Optional userInfo in send()
  • feat: #65 Custom timestamp parameter (#254)
  • fix: #68 Better humanize string functionality (#255)
  • doc: #196 add documentation on handling errors in sync transport (#259)
  • refactor: #199 batch callbacks (#261)
  • chore: #224 add clarification on sourcemaps and breadcrumbs (#270)
  • chore(deps-dev): bump @types/node from 20.14.2 to 20.14.8 (#268)
  • chore(deps-dev): bump @types/uuid from 9.0.8 to 10.0.0 (#267)
  • chore(deps-dev): bump @stylistic/eslint-plugin from 2.1.0 to 2.2.2 (#265)
  • chore(deps-dev): bump typescript-eslint from 7.13.0 to 7.13.1 (#264)
  • chore(deps-dev): bump typescript-eslint from 7.11.0 to 7.13.0 (#258)
  • chore(deps-dev): bump prettier from 3.3.0 to 3.3.2 (#257)
  • chore(deps-dev): bump tap from 19.0.2 to 19.2.5 (#256)
  • chore(deps): bump uuid from 9.0.1 to 10.0.0 (#250)
  • chore(deps-dev): bump @types/node from 20.14.0 to 20.14.2 (#247)

1.1.0

  • feat: Part of #220 add internal runWithBreadcrumbsAsync function (#245) (2024-06-05)
  • fix: onBeforeSend allows to skip messages (#231) (2024-05-28)
  • chore(deps-dev): bump @eslint/js from 9.3.0 to 9.4.0 (#243) (2024-06-03)
  • chore(deps-dev): bump @types/node from 20.12.12 to 20.14.0 (#242) (2024-06-03)
  • chore(deps-dev): bump prettier from 3.2.5 to 3.3.0 (#241) (2024-06-03)
  • chore(deps): bump debug from 4.3.4 to 4.3.5 (#240) (2024-06-03)
  • chore(deps-dev): bump typescript-eslint from 7.10.0 to 7.11.0 (#239) (2024-06-03)
  • chore(deps-dev): bump tap from 18.8.0 to 19.0.2 (#237) (2024-05-28)
  • chore(deps-dev): bump typescript-eslint from 7.9.0 to 7.10.0 (2024-05-27)

1.0.0

  • feat: #219 Better Send parameters (#221) (2024-05-17)
  • feat: Breadcrumbs (#210) (2024-05-15)
  • fix: #138 New APM Bridge Setup (#222) (2024-05-20)
  • docs: Update status badge in README.md (#209) (2024-05-10)
  • refactor: #205 Setup eslint style (#207) (2024-05-09)
  • refactor: #197 Refactor to use Promises internally (#200) (2024-05-09)
  • refactor: #184 Cleanup debug/log messages and styles (#194) (2024-05-08)
  • chore(deps-dev): bump typescript-eslint from 7.8.0 to 7.9.0 (#229) (2024-05-20)
  • chore(deps-dev): bump @eslint/js from 9.2.0 to 9.3.0 (#228) (2024-05-20)
  • chore(deps-dev): bump @types/node from 20.12.11 to 20.12.12 (#227) (2024-05-20)
  • chore(deps-dev): bump @stylistic/eslint-plugin from 2.0.0 to 2.1.0 (#214) (2024-05-13)
  • chore(deps-dev): bump tap from 18.7.2 to 18.8.0 (#213) (2024-05-13)
  • chore(deps-dev): bump @types/node from 20.12.8 to 20.12.11 (#212) (2024-05-13)
  • chore(deps-dev): bump semver from 7.6.0 to 7.6.2 (#211) (2024-05-13)
  • chore: code cleanup (#225) (2024-05-20)
  • chore: apply prettier to all files in examples (#226) (2024-05-19)

BREAKING CHANGES

  • send() method signature changed.
  • APM Bridge setup process changed.

See README.md for more information.

0.15.0-0

  • async/await send() support
  • Upgrade dependencies
  • Improvements in filter method
  • Improvements in documentation

0.14.0

  • Upgrade dependencies
  • Support for Node v20

0.13.2

  • Fix batch transport keeping process alive
  • Fix batch transport stalling on huge errors
  • Improve batch transport performance with high error rates

0.13.1

  • Fix format of exceptions when calling raygunClient.send with a string value

0.13.0

  • Fatal errors can now be reported to Raygun by enabling the reportUncaughtExceptions when initializing the client

0.12.4

  • Expose Raygun Client types for use in TypeScript projects

0.12.3

  • Fix regression where user function would not always be called

0.12.2

  • Fix regression where express middleware would not pass error to next middleware

0.12.1

  • Include @types/express as dependency

0.12.0

  • Add integration with raygun-apm, errors reported during a trace should link between trace and error

0.11.1

  • Fix send annotations requiring too many arguments
  • Add default export to module

0.11.0

  • Overhaul project to TypeScript, type definitions included in package
  • Unhandled exceptions are now correctly tagged
  • Add support for batch error reporting
  • Add debug logging
  • Fix Node buffer deprecation warning

0.10.2

  • Move nock to devDependencies due to CVE
  • Fix Travis Node v4 build
  • Add jshint to Travis build

0.10.1

  • Bump nock dependency to v9 as v8 has a dependency on a version of lodash with a security issue

0.10.0

  • Add support for inner errors. Option innerErrorFieldName to specify a field or a function on the error object to use for retrieval of an inner error. Defaults to cause which is used in VError

0.9.1

  • Add an option to report column number for each frame of the stack trace

0.9.0

  • Add capability to send custom data with Express handler
  • Treat custom errors as Errors
  • useSSL option now works correctly, and support added for HTTP proxies
  • If network errors occur during payload posting, and a Node-style error callback param is available on the callback, this is now executed
  • Functional sending tests now pass correctly

0.8.5

  • Add ability to turn off 'humanised-object-strings'

0.8.4

  • Add some smarts around passing an object in to the exception parameter

0.8.3

  • Turn strings into errors if passed through. Log out request errors.

0.8.2

  • Add setTags method

0.8.1

  • Add custom error grouping key

0.8.0

  • Add offline support

0.7.1

  • Default useSSL to true

0.7.0

  • Add onBeforeSend hook, api endpoint options, and bug fixes

0.6.2

  • Fix utf8 chars causing 400s, log when errors occur when posting

0.6.1

  • Replace deprecated request.host with request.hostname if it exists

0.6.0

  • Added ability to send tags with exception reports

0.5.0

  • Added filters for sensitive request data, and better affected user tracking/Customers

0.4.2

  • Minor test refactor

0.4.1

  • Fixed issue where getting cpu information returned undefined

0.4.0

  • Added user function, deprecated setUser

0.3.0

  • Added version and user tracking/Customers functionality; bump jshint version, update test

0.2.0

  • Added Express handler, bug fixes

0.1.2

  • Include more error information

0.1.1

  • Point at the correct API endpoint, include correct dependencies for NPM

0.1.0

  • Initial release