// PBI/v1-readiness item 2: Next.js instrumentation hook — koppelt Sentry's
// server- en edge-configs aan de juiste runtime. Bestand moet in project-root
// staan voor Next.js 15+.

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
