Skip to content

Commit 296515c

Browse files
committed
populate sveltekit build options page
1 parent d6b30b9 commit 296515c

File tree

2 files changed

+77
-2
lines changed

2 files changed

+77
-2
lines changed

docs/platforms/javascript/common/apis.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1139,7 +1139,7 @@ export const load = wrapServerLoadWithSentry(({ fetch }) => {
11391139
originalRouteHandler: (request: T) => Promise<Response>
11401140
): (requestEvent: T) => Promise<Response>`}
11411141
>
1142-
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.
11431143

11441144
<Expandable title="Examples">
11451145
```javascript

docs/platforms/javascript/guides/sveltekit/configuration/build/index.mdx

Lines changed: 76 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,79 @@ keywords:
1818

1919
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.
2020

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.
21+
## Available Options
22+
23+
<TableOfContents ignoreIds={["available-options"]} />
24+
25+
## Source Maps Options
26+
27+
<SdkOption name="sourceMapsUploadOptions.org" type="string" envVar="SENTRY_ORG">
28+
29+
For details on this option, refer to the [Sentry Vite plugin documentation](https://www.npmjs.com/package/@sentry/vite-plugin#org).
30+
31+
</SdkOption>
32+
33+
<SdkOption name="sourceMapsUploadOptions.project" type="string" envVar="SENTRY_PROJECT">
34+
35+
For details on this option, refer to the [Sentry Vite plugin documentation](https://www.npmjs.com/package/@sentry/vite-plugin#project).
36+
37+
</SdkOption>
38+
39+
<SdkOption name="sourceMapsUploadOptions.authToken" type="string" envVar="SENTRY_AUTH_TOKEN">
40+
41+
For details on this option, refer to the [Sentry Vite plugin documentation](https://www.npmjs.com/package/@sentry/vite-plugin#authtoken).
42+
43+
</SdkOption>
44+
45+
<SdkOption name="sourceMapsUploadOptions.url" type="string" envVar="SENTRY_URL" defaultValue="https://sentry.io/">
46+
47+
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+
<SdkOption name="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.
54+
55+
</SdkOption>
56+
57+
<SdkOption name="autoUploadSourceMaps" type="boolean">
58+
59+
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`
75+
functions.
76+
</Alert>
77+
78+
<SdkOption name="autoInstrument" type="boolean | object" defaultValue="true">
79+
80+
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.
83+
84+
</SdkOption>
85+
86+
<SdkOption name="autoInstrument.load" type="boolean" defaultValue="true">
87+
88+
Set to `false` to disable auto-instrumentation of `load` functions inside `+page.(js|ts)` or `+layout.(js|ts)`.
89+
90+
</SdkOption>
91+
92+
<SdkOption name="autoInstrument.serverLoad" type="boolean" defaultValue="true">
93+
94+
Set to `false` to disable auto-instrumentation of server-only `load` functions inside `+page.server.(js|ts)` or `+layout.server.(js|ts)`.
95+
96+
</SdkOption>

0 commit comments

Comments
 (0)