File tree 4 files changed +5
-12
lines changed
integration-node-breadcrumbs/src 4 files changed +5
-12
lines changed Original file line number Diff line number Diff line change @@ -139,7 +139,7 @@ export function showReportDialog(
139
139
}
140
140
141
141
options . eventId = options . eventId ?? client . lastEventId ( ) ;
142
- options . dsn = options . dsn ?? client . getDsn ( ) ?. toString ( ) ;
142
+ options . dsn = options . dsn ?? client . options . dsn ;
143
143
144
144
if ( client . options . enabled === false ) {
145
145
logger . error ( `${ errPrefix } disabled client` ) ;
Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ export abstract class BaseClient<O extends Options> implements ClientLike<O> {
67
67
public readonly options : O ;
68
68
69
69
/** The client Dsn, if specified in options. Without this Dsn, the SDK will be disabled. */
70
- protected readonly _dsn ?: Dsn ;
70
+ public readonly dsn ?: Dsn ;
71
71
72
72
/** Array of used integrations. */
73
73
protected _integrations : IntegrationIndex = { } ;
@@ -94,7 +94,7 @@ export abstract class BaseClient<O extends Options> implements ClientLike<O> {
94
94
this . options = options ;
95
95
96
96
if ( options . dsn ) {
97
- this . _dsn = new Dsn ( options . dsn ) ;
97
+ this . dsn = new Dsn ( options . dsn ) ;
98
98
}
99
99
100
100
this . _transport = this . _setupTransport ( ) ;
@@ -118,11 +118,6 @@ export abstract class BaseClient<O extends Options> implements ClientLike<O> {
118
118
this . _eventProcessors . push ( callback ) ;
119
119
}
120
120
121
- // TODO: To be removed? Can be obtained from options
122
- public getDsn ( ) : Dsn | undefined {
123
- return this . _dsn ;
124
- }
125
-
126
121
/**
127
122
* @inheritDoc
128
123
*/
Original file line number Diff line number Diff line change @@ -94,10 +94,9 @@ function _createWrappedRequestMethodFactory(
94
94
const requestArgs = normalizeRequestArgs ( args ) ;
95
95
const requestOptions = requestArgs [ 0 ] ;
96
96
const requestUrl = extractUrl ( requestOptions ) ;
97
- const dsn = client . getDsn ( ) ;
98
97
99
98
// we don't want to record requests to Sentry as either breadcrumbs or spans, so just use the original method
100
- if ( ! dsn || requestUrl . includes ( dsn . host ) ) {
99
+ if ( ! client . dsn || requestUrl . includes ( client . dsn ? .host ) ) {
101
100
return originalRequestMethod . apply ( httpModule , requestArgs ) ;
102
101
}
103
102
Original file line number Diff line number Diff line change @@ -16,12 +16,11 @@ import { Session } from './session';
16
16
*/
17
17
export interface ClientLike < O extends Options = Options > {
18
18
options : O ;
19
+ dsn ?: Dsn ;
19
20
20
21
getScope ( ) : ScopeLike ;
21
22
setScope ( scope : ScopeLike ) : void ;
22
23
addEventProcessor ( callback : EventProcessor ) : void ;
23
- // TODO: To be removed? Can be obtained from options
24
- getDsn ( ) : Dsn | undefined ;
25
24
lastEventId ( ) : string | undefined ;
26
25
27
26
captureException ( exception : unknown , captureContext ?: CaptureContext ) : string | undefined ;
You can’t perform that action at this time.
0 commit comments