( options: NodeOptions, getDefaultIntegrationsImpl: (options: Options) => Integration[], )
| 139 | } |
| 140 | |
| 141 | function 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 | |
| 176 | function getRelease(release: NodeOptions['release']): string | undefined { |
| 177 | if (release !== undefined) { |
no test coverage detected