watchup-sdk
v1.0.6
Published
A simple SDK for sending events and errors to WatchUp.
Readme
watchup-sdk
A simple SDK for sending events and errors to WatchUp.
Install
npm install watchup-sdkUsage
import { initWatchup } from "watchup-sdk";
const watchup = initWatchup({
apiKey: "YOUR_API_KEY",
projectId: "YOUR_PROJECT_ID",
environment: "production"
});
// Capture an exception
watchup.captureException(new Error("Something went wrong!"));
// Capture a message
watchup.captureMessage("A custom log message");API
initWatchup(config)— Initializes the SDK and returns a worker withcaptureExceptionandcaptureMessagemethods.createWorker(config)— Lower-level API to create a worker directly.sendEvent(type, payload, context, config)— Send a custom event.normalizeError(error)— Utility to normalize error objects.
Types
See WatchUpConfig and WatchupContext in the type exports.
License
ISC
