- API: add @sentry/nestjs with instrument.ts, SentryModule, and SentryGlobalFilter - Web: add @sentry/nextjs with client/server/edge configs, instrumentation hook - Update next.config.js with withSentryConfig wrapper - Replace TODO in error.tsx with Sentry.captureException - Add SENTRY_DSN, SENTRY_AUTH_TOKEN, SENTRY_ORG, SENTRY_PROJECT to .env.example Co-Authored-By: Paperclip <noreply@paperclip.ing>
14 lines
332 B
TypeScript
14 lines
332 B
TypeScript
import * as Sentry from '@sentry/nextjs';
|
|
|
|
export async function register() {
|
|
if (process.env['NEXT_RUNTIME'] === 'nodejs') {
|
|
await import('./sentry.server.config');
|
|
}
|
|
|
|
if (process.env['NEXT_RUNTIME'] === 'edge') {
|
|
await import('./sentry.edge.config');
|
|
}
|
|
}
|
|
|
|
export const onRequestError = Sentry.captureRequestError;
|