( options: NodeOptions, getDefaultIntegrationsImpl: (options: Options) => Integration[], )
| 187 | } |
| 188 | |
| 189 | function 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 | |
| 226 | function getRelease(release: NodeOptions['release']): string | undefined { |
| 227 | if (release !== undefined) { |
no test coverage detected