File tree Expand file tree Collapse file tree 4 files changed +16
-0
lines changed Expand file tree Collapse file tree 4 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -97,6 +97,8 @@ export abstract class BaseClient<O extends ClientOptions> implements Client<O> {
9797 /** Holds flushable */
9898 private _outcomes : { [ key : string ] : number } = { } ;
9999
100+ private _hooks : Record < > = { } ;
101+
100102 /**
101103 * Initializes this client instance.
102104 *
@@ -351,6 +353,8 @@ export abstract class BaseClient<O extends ClientOptions> implements Client<O> {
351353 }
352354 }
353355
356+ public on ( ) : ( ) => void { }
357+
354358 /** Updates existing session based on the provided event */
355359 protected _updateSessionFromEvent ( session : Session , event : Event ) : void {
356360 let crashed = false ;
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import type { Scope } from './scope';
88import type { SdkMetadata } from './sdkmetadata' ;
99import type { Session , SessionAggregates } from './session' ;
1010import type { Severity , SeverityLevel } from './severity' ;
11+ import type { Transaction } from './transaction' ;
1112import type { Transport } from './transport' ;
1213
1314/**
@@ -147,4 +148,13 @@ export interface Client<O extends ClientOptions = ClientOptions> {
147148 * @param event The dropped event.
148149 */
149150 recordDroppedEvent ( reason : EventDropReason , dataCategory : DataCategory , event ?: Event ) : void ;
151+
152+ // HOOKS
153+
154+ on (
155+ hook : 'startTransaction' | 'transactionFinish' ,
156+ callback : ( transaction : Transaction ) => Transaction | null ,
157+ ) : ( ) => void ;
158+
159+ emit ( hook : Hooks , ...params : unknown [ ] ) : void ;
150160}
Original file line number Diff line number Diff line change 1+ export type Hooks = 'startTransaction' | 'transactionFinish' ;
Original file line number Diff line number Diff line change @@ -96,3 +96,4 @@ export type { WrappedFunction } from './wrappedfunction';
9696export type { Instrumenter } from './instrumenter' ;
9797
9898export type { BrowserClientReplayOptions } from './browseroptions' ;
99+ export type { Hooks } from './hooks' ;
You can’t perform that action at this time.
0 commit comments