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
Wraps a SvelteKit [server route handler](https://kit.svelte.dev/docs/routing#server) registered in `+server.(js|js)` with Sentry error and performance monitoring. This is useful if you have custom server routes that you want to trace or if you want to capture `error()` calls within your server routes.
1142
+
Wraps a SvelteKit [server route handler](https://kit.svelte.dev/docs/routing#server) registered in `+server.(js|ts)` with Sentry error and performance monitoring. This is useful if you have custom server routes that you want to trace or if you want to capture `error()` calls within your server routes.
Copy file name to clipboardExpand all lines: docs/platforms/javascript/guides/sveltekit/configuration/build/index.mdx
+76-1Lines changed: 76 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,4 +18,79 @@ keywords:
18
18
19
19
The Sentry SvelteKit SDK supports automatic code instrumentation and source map upload during your app's build process using the `sentrySvelteKit` Vite plugins in your `vite.config.(js|ts)` file.
20
20
21
-
For more information on the available configuration options, see [Vite Setup](../../manual-setup/#vite-setup) and the sections on configuring source maps upload and auto instrumentation.
For details on this option, refer to the [Sentry Vite plugin documentation](https://www.npmjs.com/package/@sentry/vite-plugin#url).
48
+
49
+
</SdkOption>
50
+
51
+
<SdkOptionname="adapter"type="string">
52
+
53
+
By default, `sentrySvelteKit` will try to detect your SvelteKit adapter to configure the source maps upload correctly. If you're not using one of the [supported adapters](/platforms/javascript/guides/sveltekit/) or the wrong one is detected, you can override the adapter detection using the `adapter` option.
Disable automatic source maps upload by setting `autoUploadSourceMaps` to `false`.
60
+
61
+
</SdkOption>
62
+
63
+
## Auto-instrumentation Options
64
+
65
+
The SDK primarily uses [SvelteKit's hooks](https://kit.svelte.dev/docs/hooks) to collect error and performance data. However, SvelteKit doesn't yet offer a hook for universal or server-only `load` function calls. Therefore, the SDK uses a Vite plugin to auto-instrument `load` functions so that you don't have to manually add a Sentry wrapper to each function.
66
+
67
+
Auto-instrumentation is enabled by default when you add the `sentrySvelteKit()` function call to your `vite.config.(js|ts)`.
68
+
However, you can customize the behavior or disable it entirely.
69
+
70
+
<Alert>
71
+
The SDK will only auto-instrument `load` functions in `+page` or `+layout`
72
+
files that don't contain any Sentry-related code. If you have custom Sentry
73
+
code in these files, you'll have to [manually add the Sentry
74
+
wrapper](/platforms/javascript/guides/sveltekit/apis) to your `load`
Set `autoInstrument` to `false` to disable auto-instrumentation of any `load` functions. You can still [manually instrument](/platforms/javascript/guides/sveltekit/apis) specific `load` functions.
81
+
82
+
Alternatively, you can provide `autoInstrument` with an object to customize which `load` functions should be instrumented.
0 commit comments