(_runtimeConfig?: BrowserOptions)
| 26 | * Initialize the Sentry SDK for Ember. |
| 27 | */ |
| 28 | export function init(_runtimeConfig?: BrowserOptions): Client | undefined { |
| 29 | const environmentConfig = getOwnConfig<OwnConfig>().sentryConfig; |
| 30 | |
| 31 | assert('Missing configuration.', environmentConfig); |
| 32 | assert('Missing configuration for Sentry.', environmentConfig.sentry || _runtimeConfig); |
| 33 | |
| 34 | if (!environmentConfig.sentry) { |
| 35 | // If environment config is not specified but the above assertion passes, use runtime config. |
| 36 | environmentConfig.sentry = { ..._runtimeConfig }; |
| 37 | } |
| 38 | |
| 39 | // Merge runtime config into environment config, preferring runtime. |
| 40 | Object.assign(environmentConfig.sentry, _runtimeConfig || {}); |
| 41 | const initConfig = Object.assign({}, environmentConfig.sentry); |
| 42 | |
| 43 | applySdkMetadata(initConfig, 'ember'); |
| 44 | |
| 45 | // Persist Sentry init options so they are identical when performance initializers call init again. |
| 46 | const sentryInitConfig = _getSentryInitConfig(); |
| 47 | Object.assign(sentryInitConfig, initConfig); |
| 48 | |
| 49 | return Sentry.init(initConfig); |
| 50 | } |
| 51 | |
| 52 | type RouteConstructor = new (...args: ConstructorParameters<typeof Route>) => Route; |
| 53 |
no test coverage detected