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

Function getClientOptions

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

Source from the content-addressed store, hash-verified

187}
188
189function getClientOptions(
190 options: NodeOptions,
191 getDefaultIntegrationsImpl: (options: Options) => Integration[],
192): NodeClientOptions {
193 const release = getRelease(options.release);
194
195 const spotlight = getSpotlightConfig(options.spotlight);
196
197 const tracesSampleRate = getTracesSampleRate(options.tracesSampleRate);
198
199 const mergedOptions = {
200 ...options,
201 dsn: options.dsn ?? process.env.SENTRY_DSN,
202 environment: options.environment ?? process.env.SENTRY_ENVIRONMENT,
203 sendClientReports: options.sendClientReports ?? true,
204 transport: options.transport ?? makeNodeTransport,
205 stackParser: stackParserFromStackParserOptions(options.stackParser || defaultStackParser),
206 release,
207 tracesSampleRate,
208 spotlight,
209 debug: envToBool(options.debug ?? process.env.SENTRY_DEBUG),
210 };
211
212 const integrations = options.integrations;
213 const defaultIntegrations = options.defaultIntegrations ?? getDefaultIntegrationsImpl(mergedOptions);
214
215 const resolvedIntegrations = getIntegrationsToSetup({
216 defaultIntegrations,
217 integrations,
218 });
219
220 return {
221 ...mergedOptions,
222 integrations: resolvedIntegrations,
223 };
224}
225
226function getRelease(release: NodeOptions['release']): string | undefined {
227 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