New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

@solenai/monitor

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

@solenai/monitor

Lightweight incident reporter for Solen MetaShift webhooks (Sentry-compatible payload)

npmnpm
Version
0.1.0
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

@solen/monitor

Report runtime errors to Solen MetaShift incident webhooks. Payloads use a Sentry-compatible shape so MetaShift normalizes them automatically. No runtime dependencies—Node 18+ built-in fetch only.

Install

npm install @solen/monitor

Quick setup

import { monitor } from '@solen/monitor';

const { captureError } = monitor({
  webhookUrl: process.env.SOLEN_WEBHOOK_URL!,
  secret: process.env.SOLEN_WEBHOOK_SECRET!,
  environment: 'production',
});

Calling monitor() registers uncaughtException and unhandledRejection handlers and returns manual capture helpers.

Express middleware

import express from 'express';
import { monitor } from '@solen/monitor';
import { solenErrorHandler } from '@solen/monitor/express';

const { captureError } = monitor({
  webhookUrl: process.env.SOLEN_WEBHOOK_URL!,
  secret: process.env.SOLEN_WEBHOOK_SECRET!,
});

const app = express();
app.use(solenErrorHandler({ captureError }));

solenErrorHandler captures the error with route, method, and status, then calls next(err) so your existing error handlers still run.

Manual capture

import { monitor } from '@solen/monitor';

const { captureError, captureMessage } = monitor({
  webhookUrl: process.env.SOLEN_WEBHOOK_URL!,
  secret: process.env.SOLEN_WEBHOOK_SECRET!,
});

try {
  await chargeCustomer(orderId);
} catch (err) {
  await captureError(err, {
    extra: { orderId },
    tags: { service: 'billing' },
  });
  throw err;
}

await captureMessage('Stripe webhook replay detected', { level: 'warning' });

Webhook URL and secret

Create an incident webhook endpoint in the Solen dashboard:

https://solenai.ca/integrations/webhooks

Each endpoint provides:

  • Webhook URL — MetaShift ingest URL (/api/webhooks/incident/{endpointId})
  • Secret — sent as the X-Solen-Secret header on every request

Store both in environment variables (for example SOLEN_WEBHOOK_URL and SOLEN_WEBHOOK_SECRET) and pass them to monitor().

Fastify

import Fastify from 'fastify';
import { monitor } from '@solen/monitor';
import { solenFastifyPlugin } from '@solen/monitor/fastify';

const { captureError } = monitor({ webhookUrl, secret });
const app = Fastify();
await app.register(solenFastifyPlugin, { captureError });

Requirements

  • Node.js 18+
  • Optional peers: express (for @solen/monitor/express), fastify (for @solen/monitor/fastify)

Keywords

solen

FAQs

Package last updated on 16 May 2026

Related posts