Server-side JS (Bun)
Capture backend errors in Bun services.
Install the Sentry SDK and configure your DSN.
bun add @sentry/nodeimport * as Sentry from "@sentry/node";
Sentry.init({
dsn: "http://<publicKey>@localhost:3000/<projectId>",
tracesSampleRate: 1.0,
});Send a test error:
try {
throw new Error("TryOpenTrace server test");
} catch (error) {
Sentry.captureException(error);
}