You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/sveltekit/src/server/handle.ts
+15-5
Original file line number
Diff line number
Diff line change
@@ -40,16 +40,25 @@ export type SentryHandleOptions = {
40
40
* Controls if `sentryHandle` should inject a script tag into the page that enables instrumentation
41
41
* of `fetch` calls in `load` functions.
42
42
*
43
+
* You can safely set this to `false` if you're using `@sveltejs/kit` version 2.16.0 or newer. This
44
+
* is only needed for versions older than 2.16.0.
45
+
*
43
46
* @default true
44
47
*/
45
48
injectFetchProxyScript?: boolean;
46
49
47
50
/**
48
-
* If this option is set, the `sentryHandle` handler will add a nonce attribute to the script
49
-
* tag it injects into the page. This script is used to enable instrumentation of `fetch` calls
50
-
* in `load` functions.
51
+
* Warning: Setting this option is **strongly discouraged** and it will be removed in the next major version of the SDK.
52
+
*
53
+
* If you set this option, the passed nonce will be added to fetch proxy `<script>` tag that the Sentry SDK adds to your page.
54
+
* The nonce passed to this option will be reused across multiple requests, which is defeating the purpose of a nonce.
55
+
* See below for options what to do instead.
56
+
*
57
+
* @deprecated This option will be removed in the next major version of the SDK.
51
58
*
52
-
* Use this if your CSP policy blocks the fetch proxy script injected by `sentryHandle`.
59
+
* If you rely on this option, you have the following replacement options:
60
+
* - set a hash instead of the nonce in your CSP config [as documented here](https://docs.sentry.io/platforms/javascript/guides/sveltekit/manual-setup/#configure-csp-for-client-side-fetch-instrumentation)
61
+
* - update `@sveltejs/kit` to at least version 2.16.0 or newer and set `injectFetchProxyScript: false`
0 commit comments