Skip to content

Commit 49d1fdb

Browse files
authored
fix: Add integrations to sdk info (#1961)
* fix: Add integrations to sdk info * fix: Imports and changelog
1 parent 9e36eea commit 49d1fdb

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
## Unreleased
44

5+
## 4.6.6
6+
7+
- [core] fix: Add integrations to sdkinfo
8+
- [browser] fix: Use `Error.toString()`
9+
510
## 4.6.5
611

712
- [browser] fix: Remove beacon transport.

packages/core/src/baseclient.ts

+14
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import {
33
Breadcrumb,
44
Integration,
55
IntegrationClass,
6+
SdkInfo,
67
SentryBreadcrumbHint,
78
SentryEvent,
89
SentryEventHint,
@@ -274,6 +275,8 @@ export abstract class BaseClient<B extends Backend, O extends Options> implement
274275
prepared.event_id = uuid4();
275276
}
276277

278+
this._addIntegrations(prepared.sdk);
279+
277280
// This should be the last thing called, since we want that
278281
// {@link Hub.addEventProcessor} gets the finished prepared event.
279282
if (scope) {
@@ -283,6 +286,17 @@ export abstract class BaseClient<B extends Backend, O extends Options> implement
283286
return prepared;
284287
}
285288

289+
/**
290+
* This function adds all used integrations to the SDK info in the event.
291+
* @param sdkInfo The sdkInfo of the event that will be filled with all integrations.
292+
*/
293+
protected _addIntegrations(sdkInfo?: SdkInfo): void {
294+
const integrationsArray = Object.keys(this.integrations);
295+
if (sdkInfo && integrationsArray.length > 0) {
296+
sdkInfo.integrations = integrationsArray;
297+
}
298+
}
299+
286300
/**
287301
* Processes an event (either error or message) and sends it to Sentry.
288302
*

0 commit comments

Comments
 (0)