What is the Steadwing Node SDK?
The Steadwing Node SDK auto-captures exceptions, error logs, and HTTP breadcrumbs from your Node.js applications and sends them to Steadwing for root cause analysis. Add two lines of code and Steadwing starts monitoring your application no manual instrumentation required.Auto-Capture
Unhandled exceptions, rejections, and error logs captured automatically
HTTP Breadcrumbs
Outgoing HTTP/HTTPS requests recorded with method, URL, status, and duration
Express & Fastify
Route error capture with full request context
Data Scrubbing
Sensitive fields (passwords, tokens, API keys) redacted before sending
Installation
Quick Start
Get your API key from app.steadwing.com/organization, then initialize the SDK:- Captures unhandled exceptions (
uncaughtException) - Captures unhandled promise rejections (
unhandledRejection) - Captures
console.error(), winston, and pino error-level logs - Records outgoing HTTP/HTTPS requests as breadcrumbs
- Sends heartbeats every 60 seconds
Configuration
Only events sent with
env="PROD" are considered for auto-monitoring. Events from other environments are received but will not trigger automated RCA.Manual Capture
For cases where you want to explicitly report errors or messages:- Capture Exception
- Capture Message
What Gets Captured
Exceptions
| Data | Description |
|---|---|
| Stack trace | Full V8 stack trace with file, line, and column |
| Exception chain | Error.cause chain included |
| Breadcrumbs | Last 100 events leading up to the error |
| Request context | Method, path, headers (when using framework middleware) |
Logs
console.error()sent as events- Winston error/crit/emerg-level logs sent as events
- Pino error/fatal-level logs sent as events
- All log levels recorded as breadcrumbs for context
HTTP Breadcrumbs
Every outgoing HTTP/HTTPS request is recorded with:- Method and URL
- Response status code
- Request duration
- Rolling buffer of last 100 entries
Data Scrubbing
Sensitive data is automatically scrubbed before leaving your application. Keys matching the following patterns (case-insensitive) have their values replaced with[REDACTED]:
Framework Support
| Framework | What’s Captured |
|---|---|
| Express | Route errors with full request context (method, path, headers) |
| Fastify | Route errors with request context via onError hook |
| winston | Error-level log capture (auto-detected) |
| pino | Error-level log capture (auto-detected) |
Express
Add the error handler as your last middleware:Fastify
Register the plugin on your Fastify instance:TypeScript
Full TypeScript support with exported types:FAQs
Do I need to change my code?
Do I need to change my code?
No. After calling
steadwing.init(), the SDK hooks into Node’s exception handling, console, and HTTP modules automatically. For Express/Fastify request context, add one line of middleware.What's the performance impact?
What's the performance impact?
Minimal. Events are batched and sent every 5 seconds in a non-blocking flush. Breadcrumbs are stored in a fixed-size buffer. Timers use
unref() so the SDK never keeps your process alive.Can I disable it in development?
Can I disable it in development?
Yes. Pass
enabled: false to steadwing.init() and the SDK becomes a no-op, no patches are installed and no events are sent.How does it work with existing error tracking (Sentry, etc.)?
How does it work with existing error tracking (Sentry, etc.)?
The SDK coexists with other error trackers. It listens on
process.on('uncaughtException') and patches console.error without removing existing listeners or handlers.Is my data secure?
Is my data secure?
Sensitive fields are scrubbed before transmission. Data is sent over HTTPS to Steadwing’s backend. See the Data Scrubbing section for details on what’s redacted.