mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-04-26 09:25:22 -04:00
24 lines
744 B
TypeScript
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,
|
|
})
|
|
);
|
|
}
|
|
};
|