@oopsie-exceptions/node
v0.1.4
Published
Node runtime for @oopsie-exceptions: fetch transport, uncaughtException/unhandledRejection handlers, AsyncLocalStorage context.
Maintainers
Readme
@oopsie-exceptions/node
Node runtime bindings for @oopsie-exceptions. Adds:
NodeTransport—fetch-based HTTP transport with timeout.installGlobalHandlers()— catchesuncaughtException+unhandledRejection.AsyncLocalStorageContextStore— request-scoped context that doesn't bleed between concurrent async tasks.
import { OopsieClient } from "@oopsie-exceptions/core";
import {
AsyncLocalStorageContextStore,
NodeTransport,
installGlobalHandlers,
nodeServerInfo,
} from "@oopsie-exceptions/node";
const client = new OopsieClient({
appName: "MyApp",
environment: process.env.NODE_ENV ?? "development",
webhooks: [{
url: process.env.OOPSIE_WEBHOOK_URL!,
headers: { Authorization: `Bearer ${process.env.OOPSIE_TOKEN}` },
}],
transport: new NodeTransport(),
contextStore: new AsyncLocalStorageContextStore(),
serverInfo: nodeServerInfo,
});
installGlobalHandlers(client);See the root README for full API docs.
