We just published @inariwatch/capture on npm.
Why we built it
InariWatch monitors your stack and fixes production errors automatically. But we depended on Sentry to capture those errors. That meant our users needed a Sentry account and subscription — just to feed data into InariWatch.
So we built our own error capture SDK. 9.8 KB. Zero dependencies. The data flows directly from your app to InariWatch's AI pipeline.
What it does
import { init, captureException, captureLog, flush } from "@inariwatch/capture";
init({ dsn: "https://app.inariwatch.com/api/webhooks/capture/YOUR_PROJECT_ID", environment: "production", release: "1.2.0", });
// Catch errors app.use((err, req, res, next) => { captureException(err); res.status(500).json({ error: "Internal error" }); });
// Structured logs captureLog("DB timeout", "error", { query: "SELECT...", duration: 5200 });
// Flush before exit (serverless) await flush();
The numbers
- 9.8 KB package size
- 0 dependencies
- HMAC signing for webhook verification
- Retry buffer for failed sends (up to 30 events)
- Fingerprinting for deduplication
- Deploy markers — set a release version and InariWatch tracks deploys automatically
How it connects to InariWatch
When an error arrives via the capture SDK, InariWatch: 1. Auto-analyzes it with AI (free, no key needed) 2. Correlates it with other alerts from your stack 3. If you have an AI key: diagnoses the root cause, reads your code, generates a fix, opens a PR
The entire pipeline — from error to PR — uses data that flows through your own SDK. No third-party middleware.
Local development
Point the DSN to localhost and the CLI capture server receives events locally:
init({ dsn: "http://localhost:9111/ingest" });
Run inariwatch dev and errors from your dev server get diagnosed and fixed in real-time.
Install
npm install @inariwatch/capture
