(options: SentryNuxtServerOptions)
| 25 | * @param options Configuration options for the SDK. |
| 26 | */ |
| 27 | export function init(options: SentryNuxtServerOptions): Client | undefined { |
| 28 | const envFallback = !isCjs() && import.meta.dev ? DEV_ENVIRONMENT : DEFAULT_ENVIRONMENT; |
| 29 | const sentryOptions = { |
| 30 | environment: options.environment ?? process.env.SENTRY_ENVIRONMENT ?? envFallback, |
| 31 | defaultIntegrations: getNuxtDefaultIntegrations(options), |
| 32 | ...options, |
| 33 | }; |
| 34 | |
| 35 | applySdkMetadata(sentryOptions, 'nuxt', ['nuxt', 'node']); |
| 36 | |
| 37 | const client = initNode(sentryOptions); |
| 38 | |
| 39 | getGlobalScope().addEventProcessor(lowQualityTransactionsFilter(options)); |
| 40 | getGlobalScope().addEventProcessor(clientSourceMapErrorFilter(options)); |
| 41 | |
| 42 | return client; |
| 43 | } |
| 44 | |
| 45 | /** |
| 46 | * Filter out transactions for resource requests which we don't want to send to Sentry |
no test coverage detected