File tree Expand file tree Collapse file tree 3 files changed +12
-16
lines changed Expand file tree Collapse file tree 3 files changed +12
-16
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,6 @@ import {
4949import { getEnvelopeEndpointWithUrlEncodedAuth } from './api' ;
5050import { DEBUG_BUILD } from './debug-build' ;
5151import { createEventEnvelope , createSessionEnvelope } from './envelope' ;
52- import { getClient } from './exports' ;
5352import { getIsolationScope } from './hub' ;
5453import type { IntegrationIndex } from './integration' ;
5554import { afterSetupIntegrations } from './integration' ;
@@ -933,17 +932,3 @@ function isErrorEvent(event: Event): event is ErrorEvent {
933932function isTransactionEvent ( event : Event ) : event is TransactionEvent {
934933 return event . type === 'transaction' ;
935934}
936-
937- /**
938- * Add an event processor to the current client.
939- * This event processor will run for all events processed by this client.
940- */
941- export function addEventProcessor ( callback : EventProcessor ) : void {
942- const client = getClient ( ) ;
943-
944- if ( ! client || ! client . addEventProcessor ) {
945- return ;
946- }
947-
948- client . addEventProcessor ( callback ) ;
949- }
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import type {
77 CustomSamplingContext ,
88 Event ,
99 EventHint ,
10+ EventProcessor ,
1011 Extra ,
1112 Extras ,
1213 FinishedCheckIn ,
@@ -382,6 +383,15 @@ export function getCurrentScope(): Scope {
382383 return getCurrentHub ( ) . getScope ( ) ;
383384}
384385
386+ /**
387+ * Add an event processor.
388+ * This will be added to the current isolation scope, ensuring any event that is processed in the current execution
389+ * context will have the processor applied.
390+ */
391+ export function addEventProcessor ( callback : EventProcessor ) : void {
392+ getIsolationScope ( ) . addEventProcessor ( callback ) ;
393+ }
394+
385395/**
386396 * Start a session on the current isolation scope.
387397 *
Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ export {
3434 endSession ,
3535 captureSession ,
3636 withActiveSpan ,
37+ addEventProcessor ,
3738} from './exports' ;
3839export {
3940 // eslint-disable-next-line deprecation/deprecation
@@ -58,7 +59,7 @@ export {
5859 addGlobalEventProcessor ,
5960} from './eventProcessors' ;
6061export { getEnvelopeEndpointWithUrlEncodedAuth , getReportDialogEndpoint } from './api' ;
61- export { BaseClient , addEventProcessor } from './baseclient' ;
62+ export { BaseClient } from './baseclient' ;
6263export { ServerRuntimeClient } from './server-runtime-client' ;
6364export { initAndBind , setCurrentClient } from './sdk' ;
6465export { createTransport } from './transports/base' ;
You can’t perform that action at this time.
0 commit comments