@vybesec/node
v0.1.11
Published
VybeSec Node.js SDK for backend error monitoring.
Downloads
337
Maintainers
Readme
@vybesec/node
Backend error monitoring for Node.js runtimes (Next.js, Express, Fastify, Hono).
Install
npm install @vybesec/nodeInit
import { init } from "@vybesec/node";
init({
key: "pk_live_YOUR_KEY",
platform: "lovable",
environment: "production",
});Next.js (App Router)
// app/api/checkout/route.ts
import { withVybesec } from "@vybesec/node";
export const POST = withVybesec(async (req: Request) => {
// ...
});Next.js (Pages Router)
import { withVybesecApi } from "@vybesec/node";
export default withVybesecApi(async function handler(req, res) {
// ...
});Express
import express from "express";
import { vybesecErrorHandler } from "@vybesec/node/express";
const app = express();
// ... routes
app.use(vybesecErrorHandler());Fastify
import Fastify from "fastify";
import { vybesecPlugin } from "@vybesec/node/fastify";
const app = Fastify();
app.register(vybesecPlugin);Hono
import { Hono } from "hono";
import { vybesecMiddleware } from "@vybesec/node/hono";
const app = new Hono();
app.use("/*", vybesecMiddleware());Manual capture
import { captureError } from "@vybesec/node";
try {
// ...
} catch (err) {
captureError(err, { route: "/api/checkout", method: "POST", statusCode: 500 });
}