* chore: Upgrade Sentry in v1, v2 & web * fix: Keep ./instrument to be the first line * Remove eslint-plugin-import (fixed in prettier) * Optimistic removal pending some feedback * Simplified and fixed sentry wrapper * Create instrumentation.ts also in APIv1 * sentry key in main nextConfig is deprecated
18 lines
445 B
TypeScript
18 lines
445 B
TypeScript
import * as Sentry from "@sentry/nextjs";
|
|
|
|
export function register() {
|
|
if (process.env.NEXT_RUNTIME === "nodejs") {
|
|
Sentry.init({
|
|
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
|
|
// reduce sample rate to 10% on production
|
|
tracesSampleRate: process.env.NODE_ENV !== "production" ? 1.0 : 0.1,
|
|
});
|
|
}
|
|
|
|
if (process.env.NEXT_RUNTIME === "edge") {
|
|
Sentry.init({
|
|
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
|
|
});
|
|
}
|
|
}
|