18 lines
515 B
TypeScript
18 lines
515 B
TypeScript
import * as Sentry from '@sentry/nextjs';
|
|
|
|
// Next.js will call this on boot for the active runtime.
|
|
// We dynamically import the correct Sentry config file.
|
|
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');
|
|
}
|
|
}
|
|
|
|
// Capture errors from Server Components, middleware and route handlers.
|
|
export const onRequestError = Sentry.captureRequestError;
|
|
|