diff --git a/packages/ember/addon/index.ts b/packages/ember/addon/index.ts index 861093e70b6d..76248bf7a219 100644 --- a/packages/ember/addon/index.ts +++ b/packages/ember/addon/index.ts @@ -17,6 +17,11 @@ export function InitSentryForEmber(_runtimeConfig: BrowserOptions | undefined) { assert('Missing configuration.', config); assert('Missing configuration for Sentry.', config.sentry || _runtimeConfig); + if (!config.sentry) { + // If environment config is not specified but the above assertion passes, use runtime config. + config.sentry = { ..._runtimeConfig } as any; + } + // Permanently merge options into config, preferring runtime config Object.assign(config.sentry, _runtimeConfig || {}); const initConfig = Object.assign({}, config.sentry);