MCPcopy Index your code
hub / github.com/getsentry/sentry-javascript / init

Function init

packages/nuxt/src/server/sdk.ts:27–43  ·  view source on GitHub ↗
(options: SentryNuxtServerOptions)

Source from the content-addressed store, hash-verified

25 * @param options Configuration options for the SDK.
26 */
27export 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

Callers 1

sdk.test.tsFile · 0.90

Calls 7

isCjsFunction · 0.90
applySdkMetadataFunction · 0.90
getGlobalScopeFunction · 0.90
addEventProcessorMethod · 0.80

Tested by

no test coverage detected