---
title: "Build Options"
description: "Learn about the build-time configuration options available for the SvelteKit SDK."
url: https://docs.sentry.io/platforms/javascript/guides/sveltekit/configuration/build/
---

# Build Options | Sentry for SvelteKit

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.

## [Available Options](https://docs.sentry.io/platforms/javascript/guides/sveltekit/configuration/build.md#available-options)



## [General Options](https://docs.sentry.io/platforms/javascript/guides/sveltekit/configuration/build.md#general-options)

These options can be set on the root level of the `sentrySvelteKit` configuration object. Most of them are relevant for the source map upload process.

### [org](https://docs.sentry.io/platforms/javascript/guides/sveltekit/configuration/build.md#org)

| Type | `string` |
| ---- | -------- |

The slug of the Sentry organization associated with the app.

### [project](https://docs.sentry.io/platforms/javascript/guides/sveltekit/configuration/build.md#project)

| Type | `string` |
| ---- | -------- |

The slug of the Sentry project associated with the app.

### [authToken](https://docs.sentry.io/platforms/javascript/guides/sveltekit/configuration/build.md#authToken)

| Type | `string` |
| ---- | -------- |

The authentication token to use for all communication with Sentry. Can be obtained from <https://sentry.io/orgredirect/organizations/:orgslug/settings/auth-tokens/>.

### [sentryUrl](https://docs.sentry.io/platforms/javascript/guides/sveltekit/configuration/build.md#sentryUrl)

| Type    | `string`             |
| ------- | -------------------- |
| Default | `https://sentry.io/` |

The base URL of your Sentry instance. Only relevant if you're using a self-hosted or Sentry instance other than sentry.io.

### [adapter](https://docs.sentry.io/platforms/javascript/guides/sveltekit/configuration/build.md#adapter)

| Type | `string` |
| ---- | -------- |

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](https://docs.sentry.io/platforms/javascript/guides/sveltekit.md) or the wrong one is detected, you can override the adapter detection using the `adapter` option.

## [Source Maps Options](https://docs.sentry.io/platforms/javascript/guides/sveltekit/configuration/build.md#source-maps-options)

### [autoUploadSourceMaps](https://docs.sentry.io/platforms/javascript/guides/sveltekit/configuration/build.md#autoUploadSourceMaps)

| Type | `boolean` |
| ---- | --------- |

Disable automatic source maps upload by setting `autoUploadSourceMaps` to `false`.

## [Auto-Instrumentation Options](https://docs.sentry.io/platforms/javascript/guides/sveltekit/configuration/build.md#auto-instrumentation-options)

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.

Auto-instrumentation is enabled by default when you add the `sentrySvelteKit()` function call to your `vite.config.(js|ts)`. However, you can customize the behavior or disable it entirely.

The SDK will only auto-instrument `load` functions in `+page` or `+layout` files that don't contain any Sentry-related code. If you have custom Sentry code in these files, you'll have to [manually add a Sentry wrapper](https://docs.sentry.io/platforms/javascript/guides/sveltekit/apis.md#load-function-instrumentation) to your `load` functions.

### [autoInstrument](https://docs.sentry.io/platforms/javascript/guides/sveltekit/configuration/build.md#autoInstrument)

| Type    | `boolean \| object` |
| ------- | ------------------- |
| Default | `true`              |

Set `autoInstrument` to `false` to disable auto-instrumentation of any `load` functions. You can still [manually instrument](https://docs.sentry.io/platforms/javascript/guides/sveltekit/apis.md#load-function-instrumentation) specific `load` functions.

`vite.config.(js|ts)`

```javascript
import { sveltekit } from '@sveltejs/kit/vite';
import { sentrySvelteKit } from '@sentry/sveltekit';

export default {
  plugins: [
    sentrySvelteKit({

      autoInstrument: false;

    }),
    sveltekit(),
  ],
  // ... rest of your Vite config
};
```

Alternatively, you can provide `autoInstrument` with an object to customize which `load` functions should be instrumented.

### [autoInstrument.load](https://docs.sentry.io/platforms/javascript/guides/sveltekit/configuration/build.md#autoInstrument.load)

| Type    | `boolean` |
| ------- | --------- |
| Default | `true`    |

Set to `false` to disable auto-instrumentation of `load` functions inside `+page.(js|ts)` or `+layout.(js|ts)`.

`vite.config.(js|ts)`

```javascript
import { sveltekit } from "@sveltejs/kit/vite";
import { sentrySvelteKit } from "@sentry/sveltekit";

export default {
  plugins: [
    sentrySvelteKit({

      autoInstrument: {
        load: false,
      },
    }),

    sveltekit(),
  ],
  // ... rest of your Vite config
};
```

### [autoInstrument.serverLoad](https://docs.sentry.io/platforms/javascript/guides/sveltekit/configuration/build.md#autoInstrument.serverLoad)

| Type    | `boolean` |
| ------- | --------- |
| Default | `true`    |

Set to `false` to disable auto-instrumentation of server-only `load` functions inside `+page.server.(js|ts)` or `+layout.server.(js|ts)`.

`vite.config.(js|ts)`

```javascript
import { sveltekit } from "@sveltejs/kit/vite";
import { sentrySvelteKit } from "@sentry/sveltekit";

export default {
  plugins: [
    sentrySvelteKit({

      autoInstrument: {
        serverLoad: false,
      },
    }),

    sveltekit(),
  ],
  // ... rest of your Vite config
};
```
