Installing Airbrake in a Node.js application

Key Features

  • Easy and flexible installation options including npm and Yarn
  • Send uncaught errors to Airbrake or manually using a try/catch
  • Add custom parameters to your errors for more context
  • Private source map support
  • Control which errors you send with customizable filtering options

Installation & Configuration


Using npm

npm install @airbrake/node

Using Yarn

yarn add @airbrake/node


This is a simple Node app app.js file that throws an error and sends it to Airbrake. To configure Airbrake in your project, just require the @airbrake/node library and instantiate the notifier as shown:

const http = require('http');
const Airbrake = require('@airbrake/node');

new Airbrake.Notifier({
  projectId: process.env.AIRBRAKE_PROJECT_ID,
  projectKey: process.env.AIRBRAKE_PROJECT_KEY,

const hostname = '';
const port = 3000;

const server = http.createServer((_req, res) => {
  res.statusCode = 200;
  res.setHeader('Content-Type', 'text/plain');
  res.end('Hello World');
  throw new Error('I am an uncaught exception');

server.listen(port, hostname, () => {
  console.log(`Server running at http://${hostname}:${port}/`);

For our full Node example app code and more information, please visit our official GitHub repo.


Installation and configuration is just the beginning. The airbrake-js notifier supports many other advanced uses and options including:

Please visit the airbrake-js GitHub repo for more usage and configuration examples.