1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-04-26 06:05:23 -04:00
jarv.is/instrumentation.ts
2025-03-31 09:15:40 -04:00

24 lines
744 B
TypeScript

import * as Sentry from "@sentry/nextjs";
export const onRequestError = Sentry.captureRequestError;
export const register = () => {
Sentry.init({
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN || process.env.SENTRY_DSN,
integrations: [Sentry.captureConsoleIntegration()],
tracesSampleRate: 1.0,
// https://docs.sentry.io/platforms/javascript/guides/nextjs/configuration/options/#normalizeDepth
normalizeDepth: 5,
});
if (process.env.NEXT_RUNTIME === "nodejs") {
// filesystem is only available in nodejs runtime
// https://docs.sentry.io/platforms/javascript/guides/nextjs/configuration/integrations/fs/
Sentry.addIntegration(
Sentry.fsIntegration({
recordFilePaths: true,
})
);
}
};