Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 55f574a

Browse files
committedApr 22, 2025·
update more docstrings and add spacing
1 parent a5bf4f6 commit 55f574a

File tree

1 file changed

+71
-18
lines changed

1 file changed

+71
-18
lines changed
 

‎packages/core/src/types-hoist/options.ts

Lines changed: 71 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,53 +12,78 @@ import type { BaseTransportOptions, Transport } from './transport';
1212

1313
export interface ClientOptions<TO extends BaseTransportOptions = BaseTransportOptions> {
1414
/**
15-
* Enable debug functionality in the SDK itself
15+
* Enable debug functionality in the SDK itself. If `debug` is set to `true` the SDK will attempt
16+
* to print out useful debugging information about what the SDK is doing.
17+
*
1618
* @default false
1719
*/
1820
debug?: boolean;
1921

2022
/**
21-
* Specifies whether this SDK should send events to Sentry.
23+
* Specifies whether this SDK should send events to Sentry. Setting this to `enabled: false`
24+
* doesn't prevent all overhead from Sentry instrumentation. To disable Sentry completely,
25+
* depending on environment, call `Sentry.init conditionally.
26+
*
2227
* @default true
2328
*/
2429
enabled?: boolean;
2530

2631
/**
27-
* Attaches stacktraces to pure capture message / log integrations
32+
* When enabled, stack traces are automatically attached to all events captured with `Sentry.captureMessage`.
33+
*
34+
* Grouping in Sentry is different for events with stack traces and without. As a result, you will get
35+
* new groups as you enable or disable this flag for certain events.
36+
*
2837
* @default false
2938
*/
3039
attachStacktrace?: boolean;
3140

3241
/**
33-
* Send SDK Client Reports. When calling `Sentry.init()`, this option defaults to `true`.
42+
* Send SDK Client Reports, which are used to emit outcomes about events that the SDK dropped
43+
* or failed to capture.
44+
*
3445
* @default true
3546
*/
3647
sendClientReports?: boolean;
3748

3849
/**
39-
* The Dsn used to connect to Sentry and identify the project. If omitted, the
40-
* SDK will not send any data to Sentry.
50+
* The DSN tells the SDK where to send the events. If this is not set, the SDK will not send any events to Sentry.
51+
*
52+
* @default undefined
4153
*/
4254
dsn?: string;
4355

4456
/**
45-
* The release identifier used when uploading respective source maps. Specify
46-
* this value to allow Sentry to resolve the correct source maps when
47-
* processing events.
57+
* Sets the release. Release names are strings, but some formats are detected by Sentry and might be
58+
* rendered differently. Learn more about how to send release data so Sentry can tell you about
59+
* regressions between releases and identify the potential source in the
60+
* [releases documentation](https://docs.sentry.io/product/releases/)
61+
*
62+
* @default undefined
4863
*/
4964
release?: string;
5065

5166
/**
5267
* The current environment of your application (e.g. "production").
68+
*
69+
* Environments are case-sensitive. The environment name can't contain newlines, spaces or forward slashes,
70+
* can't be the string "None", or exceed 64 characters. You can't delete environments, but you can hide them.
71+
*
5372
* @default "production"
5473
*/
5574
environment?: string;
5675

57-
/** Sets the distribution for all events */
76+
/**
77+
* Sets the distribution of the application. Distributions are used to disambiguate build or
78+
* deployment variants of the same release of an application.
79+
*
80+
* @default undefined
81+
*/
5882
dist?: string;
5983

6084
/**
6185
* List of integrations that should be installed after SDK was initialized.
86+
*
6287
* @default []
6388
*/
6489
integrations: Integration[];
@@ -70,8 +95,7 @@ export interface ClientOptions<TO extends BaseTransportOptions = BaseTransportOp
7095
transport: (transportOptions: TO) => Transport;
7196

7297
/**
73-
* A stack parser implementation
74-
* By default, a stack parser is supplied for all supported platforms
98+
* A stack parser implementation. By default, a stack parser is supplied for all supported platforms.
7599
*/
76100
stackParser: StackParser;
77101

@@ -84,10 +108,12 @@ export interface ClientOptions<TO extends BaseTransportOptions = BaseTransportOp
84108
* Sample rate to determine trace sampling.
85109
*
86110
* 0.0 = 0% chance of a given trace being sent (send no traces) 1.0 = 100% chance of a given trace being sent (send
87-
* all traces)
111+
* all traces).
88112
*
89113
* Tracing is enabled if either this or `tracesSampler` is defined. If both are defined, `tracesSampleRate` is
90-
* ignored.
114+
* ignored. Set this and `tracesSampler` to `undefined` to disable tracing.
115+
*
116+
* @default undefined
91117
*/
92118
tracesSampleRate?: number;
93119

@@ -106,27 +132,32 @@ export interface ClientOptions<TO extends BaseTransportOptions = BaseTransportOp
106132

107133
/**
108134
* Initial data to populate scope.
135+
*
136+
* @default undefined
109137
*/
110138
initialScope?: CaptureContext;
111139

112140
/**
113141
* The maximum number of breadcrumbs sent with events.
114142
* Sentry has a maximum payload size of 1MB and any events exceeding that payload size will be dropped.
143+
*
115144
* @default 100
116145
*/
117146
maxBreadcrumbs?: number;
118147

119148
/**
120-
* A global sample rate to apply to all events.
149+
* A global sample rate to apply to all error events.
121150
*
122151
* 0.0 = 0% chance of a given event being sent (send no events) 1.0 = 100% chance of a given event being sent (send
123152
* all events)
153+
*
124154
* @default 1.0
125155
*/
126156
sampleRate?: number;
127157

128158
/**
129159
* Maximum number of chars a single value can have before it will be truncated.
160+
*
130161
* @default 250
131162
*/
132163
maxValueLength?: number;
@@ -138,6 +169,7 @@ export interface ClientOptions<TO extends BaseTransportOptions = BaseTransportOp
138169
* - `user`
139170
* - `contexts`
140171
* - `extra`
172+
*
141173
* @default 3
142174
*/
143175
normalizeDepth?: number;
@@ -149,20 +181,29 @@ export interface ClientOptions<TO extends BaseTransportOptions = BaseTransportOp
149181
* - `user`
150182
* - `contexts`
151183
* - `extra`
184+
*
152185
* @default 1000
153186
*/
154187
normalizeMaxBreadth?: number;
155188

156189
/**
157190
* A pattern for error messages which should not be sent to Sentry.
158191
* By default, all errors will be sent.
192+
*
193+
* Behavior of the `ignoreErrors` option is controlled by the `Sentry.eventFiltersIntegration` integration. If the
194+
* event filters integration is not installed, the `ignoreErrors` option will not have any effect.
195+
*
159196
* @default []
160197
*/
161198
ignoreErrors?: Array<string | RegExp>;
162199

163200
/**
164201
* A pattern for transaction names which should not be sent to Sentry.
165202
* By default, all transactions will be sent.
203+
*
204+
* Behavior of the `ignoreTransactions` option is controlled by the `Sentry.eventFiltersIntegration` integration.
205+
* If the event filters integration is not installed, the `ignoreTransactions` option will not have any effect.
206+
*
166207
* @default []
167208
*/
168209
ignoreTransactions?: Array<string | RegExp>;
@@ -171,13 +212,16 @@ export interface ClientOptions<TO extends BaseTransportOptions = BaseTransportOp
171212
* A URL to an envelope tunnel endpoint. An envelope tunnel is an HTTP endpoint
172213
* that accepts Sentry envelopes for forwarding. This can be used to force data
173214
* through a custom server independent of the type of data.
215+
*
216+
* @default undefined
174217
*/
175218
tunnel?: string;
176219

177220
/**
178221
* Controls if potentially sensitive data should be sent to Sentry by default.
179222
* Note that this only applies to data that the SDK is sending by default
180223
* but not data that was explicitly set (e.g. by calling `Sentry.setUser()`).
224+
*
181225
* @default false
182226
*
183227
* NOTE: This option currently controls only a few data points in a selected
@@ -191,6 +235,8 @@ export interface ClientOptions<TO extends BaseTransportOptions = BaseTransportOp
191235
/**
192236
* Set of metadata about the SDK that can be internally used to enhance envelopes and events,
193237
* and provide additional data about every request.
238+
*
239+
* @internal This option is not part of the public API and is subject to change at any time.
194240
*/
195241
_metadata?: SdkMetadata;
196242

@@ -202,6 +248,7 @@ export interface ClientOptions<TO extends BaseTransportOptions = BaseTransportOp
202248
[key: string]: any;
203249
/**
204250
* If logs support should be enabled.
251+
*
205252
* @default false
206253
*/
207254
enableLogs?: boolean;
@@ -212,6 +259,8 @@ export interface ClientOptions<TO extends BaseTransportOptions = BaseTransportOp
212259
* Note that you must return a valid log from this callback. If you do not wish to modify the log, simply return
213260
* it at the end. Returning `null` will cause the log to be dropped.
214261
*
262+
* @default undefined
263+
*
215264
* @param log The log generated by the SDK.
216265
* @returns A new log that will be sent | null.
217266
*/
@@ -223,7 +272,9 @@ export interface ClientOptions<TO extends BaseTransportOptions = BaseTransportOp
223272
* This is the opposite of {@link Options.denyUrls}.
224273
* By default, all errors will be sent.
225274
*
226-
* Requires the use of the `InboundFilters` integration.
275+
* Behavior of the `allowUrls` option is controlled by the `Sentry.eventFiltersIntegration` integration.
276+
* If the event filters integration is not installed, the `allowUrls` option will not have any effect.
277+
*
227278
* @default []
228279
*/
229280
allowUrls?: Array<string | RegExp>;
@@ -233,7 +284,9 @@ export interface ClientOptions<TO extends BaseTransportOptions = BaseTransportOp
233284
* To allow certain errors instead, use {@link Options.allowUrls}.
234285
* By default, all errors will be sent.
235286
*
236-
* Requires the use of the `InboundFilters` integration.
287+
* Behavior of the `denyUrls` option is controlled by the `Sentry.eventFiltersIntegration` integration.
288+
* If the event filters integration is not installed, the `denyUrls` option will not have any effect.
289+
*
237290
* @default []
238291
*/
239292
denyUrls?: Array<string | RegExp>;
@@ -271,7 +324,7 @@ export interface ClientOptions<TO extends BaseTransportOptions = BaseTransportOp
271324
* Function to compute tracing sample rate dynamically and filter unwanted traces.
272325
*
273326
* Tracing is enabled if either this or `tracesSampleRate` is defined. If both are defined, `tracesSampleRate` is
274-
* ignored.
327+
* ignored. Set this and `tracesSampleRate` to `undefined` to disable tracing.
275328
*
276329
* Will automatically be passed a context object of default and optional custom data.
277330
*

0 commit comments

Comments
 (0)
Please sign in to comment.