@digivogt/exceptions-node
v1.0.0
Published
Digivogt exception tracker for Node.js — zero-dependency error reporting
Downloads
99
Maintainers
Readme
@digivogt/exceptions-node
Zero-dependency exception tracker for Node.js applications. Reports errors to the Digivogt exception tracking API.
Install
npm install @digivogt/exceptions-nodeUsage
import { init, captureException } from '@digivogt/exceptions-node';
init({
vogteiId: 'your-vogtei-id',
source: 'my-api-server', // optional, identifies the reporting app
environment: 'production', // optional
apiUrl: 'https://api.digivogt.com', // optional, this is the default
});
// Manual capture
try {
riskyOperation();
} catch (error) {
captureException(error, { userId: '123' });
}After calling init(), uncaught exceptions and unhandled promise rejections are automatically captured via process.on('uncaughtException') and process.on('unhandledRejection').
API
init(options)
| Option | Type | Required | Description |
|--------|------|----------|-------------|
| vogteiId | string | yes | Your Vogtei ID |
| source | string | no | Name of the reporting application |
| environment | string | no | e.g. production, staging |
| apiUrl | string | no | API base URL (default: https://api.digivogt.com) |
captureException(error, context?)
| Parameter | Type | Description |
|-----------|------|-------------|
| error | Error | The error to report |
| context | object | Optional key-value metadata attached to the report |
Requirements
- Node.js >= 18 (uses native
fetch) - No runtime dependencies
How it works
Exceptions are sent to POST /vogteien/:vogteiId/exceptions (a public endpoint, no authentication required). The API deduplicates by fingerprint (SHA-256 of error type + first stack frame) and tracks occurrence count, first/last seen timestamps, and the latest stack trace and context.
License
MIT
