Skip to content

Commit 6831dbd

Browse files
Lms24AbhiPrasad
authored andcommitted
docs(core): Improve documentation of Options and ClientOptions properties (#5019)
slightly improve documentation of (mostly) user-facing Options / ClientOptions properties. Remove a TODO which we agreed we won't do for now.
1 parent a07db83 commit 6831dbd

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

packages/types/src/options.ts

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ export interface ClientOptions<TO extends BaseTransportOptions = BaseTransportOp
5959
integrations: Integration[];
6060

6161
/**
62-
* Transport object that should be used to send events to Sentry
62+
* A function that takes transport options and returns the Transport object which is used to send events to Sentry.
63+
* The function is invoked internally when the client is initialized.
6364
*/
6465
transport: (transportOptions: TO) => Transport;
6566

@@ -96,7 +97,12 @@ export interface ClientOptions<TO extends BaseTransportOptions = BaseTransportOp
9697
*/
9798
maxBreadcrumbs?: number;
9899

99-
/** A global sample rate to apply to all events (0 - 1). */
100+
/**
101+
* A global sample rate to apply to all events.
102+
*
103+
* 0.0 = 0% chance of a given event being sent (send no events) 1.0 = 100% chance of a given event being sent (send
104+
* all events)
105+
*/
100106
sampleRate?: number;
101107

102108
/** Maximum number of chars a single value can have before it will be truncated. */
@@ -149,7 +155,7 @@ export interface ClientOptions<TO extends BaseTransportOptions = BaseTransportOp
149155
/**
150156
* Set of metadata about the SDK that can be internally used to enhance envelopes and events,
151157
* and provide additional data about every request.
152-
* */
158+
*/
153159
_metadata?: SdkMetadata;
154160

155161
/**
@@ -207,7 +213,6 @@ export interface Options<TO extends BaseTransportOptions = BaseTransportOptions>
207213
/**
208214
* If this is set to false, default integrations will not be added, otherwise this will internally be set to the
209215
* recommended default integrations.
210-
* TODO: We should consider changing this to `boolean | Integration[]`
211216
*/
212217
defaultIntegrations?: false | Integration[];
213218

@@ -219,7 +224,9 @@ export interface Options<TO extends BaseTransportOptions = BaseTransportOptions>
219224
integrations?: Integration[] | ((integrations: Integration[]) => Integration[]);
220225

221226
/**
222-
* Transport object that should be used to send events to Sentry
227+
* A function that takes transport options and returns the Transport object which is used to send events to Sentry.
228+
* The function is invoked internally during SDK initialization.
229+
* By default, the SDK initializes its default transports.
223230
*/
224231
transport?: (transportOptions: TO) => Transport;
225232

0 commit comments

Comments
 (0)