From a5bf4f6f4f37c53509f78c22a4851bddd9aabbc0 Mon Sep 17 00:00:00 2001 From: Zachary Ebenfeld Date: Fri, 18 Apr 2025 18:30:16 -0400 Subject: [PATCH 1/2] added jsdoc defaults from https://docs.sentry.io/platforms/javascript/guides/react/configuration/options/ --- packages/core/src/types-hoist/options.ts | 38 +++++++++++++++++------- 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/packages/core/src/types-hoist/options.ts b/packages/core/src/types-hoist/options.ts index 51ccc7cdab79..0401cf0f11e4 100644 --- a/packages/core/src/types-hoist/options.ts +++ b/packages/core/src/types-hoist/options.ts @@ -13,20 +13,25 @@ import type { BaseTransportOptions, Transport } from './transport'; export interface ClientOptions { /** * Enable debug functionality in the SDK itself + * @default false */ debug?: boolean; /** * Specifies whether this SDK should send events to Sentry. - * Defaults to true. + * @default true */ enabled?: boolean; - /** Attaches stacktraces to pure capture message / log integrations */ + /** + * Attaches stacktraces to pure capture message / log integrations + * @default false + */ attachStacktrace?: boolean; /** * Send SDK Client Reports. When calling `Sentry.init()`, this option defaults to `true`. + * @default true */ sendClientReports?: boolean; @@ -43,7 +48,10 @@ export interface ClientOptions; /** * A pattern for transaction names which should not be sent to Sentry. * By default, all transactions will be sent. + * @default [] */ ignoreTransactions?: Array; @@ -162,8 +178,7 @@ export interface ClientOptions; @@ -217,6 +234,7 @@ export interface ClientOptions; From 55f574ac4182bb5712fceb27783dc5f4ff7367aa Mon Sep 17 00:00:00 2001 From: Abhijeet Prasad Date: Tue, 22 Apr 2025 10:07:11 -0400 Subject: [PATCH 2/2] update more docstrings and add spacing --- packages/core/src/types-hoist/options.ts | 89 +++++++++++++++++++----- 1 file changed, 71 insertions(+), 18 deletions(-) diff --git a/packages/core/src/types-hoist/options.ts b/packages/core/src/types-hoist/options.ts index 0401cf0f11e4..93f9be36ed25 100644 --- a/packages/core/src/types-hoist/options.ts +++ b/packages/core/src/types-hoist/options.ts @@ -12,53 +12,78 @@ import type { BaseTransportOptions, Transport } from './transport'; export interface ClientOptions { /** - * Enable debug functionality in the SDK itself + * Enable debug functionality in the SDK itself. If `debug` is set to `true` the SDK will attempt + * to print out useful debugging information about what the SDK is doing. + * * @default false */ debug?: boolean; /** - * Specifies whether this SDK should send events to Sentry. + * Specifies whether this SDK should send events to Sentry. Setting this to `enabled: false` + * doesn't prevent all overhead from Sentry instrumentation. To disable Sentry completely, + * depending on environment, call `Sentry.init conditionally. + * * @default true */ enabled?: boolean; /** - * Attaches stacktraces to pure capture message / log integrations + * When enabled, stack traces are automatically attached to all events captured with `Sentry.captureMessage`. + * + * Grouping in Sentry is different for events with stack traces and without. As a result, you will get + * new groups as you enable or disable this flag for certain events. + * * @default false */ attachStacktrace?: boolean; /** - * Send SDK Client Reports. When calling `Sentry.init()`, this option defaults to `true`. + * Send SDK Client Reports, which are used to emit outcomes about events that the SDK dropped + * or failed to capture. + * * @default true */ sendClientReports?: boolean; /** - * The Dsn used to connect to Sentry and identify the project. If omitted, the - * SDK will not send any data to Sentry. + * The DSN tells the SDK where to send the events. If this is not set, the SDK will not send any events to Sentry. + * + * @default undefined */ dsn?: string; /** - * The release identifier used when uploading respective source maps. Specify - * this value to allow Sentry to resolve the correct source maps when - * processing events. + * Sets the release. Release names are strings, but some formats are detected by Sentry and might be + * rendered differently. Learn more about how to send release data so Sentry can tell you about + * regressions between releases and identify the potential source in the + * [releases documentation](https://docs.sentry.io/product/releases/) + * + * @default undefined */ release?: string; /** * The current environment of your application (e.g. "production"). + * + * Environments are case-sensitive. The environment name can't contain newlines, spaces or forward slashes, + * can't be the string "None", or exceed 64 characters. You can't delete environments, but you can hide them. + * * @default "production" */ environment?: string; - /** Sets the distribution for all events */ + /** + * Sets the distribution of the application. Distributions are used to disambiguate build or + * deployment variants of the same release of an application. + * + * @default undefined + */ dist?: string; /** * List of integrations that should be installed after SDK was initialized. + * * @default [] */ integrations: Integration[]; @@ -70,8 +95,7 @@ export interface ClientOptions Transport; /** - * A stack parser implementation - * By default, a stack parser is supplied for all supported platforms + * A stack parser implementation. By default, a stack parser is supplied for all supported platforms. */ stackParser: StackParser; @@ -84,10 +108,12 @@ export interface ClientOptions; @@ -163,6 +200,10 @@ export interface ClientOptions; @@ -171,6 +212,8 @@ export interface ClientOptions; @@ -233,7 +284,9 @@ export interface ClientOptions; @@ -271,7 +324,7 @@ export interface ClientOptions