npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@getvigilia/server

v0.1.1

Published

Vigilia for your backend: errors from Supabase edge functions, Next.js routes, Vercel, Cloudflare Workers and Node — explained in plain language, with a fix for your AI.

Readme

@getvigilia/server

Errors from your app's backend, explained by Vigilia in plain language, with a fix prompt for your AI (Lovable, Bolt, Cursor, Claude Code…). Vigilia then checks that the fix held.

  • Errors only. No tracing, no logs, no auto-instrumentation.
  • Zero dependencies, one small file. It needs only fetch, so it runs on Supabase Edge Functions, Deno, Next.js, Vercel (serverless and edge), Cloudflare Workers, Netlify, Bun and Node 18+.
  • Never in the way. It never throws into your code, never touches a response that succeeded, and scrubs emails, tokens, card numbers and bank account numbers (IBANs) before anything leaves your server.

Server errors are part of Vigilia Pro.

Setup

  1. In Vigilia, open your app and create a server key under "Server errors".

  2. Set two secrets where your backend runs:

    VIGILIA_SERVER_KEY=vgk_…
    VIGILIA_ENDPOINT=https://…/v1/server/events

    Both are shown on the same page. On Supabase, run supabase secrets set VIGILIA_SERVER_KEY=… VIGILIA_ENDPOINT=…. On Cloudflare, add them as secrets (they arrive in env, which Vigilia reads).

  3. Wrap your handlers.

Supabase Edge Functions and Deno

import { withVigilia } from 'npm:@getvigilia/server';

Deno.serve(withVigilia(async (req) => {
  // …your function
}, { route: 'checkout' }));

Next.js route handlers and Vercel functions

import { withVigilia } from '@getvigilia/server';

export const POST = withVigilia(async (request: Request) => {
  // …
});

Cloudflare Workers

import { withVigilia } from '@getvigilia/server';

export default withVigilia({
  async fetch(request, env, ctx) {
    // …
  },
});

Errors are sent with ctx.waitUntil, after your response.

Express

import { vigiliaErrorHandler } from '@getvigilia/server';

// after your routes:
app.use(vigiliaErrorHandler());

Errors you catch yourself

A wrapped handler reports anything it throws, and any 5xx it returns, with the error text from a JSON body like { "error": "…" }. For an error you catch and handle some other way:

import { captureException } from '@getvigilia/server';

try {
  await chargeCard();
} catch (error) {
  await captureException(error, { request: req, route: 'checkout' });
  // …your handling
}

AI calls

If your backend calls an AI API, add one line at the top of the file:

import { watchAI } from '@getvigilia/server';

watchAI();

A call that fails is sent to Vigilia, which explains it in plain words: an account out of credit, a rejected key, rate limits, an overloaded provider. That works for OpenAI, Anthropic, Google Gemini, OpenRouter, Lovable AI, Groq, Mistral, DeepSeek and xAI. Running out of credit is the most common cause of an AI feature silently dying, and it's fixed in a billing page, not in code.

It also counts calls and tokens per model, sent in batches rather than one request per call. Vigilia charts them on your app's page and tells you when a day runs to three times your usual: a loop, or an endpoint someone else found, costs money before anything looks broken.

watchAI() wraps fetch and looks only at requests to those providers. Every response is handed back untouched. Calls made by an SDK that brings its own HTTP client, instead of fetch, aren't seen.

Check it works

import { sendTestError } from '@getvigilia/server';

console.log(await sendTestError()); // { ok: true }

It shows up in Vigilia as a test, with nothing to fix. If it says { ok: false, reason }, the reason says what's missing.

Options

Optional; the environment variables above are enough.

import { init } from '@getvigilia/server';

init({
  key: 'vgk_…',          // default: VIGILIA_SERVER_KEY
  endpoint: 'https://…', // default: VIGILIA_ENDPOINT
  environment: 'production', // default: from VERCEL_ENV, Netlify's CONTEXT, NODE_ENV…
  release: 'abc123',     // default: the platform's commit variable
  debug: true,           // log why an error wasn't sent
  beforeSend: (event) => event, // change or drop (return null) an error
});

Errors from preview and development are recorded but never alerted, like errors from your laptop in the browser.

MIT licence.