---
title: Upgrading to @honeybadger-io/js v3.0
description: Upgrade guide for migrating to Honeybadger JavaScript library v3 with breaking changes and new features.
url: https://docs.honeybadger.io/lib/javascript/support/upgrading-to-v3/
---

The new [@honeybadger-io/js](https://www.npmjs.com/package/@honeybadger-io/js) package is a universal/isomorphic JavaScript package combining the deprecated [honeybadger-js for browsers](https://www.npmjs.com/package/honeybadger-js) and the [honeybadger for Node.js](https://www.npmjs.com/package/honeybadger) NPM packages.

**Moving forward, development for both platforms will happen on @honeybadger-io/js** ([source code on GitHub](https://github.com/honeybadger-io/honeybadger-js)).

The new API is mostly the same as the old packages, with a few small changes.

## Upgrading from honeybadger-js v2.x (client-side)

If you currently use the [honeybadger-js](https://www.npmjs.com/package/honeybadger-js) package, this section is for you.

The changes between *honeybadger-js* and *@honeybadger-io/js* are minimal. First, replace the old package with the new one:

```sh
npm uninstall honeybadger-js
npm install @honeybadger-io/js
```

Next, replace any `require`/`import` statements that reference “honeybadger-js”:

```js
const Honeybadger = require("@honeybadger-io/js");


// Or:
// import Honeybadger from '@honeybadger-io/js';


Honeybadger.configure({
  apiKey: "project api key",
  environment: "production",
  revision: "git SHA/project version",
});
```

Finally, review this list of changes:

* Previously deprecated snake case config options such as `api_key`, `project_root`, etc. are no longer supported. Use `apiKey`, `projectRoot` instead.

* Stack traces are now parsed client-side; `notice.stack` is now read-only in [`beforeNotify`handlers](https://docs.honeybadger.io/lib/javascript/reference/configuration/#beforenotify-handlers), and a new `notice.backtrace` object has been added.

* The `max_depth` config option is now `maxObjectDepth`

* The `host` and `port` config options are now `endpoint`

* `onerror` is now `enableUncaught`

* The `onunhandledrejection` config option is now `enableUnhandledRejection`

* The `ignorePatterns` config option has been removed. Use a [`beforeNotify`handler](https://docs.honeybadger.io/lib/javascript/reference/configuration/#beforenotify-handlers) instead:

  ```js
  const ignorePatterns = [/NoisyError/i, /unwanted error message/i];
  Honeybadger.beforeNotify(function (notice) {
    if (ignorePatterns.some((p) => p.test(notice.message))) {
      return false;
    }
  });
  ```

* `Honeybadger.wrap` [has been removed](https://github.com/honeybadger-io/honeybadger-js/pull/506). If you used this functionality, you can recreate it like so:

  ```js
  Honeybadger.wrap = function (func) {
    try {
      func.apply(this, arguments);
    } catch (error) {
      Honeybadger.notify(error);
      throw error;
    }
  };
  ```

See [configuration](https://docs.honeybadger.io/lib/javascript/reference/configuration/) for an up-to-date list of available config options. Feel free to [email support](mailto:support@honeybadger.io?subject=honeybadger-js%20v3%20upgrade) if you run into issues not mentioned here.

### CDN users

If you use the CDN instead of the NPM package, replace your current script tag with the **v3.0** script tag:

```html
<script
  src="//js.honeybadger.io/v3.0/honeybadger.min.js"
  type="text/javascript"
></script>
```

## Upgrading from honeybadger 1.x (Node.js)

If you currently use the [honeybadger](https://www.npmjs.com/package/honeybadger) package, this section is for you.

First, replace the old package with the new one:

```sh
npm uninstall honeybadger
npm install @honeybadger-io/js
```

Next, replace any `require` statements that reference “honeybadger-js”:

```js
const Honeybadger = require("@honeybadger-io/js");


Honeybadger.configure({
  apiKey: "project api key",
  environment: "production",
  revision: "git SHA/project version",
});
```

Finally, review this list of changes:

* Environment variables are no longer configured by default; you must explicitly call `Honeybadger.configure`, i.e.:

  ```js
  Honeybadger.configure({
    apiKey: process.env.HONEYBADGER_API_KEY,
    environment: process.env.HONEYBADGER_ENVIRONMENT,
  });
  ```

* [`Honeybadger.logger`](https://github.com/honeybadger-io/honeybadger-node#configuring-the-default-logger) is now the [`logger`config option](https://docs.honeybadger.io/lib/javascript/reference/configuration/#configuration-options).

* [`Honeybadger.onUncaughtException`](https://github.com/honeybadger-io/honeybadger-node#honeybadgeronuncaughtexception-configure-the-uncaught-exception-handler) is now the [`afterUncaught`config option](https://docs.honeybadger.io/lib/javascript/reference/configuration/#configuration-options).

* [Events](https://github.com/honeybadger-io/honeybadger-node#events) are no longer emitted. Use [`beforeNotify`and`afterNotify`handlers instead](https://docs.honeybadger.io/lib/javascript/reference/configuration/#beforenotify-handlers).

See [configuration](https://docs.honeybadger.io/lib/javascript/reference/configuration/) for an up-to-date list of available config options. Feel free to [email support](mailto:support@honeybadger.io?subject=honeybadger-js%20v3%20upgrade) if you run into issues not mentioned here.

---

## Try Honeybadger for FREE

Intelligent logging, error tracking, and Just Enough APM™ in one dev-friendly platform. Find and fix problems before users notice.

[Start free trial](https://app.honeybadger.io/users/sign_up)

[See plans and pricing](https://www.honeybadger.io/plans/)
