Skip to content

docs(core): Improve documentation of Options and ClientOptions properties #5019

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 29, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions packages/types/src/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ export interface ClientOptions<TO extends BaseTransportOptions = BaseTransportOp
integrations: Integration[];

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

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

/** A global sample rate to apply to all events (0 - 1). */
/**
* A global sample rate to apply to all events.
*
* 0.0 = 0% chance of a given event being sent (send no events) 1.0 = 100% chance of a given event being sent (send
* all events)
*/
sampleRate?: number;

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

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

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

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

Expand Down