@beaver-tech/tracker
v0.1.0
Published
BeaverTech tracker SDK for Node.js — sends application errors and logs to a BeaverTech error monitoring server.
Maintainers
Readme
BeaverTech Tracker - Node.js SDK
Node.js SDK to send exceptions and logs to the BeaverTech error monitoring API.
Install (local path)
From your Node app:
npm install ./sdk/nodeEnvironment variables
BEAVERTECH_ERROR_MONITOR_BASE_URL=https://your-beavertech.app
BEAVERTECH_ERROR_MONITOR_API_KEY=your_api_key
APP_VERSION=2026.1.5
NODE_ENV=productionOptional overrides:
BEAVERTECH_ERROR_MONITOR_ENVIRONMENT=production
BEAVERTECH_ERROR_MONITOR_RELEASE=2026.1.5
BEAVERTECH_ERROR_MONITOR_APPLICATION=my-node-appBasic usage
const { init } = require('@beaver-tech/tracker');
init({
requestProvider: () => ({
method: 'GET',
url: '/health',
ip: '127.0.0.1'
}),
userProvider: () => ({
id: '123',
email: '[email protected]'
})
});Capture manually
const { init } = require('@beaver-tech/tracker');
const client = init();
try {
throw new Error('boom');
} catch (err) {
client.captureException(err, { tags: { module: 'billing' } });
}
client.captureLog('warning', 'Something odd', { extra: { payloadId: 'abc' } });Options
init({
enabled: true,
captureExceptions: true,
captureLogs: true,
captureConsole: true,
timeout: 2000,
logLevels: ['error', 'warning', 'info'],
environment: 'production',
release: '2026.1.5',
application: 'node-app',
tags: { tenant: 'alpha' },
extra: { service: 'api' }
});Notes
- Exceptions are captured via
uncaughtExceptionandunhandledRejection. - Logs are captured by patching
console.*whencaptureConsoleis enabled. - If
BEAVERTECH_ERROR_MONITOR_BASE_URLorBEAVERTECH_ERROR_MONITOR_API_KEYis empty, nothing is sent.
