Skip to content

Commit 03d08b0

Browse files
committed
port setExtra
1 parent 79470f0 commit 03d08b0

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

packages/hub/src/exports.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Breadcrumb, CaptureContext, Event, Extras, Primitive, Severity, SeverityLevel } from '@sentry/types';
1+
import { Breadcrumb, CaptureContext, Event, Extra, Extras, Primitive, Severity, SeverityLevel } from '@sentry/types';
22

33
import { getCurrentHub, Hub } from './hub';
44
import { Scope } from './scope';
@@ -96,6 +96,15 @@ export function setExtras(extras: Extras): ReturnType<Hub['setExtras']> {
9696
getCurrentHub().setExtras(extras);
9797
}
9898

99+
/**
100+
* Set key:value that will be sent as extra data with the event.
101+
* @param key String of extra
102+
* @param extra Any kind of data. This data will be normalized.
103+
*/
104+
export function setExtra(key: string, extra: Extra): ReturnType<Hub['setExtra']> {
105+
getCurrentHub().setExtra(key, extra);
106+
}
107+
99108
/**
100109
* Set an object that will be merged sent as tags data with the event.
101110
* @param tags Tags context object to merge into current context.

packages/minimal/src/index.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,6 @@ function callOnHub<T>(method: string, ...args: any[]): T {
2929
throw new Error(`No hub defined or ${method} was not found on the hub, please open a bug report.`);
3030
}
3131

32-
/**
33-
* Set key:value that will be sent as extra data with the event.
34-
* @param key String of extra
35-
* @param extra Any kind of data. This data will be normalized.
36-
*/
37-
export function setExtra(key: string, extra: Extra): void {
38-
callOnHub<void>('setExtra', key, extra);
39-
}
40-
4132
/**
4233
* Set key:value that will be sent as tags data with the event.
4334
*

0 commit comments

Comments
 (0)