Skip to content

Commit 0b42582

Browse files
authored
ref(ember): Allow initing Ember without config entry (#3745)
Using the config is only necessary if you want to change specific addon options now, and the docs are going to be updated to reflect this. Passing a config object to should work without a config entry for sentry.
1 parent 460994d commit 0b42582

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/ember/addon/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ export function InitSentryForEmber(_runtimeConfig: BrowserOptions | undefined) {
1717
assert('Missing configuration.', config);
1818
assert('Missing configuration for Sentry.', config.sentry || _runtimeConfig);
1919

20+
if (!config.sentry) {
21+
// If environment config is not specified but the above assertion passes, use runtime config.
22+
config.sentry = { ..._runtimeConfig } as any;
23+
}
24+
2025
// Permanently merge options into config, preferring runtime config
2126
Object.assign(config.sentry, _runtimeConfig || {});
2227
const initConfig = Object.assign({}, config.sentry);

0 commit comments

Comments
 (0)