Skip to content

Commit

Permalink
ref(ember): Allow initing Ember without config entry (#3745)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
k-fish authored Jun 25, 2021
1 parent 460994d commit 0b42582
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/ember/addon/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 0b42582

Please sign in to comment.