npm @sentry/node 4.0.0

latest releases: 8.0.0-rc.1, 8.0.0-rc.0, 8.0.0-beta.6...
5 years ago

This is the release of our new SDKs, @sentry/browser, @sentry/node. While there are too many changes to list for this release, we will keep a consistent changelog for upcoming new releases. raven-js (our legacy JavaScript/Browser SDK) and raven (our legacy Node.js SDK) will still reside in this repo, but they will receive their own changelog.

We generally guide people to use our new SDKs from this point onward. The migration should be straightforward if you were only using the basic features of our previous SDKs.

raven-js and raven will both still receive bugfixes but all the new features implemented will only work in the new SDKs. The new SDKs are completely written in TypeScript, which means all
functions, classes and properties are typed.

Links

Migration

Here are some examples of how the new SDKs work. Please note that the API for all JavaScript SDKs is the same.

Installation

Old:

Raven.config('___PUBLIC_DSN___', {
  release: '1.3.0',
}).install();

New:

Sentry.init({
  dsn: '___PUBLIC_DSN___',
  release: '1.3.0',
});

Set a global tag

Old:

Raven.setTagsContext({ key: 'value' });

New:

Sentry.configureScope(scope => {
  scope.setTag('key', 'value');
});

Capture custom exception

Old:

try {
  throwingFunction();
} catch (e) {
  Raven.captureException(e, { extra: { debug: false } });
}

New:

try {
  throwingFunction();
} catch (e) {
  Sentry.withScope(scope => {
    scope.setExtra('debug', false);
    Sentry.captureException(e);
  });
}

Capture a message

Old:

Raven.captureMessage('test', 'info', { extra: { debug: false } });

New:

Sentry.withScope(scope => {
  scope.setExtra('debug', false);
  Sentry.captureMessage('test', 'info');
});

Breadcrumbs

Old:

Raven.captureBreadcrumb({
  message: 'Item added to shopping cart',
  category: 'action',
  data: {
    isbn: '978-1617290541',
    cartSize: '3',
  },
});

New:

Sentry.addBreadcrumb({
  message: 'Item added to shopping cart',
  category: 'action',
  data: {
    isbn: '978-1617290541',
    cartSize: '3',
  },
});

Don't miss a new node release

NewReleases is sending notifications on new releases.