@mushi-mushi/plugin-bugsnag
v0.1.3
Published
Mushi Mushi plugin for Bugsnag — mirrors classified reports as Bugsnag errors and marks them fixed when Mushi applies a fix.
Maintainers
Readme
@mushi-mushi/plugin-bugsnag
Mushi Mushi plugin: mirror classified reports into Bugsnag and mark the
mirrored error as fixed when Mushi applies a fix.
Install
npm i @mushi-mushi/plugin-bugsnagRun as a stand-alone server
MUSHI_PLUGIN_SECRET=... # set when the plugin is installed in Mushi admin
BUGSNAG_API_KEY=... # Bugsnag Data API token
BUGSNAG_PROJECT_SLUG=... # visible in your Bugsnag project URL
ADMIN_BASE_URL=https://... # Mushi admin base URL (used in deep-link)
PORT=3000 # optional
npx mushi-plugin-bugsnagThen in the Mushi admin Marketplace install the Bugsnag Mirror plugin and
point its webhook_url at https://your-host/mushi/webhook.
Programmatic usage
import { createBugsnagPlugin } from '@mushi-mushi/plugin-bugsnag'
import express from 'express'
import { expressMiddleware } from '@mushi-mushi/plugin-sdk'
const handler = createBugsnagPlugin({
apiKey: process.env.BUGSNAG_API_KEY!,
projectSlug: process.env.BUGSNAG_PROJECT_SLUG!,
adminBaseUrl: process.env.ADMIN_BASE_URL!,
mushiSecret: process.env.MUSHI_PLUGIN_SECRET!,
})
express().post('/mushi/webhook', expressMiddleware(handler)).listen(3000)Subscribed events
report.classified→POST /v2/projects/{slug}/errors(deterministicgroupingHashkeeps user-reported issues grouped in the Bugsnag dashboard).fix.applied→PATCH /v2/projects/{slug}/errors/{errorId}withstatus: fixed.
Notes
- Outbound calls are wrapped in
withRetryfrom@mushi-mushi/plugin-sdk(honoursRetry-Afteron 429). - The default error-id cache is in-memory; persist to
report_external_issuesfor production deployments so resolves survive a restart.
License
MIT
