File tree Expand file tree Collapse file tree 7 files changed +42
-15
lines changed Expand file tree Collapse file tree 7 files changed +42
-15
lines changed Original file line number Diff line number Diff line change @@ -149,6 +149,11 @@ export function init(browserOptions: BrowserOptions = {}): Client | undefined {
149
149
150
150
/**
151
151
* Initialize a browser client with the provided options and default integrations getter function.
152
+ * This is an internal method the SDK uses under the hood to set up things - you should not use this as a user!
153
+ * Instead, use `init()` to initialize the SDK.
154
+ *
155
+ * @hidden
156
+ * @internal
152
157
*/
153
158
export function initWithDefaultIntegrations (
154
159
browserOptions : BrowserOptions = { } ,
Original file line number Diff line number Diff line change @@ -32,12 +32,10 @@ export function getDefaultIntegrations(options: CloudflareOptions): Integration[
32
32
* Initializes the cloudflare SDK.
33
33
*/
34
34
export function init ( options : CloudflareOptions ) : CloudflareClient | undefined {
35
- const defaultIntegrations = getDefaultIntegrations ( options ) ;
36
-
37
35
const clientOptions : CloudflareClientOptions = {
38
36
...options ,
39
37
stackParser : stackParserFromStackParserOptions ( options . stackParser || defaultStackParser ) ,
40
- integrations : getIntegrationsToSetup ( options , defaultIntegrations ) ,
38
+ integrations : getIntegrationsToSetup ( options , getDefaultIntegrations ( options ) ) ,
41
39
transport : options . transport || makeCloudflareTransport ,
42
40
} ;
43
41
Original file line number Diff line number Diff line change @@ -46,15 +46,21 @@ export function getIntegrationsToSetup(
46
46
) : Integration [ ] {
47
47
const userIntegrations = options . integrations ;
48
48
49
- // If `defaultIntegrations: false` is defined, we disable all default integrations
49
+ // User- defined defaultIntegrations
50
50
// TODO(v10): If an array is passed, we use this - this is deprecated and will eventually be removed
51
+ const passedDefaultIntegrations = Array . isArray ( options . defaultIntegrations )
52
+ ? options . defaultIntegrations
53
+ : undefined ;
54
+
55
+ if ( DEBUG_BUILD && passedDefaultIntegrations ) {
56
+ logger . warn ( 'Sentry: The `defaultIntegrations` option is deprecated. Use the `integrations` option instead.' ) ;
57
+ }
58
+
59
+ // If `defaultIntegrations: false` is defined, we disable all default integrations
60
+
51
61
// Else, we use the default integrations that are directly passed to this function as second argument
52
62
const defaultIntegrationsToUse =
53
- options . defaultIntegrations === false
54
- ? [ ]
55
- : Array . isArray ( options . defaultIntegrations )
56
- ? options . defaultIntegrations
57
- : defaultIntegrations ;
63
+ options . defaultIntegrations === false ? [ ] : passedDefaultIntegrations || defaultIntegrations ;
58
64
59
65
// We flag default instances, so that later we can tell them apart from any user-created instances of the same class
60
66
defaultIntegrationsToUse . forEach ( ( integration : IntegrationWithDefaultInstance ) => {
Original file line number Diff line number Diff line change @@ -93,15 +93,18 @@ export function init(options: NodeOptions | undefined = {}): NodeClient | undefi
93
93
94
94
/**
95
95
* Initialize Sentry for Node, without any integrations added by default.
96
- *
97
- * @deprecated Use `initWithDefaultIntegrations` directly instead. This function will be removed in the next major version.
98
96
*/
99
97
export function initWithoutDefaultIntegrations ( options : NodeOptions | undefined = { } ) : NodeClient {
100
98
return initWithDefaultIntegrations ( options , ( ) => [ ] ) ;
101
99
}
102
100
103
101
/**
104
- * Initialize Sentry for Node, with the specified getter function for default integrations.
102
+ * Initialize a Node client with the provided options and default integrations getter function.
103
+ * This is an internal method the SDK uses under the hood to set up things - you should not use this as a user!
104
+ * Instead, use `init()` to initialize the SDK.
105
+ *
106
+ * @hidden
107
+ * @internal
105
108
*/
106
109
export function initWithDefaultIntegrations (
107
110
_options : NodeOptions | undefined = { } ,
Original file line number Diff line number Diff line change @@ -23,7 +23,12 @@ export function init(options: BrowserOptions): Client | undefined {
23
23
}
24
24
25
25
/**
26
- * Init the React SDK with the given default integrations getter function.
26
+ * Initialize a React client with the provided options and default integrations getter function.
27
+ * This is an internal method the SDK uses under the hood to set up things - you should not use this as a user!
28
+ * Instead, use `init()` to initialize the SDK.
29
+ *
30
+ * @hidden
31
+ * @internal
27
32
*/
28
33
export function initWithDefaultIntegrations (
29
34
options : BrowserOptions ,
Original file line number Diff line number Diff line change @@ -14,7 +14,12 @@ export function init(options: BrowserOptions): BrowserClient | undefined {
14
14
}
15
15
16
16
/**
17
- * Initializes the Solid SDK with the given
17
+ * Initialize a Solid client with the provided options and default integrations getter function.
18
+ * This is an internal method the SDK uses under the hood to set up things - you should not use this as a user!
19
+ * Instead, use `init()` to initialize the SDK.
20
+ *
21
+ * @hidden
22
+ * @internal
18
23
*/
19
24
export function initWithDefaultIntegrations (
20
25
options : BrowserOptions ,
Original file line number Diff line number Diff line change @@ -14,7 +14,12 @@ export function init(options: BrowserOptions): Client | undefined {
14
14
}
15
15
16
16
/**
17
- * Inits the Svelte SDK with the given default integrations getter function.
17
+ * Initialize a Svelte client with the provided options and default integrations getter function.
18
+ * This is an internal method the SDK uses under the hood to set up things - you should not use this as a user!
19
+ * Instead, use `init()` to initialize the SDK.
20
+ *
21
+ * @hidden
22
+ * @internal
18
23
*/
19
24
export function initWithDefaultIntegrations (
20
25
options : BrowserOptions ,
You can’t perform that action at this time.
0 commit comments