Skip to content

Commit

Permalink
fix: Don't override metadata (#3304)
Browse files Browse the repository at this point in the history
  • Loading branch information
iker-barriocanal authored and ahmedetefy committed Mar 10, 2021
1 parent c922e03 commit ca051d0
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions packages/react/src/sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,18 @@ import { BrowserOptions, init as browserInit, SDK_VERSION } from '@sentry/browse
*/
export function init(options: BrowserOptions): void {
options._metadata = options._metadata || {};
options._metadata.sdk = {
name: 'sentry.javascript.react',
packages: [
{
name: 'npm:@sentry/react',
version: SDK_VERSION,
},
],
version: SDK_VERSION,
};
if (options._metadata.sdk === undefined) {
options._metadata.sdk = {
name: 'sentry.javascript.react',
packages: [
{
name: 'npm:@sentry/react',
version: SDK_VERSION,
},
],
version: SDK_VERSION,
};
}

browserInit(options);
}

0 comments on commit ca051d0

Please sign in to comment.