
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
fastify-bugsnag
Advanced tools
Easily send your application errors to Bugsnag from your Fastify server.
The plugin will decorate FastifyInstance and FastifyRequest with bugsnag property. The value behind bugsnag, is
a full BugsnagClient. Bugsnag documentation.
To the FastifyInstance is attached also an onError handler, which will send all the errors directly to your Bugsnag
dashboard. In the similar fashion as it's done by the official @bugsnag/plugin-express.
⚠️ Plugin Behaviour ⚠️
Be aware that the plugin mimics the behaviour of
official Bugsnag Express plugin with
appending
the request data to the error. That includes body, query and params which may include user data!
| Version | |
|---|---|
| Fastify | ^5.x |
| Bugsnag | ^8.0.0 |
| Node | ^20.10.0 || ^22.11.0 || >=24.0.0 |
npm install fastify-bugsnag --save
# OR
yarn add fastify-bugsnag
// Javascript
// index.js
const fastify = require('fastify')();
fastify.register(require('fastify-bugsnag'), {
apiKey: 'Your-Bugsnag-API-Key', // Defaults to process.env.BUGSNAG_API_KEY
// Rest of Bugsnag Configuration Options
});
// Typescript/ESM
// index.ts
import fastify from 'fastify';
import fastifyBugsnag from 'fastify-bugsnag';
fastify.register(fastifyBugsnag, {
apiKey: 'Your-Bugsnag-API-Key', // Defaults to process.env.BUGSNAG_API_KEY
// Rest of Bugsnag Configuration Options
});
// routes.ts
fastify.get('/', async (request, reply) => {
fastify.bugsnag.leaveBreadcrumb('Visited homepage'); // OR request.bugsnag.leaveBreadcrumb();
});
fastify.get('/error', async (request, reply) => {
request.bugsnag.notify(new Error('This is a generic error'));
});
| Parameter | Default Value | Description |
|---|---|---|
apiKey | process.env.BUGSNAG_API_KEY | API Key obtained from Bugsnag dashboard project. |
For additional options check the official documentation of Bugsnag here.
Licensed under MIT.
FAQs
Fastify plugin for Bugsnag
The npm package fastify-bugsnag receives a total of 130 weekly downloads. As such, fastify-bugsnag popularity was classified as not popular.
We found that fastify-bugsnag demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.