16 lines
452 B
TypeScript
16 lines
452 B
TypeScript
import { assertProductionEnv } from "@/config/env";
|
|
import { scrubSentryEvent, sentryInitOptions } from "@/infra/observability/capture";
|
|
|
|
export async function register() {
|
|
assertProductionEnv(process.env);
|
|
const options = sentryInitOptions(process.env.SENTRY_DSN);
|
|
if (!options) return;
|
|
const Sentry = await import("@sentry/nextjs");
|
|
Sentry.init({
|
|
...options,
|
|
beforeSend(event) {
|
|
return scrubSentryEvent(event);
|
|
},
|
|
});
|
|
}
|