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

Function getClientOptions

packages/node-core/src/light/sdk.ts:141–174  ·  view source on GitHub ↗
(
  options: NodeOptions,
  getDefaultIntegrationsImpl: (options: Options) => Integration[],
)

Source from the content-addressed store, hash-verified

139}
140
141function getClientOptions(
142 options: NodeOptions,
143 getDefaultIntegrationsImpl: (options: Options) => Integration[],
144): NodeClientOptions {
145 const release = getRelease(options.release);
146 const spotlight = getSpotlightConfig(options.spotlight);
147 const tracesSampleRate = getTracesSampleRate(options.tracesSampleRate);
148
149 const mergedOptions = {
150 ...options,
151 dsn: options.dsn ?? process.env.SENTRY_DSN,
152 environment: options.environment ?? process.env.SENTRY_ENVIRONMENT,
153 sendClientReports: options.sendClientReports ?? true,
154 transport: options.transport ?? makeNodeTransport,
155 stackParser: stackParserFromStackParserOptions(options.stackParser || defaultStackParser),
156 release,
157 tracesSampleRate,
158 spotlight,
159 debug: envToBool(options.debug ?? process.env.SENTRY_DEBUG),
160 };
161
162 const integrations = options.integrations;
163 const defaultIntegrations = options.defaultIntegrations ?? getDefaultIntegrationsImpl(mergedOptions);
164
165 const resolvedIntegrations = getIntegrationsToSetup({
166 defaultIntegrations,
167 integrations,
168 });
169
170 return {
171 ...mergedOptions,
172 integrations: resolvedIntegrations,
173 };
174}
175
176function getRelease(release: NodeOptions['release']): string | undefined {
177 if (release !== undefined) {

Callers 1

_initFunction · 0.70

Calls 6

getSpotlightConfigFunction · 0.90
envToBoolFunction · 0.90
getIntegrationsToSetupFunction · 0.90
getReleaseFunction · 0.70
getTracesSampleRateFunction · 0.70

Tested by

no test coverage detected