From f1d553e1e340f9d31dc341c43f9bb3f99ae2b5be Mon Sep 17 00:00:00 2001 From: betegon Date: Thu, 11 Jun 2026 10:25:30 +0200 Subject: [PATCH 1/9] docs(sveltekit): add sentry init setup --- .../javascript/guides/sveltekit/index.mdx | 99 ++++++++++++++----- .../guides/sveltekit/manual-setup.mdx | 3 +- 2 files changed, 75 insertions(+), 27 deletions(-) diff --git a/docs/platforms/javascript/guides/sveltekit/index.mdx b/docs/platforms/javascript/guides/sveltekit/index.mdx index 2dcca89ce5ac7..05ad336d11548 100644 --- a/docs/platforms/javascript/guides/sveltekit/index.mdx +++ b/docs/platforms/javascript/guides/sveltekit/index.mdx @@ -16,37 +16,44 @@ categories: ## Install + + +The wizard is currently experimental. If you run into any issues, check out the [Manual Setup](/platforms/javascript/guides/sveltekit/manual-setup/) guide. + + + -Run the Sentry wizard to automatically configure Sentry in your SvelteKit application. It will then guide you through the setup process, asking you to enable additional (optional) Sentry features for your application beyond error monitoring. +Run the Sentry init command in your project directory to automatically configure Sentry in your SvelteKit application. + +The wizard guides you through setup and asks which optional Sentry features you want to enable beyond error monitoring. ```bash -npx @sentry/wizard@latest -i sveltekit +npx sentry@latest init ``` - + -This guide assumes that you enable all features and allow the wizard to create an example page. You can add or remove features at any time, but setting them up now will save you the effort of configuring them manually later. +The Sentry init wizard is AI-powered. It analyzes your project and generates a tailored integration, rather than applying a fixed template. Here's what it does: - +- **Analyzes your project** — reads project files and manifests to understand your SvelteKit app structure, including monorepos. It also respects AI instruction files such as `CLAUDE.md`, `AGENTS.md`, and `.cursorrules`. +- **Detects your framework** — identifies SvelteKit and selects the `@sentry/sveltekit` SDK. +- **Fetches official Sentry docs** — uses the current Sentry documentation as the source of truth when generating integration code. +- **Installs dependencies** — adds `@sentry/sveltekit` using your project's package manager. +- **Creates and modifies files** — sets up client-side and server-side initialization, SvelteKit hooks or instrumentation, and other selected features based on your SvelteKit version and project structure. +- **Verifies the integration** — re-reads modified files after writing to confirm Sentry was integrated. -- Creates or updates `hooks.(client|server).js` to initialize the SDK and instrument [SvelteKit's hooks](https://kit.svelte.dev/docs/hooks) -- Creates or updates `vite.config.js` to add source maps upload and auto-instrumentation via Vite plugins -- If you're on SvelteKit `2.31.0` or higher: - - Creates `instrumentation.server.js` to initialize the server-side SDK - - Enables server-side instrumentation and tracing in `svelte.config.js` -- Creates `.env.sentry-build-plugin` with an auth token to upload source maps (this file is automatically added to `.gitignore`) -- Adds an example page to your application to help verify your Sentry setup +For full details on what each file does, see the [Manual Setup](/platforms/javascript/guides/sveltekit/manual-setup/) guide. @@ -56,32 +63,74 @@ This guide assumes that you enable all features and allow the wizard to create a ## Verify Your Setup -If you haven't tested your Sentry configuration yet, let's do it now. You can confirm that Sentry is working properly and sending data to your Sentry project by using the example page and route created by the installation wizard: +The wizard will have prompted you to select which features to enable. Select the same options here to see the relevant verification steps: -1. Open the example page `/sentry-example-page` in your browser -2. Click the "Throw Sample Error" button. This triggers two errors: - - a frontend error - - an error within the API route + -Sentry captures both of these errors for you. Additionally, the button click starts a trace to measure the time it takes for the API request to complete. + + +Add a test button to one of your pages to trigger an error: + +```svelte + +``` + +Start your dev server and click the button. -Don't forget to explore the example files' code in your project to understand what's happening after your button click. +If the wizard added verification files to your project, you can use those instead of adding a temporary test button. -### View Captured Data in Sentry +### Check Your Data in Sentry -Now, head over to your project on [Sentry.io](https://sentry.io) to view the collected data (it takes a couple of moments for the data to appear). +**Errors** — [Open Issues](https://sentry.io/orgredirect/organizations/:orgslug/issues/) - +You should see "Sentry Test Error" with a full stack trace pointing to your source code. + + + +**Tracing** — [Open Traces](https://sentry.io/orgredirect/organizations/:orgslug/explore/traces/) + +You should see request and route traces. Learn more about [SvelteKit tracing](/platforms/javascript/guides/sveltekit/tracing/). + + + + + +**Session Replay** — [Open Replays](https://sentry.io/orgredirect/organizations/:orgslug/replays/) + +Watch a video-like recording of your session, including the moment the error occurred. Learn more about [Session Replay configuration](/platforms/javascript/guides/sveltekit/session-replay/). + + + + + +**Logs** — [Open Logs](https://sentry.io/orgredirect/organizations/:orgslug/explore/logs/) + +See structured log entries from your application. Learn more about [Logs configuration](/platforms/javascript/guides/sveltekit/logs/). - + ## Next Steps -At this point, you should have integrated Sentry into your SvelteKit application and should already be sending error and performance data to your Sentry project. +At this point, you should have integrated Sentry into your SvelteKit application and should already be sending data to your Sentry project. Now's a good time to customize your setup and look into more advanced topics. Our next recommended steps for you are: @@ -89,7 +138,7 @@ Our next recommended steps for you are: - Explore [practical guides](/guides/) on what to monitor, log, track, and investigate after setup - Learn how to [manually capture errors](/platforms/javascript/guides/sveltekit/usage/) - Continue to [customize your configuration](/platforms/javascript/guides/sveltekit/configuration/) -- Learn how to [manually instrument](/platforms/javascript/guides/sveltekit/apis#load-function-instrumentation) SvelteKit-specific features +- Learn how to [manually instrument](/platforms/javascript/guides/sveltekit/configuration/build/#load-function-instrumentation) SvelteKit-specific features - Learn more about [deploying SvelteKit apps to Cloudflare Pages](/platforms/javascript/guides/cloudflare/frameworks/sveltekit/) - Get familiar with [Sentry's product features](/product) like tracing, insights, and alerts diff --git a/docs/platforms/javascript/guides/sveltekit/manual-setup.mdx b/docs/platforms/javascript/guides/sveltekit/manual-setup.mdx index 3a9a6566c1bc9..5fcf2f77c1b06 100644 --- a/docs/platforms/javascript/guides/sveltekit/manual-setup.mdx +++ b/docs/platforms/javascript/guides/sveltekit/manual-setup.mdx @@ -5,8 +5,7 @@ description: "Learn how to manually set up Sentry in your SvelteKit app and capt --- - For the fastest setup, we recommend using the [wizard - installer](/platforms/javascript/guides/sveltekit). + For the fastest setup, we recommend using [`sentry init`](/platforms/javascript/guides/sveltekit). From e3432fdb4c732835a613f384c81e51161006945e Mon Sep 17 00:00:00 2001 From: betegon Date: Thu, 11 Jun 2026 10:44:27 +0200 Subject: [PATCH 2/9] docs(sveltekit): mention classic wizard alternative --- .../javascript/guides/sveltekit/index.mdx | 14 +++++++++++++- .../javascript/guides/sveltekit/manual-setup.mdx | 9 ++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/docs/platforms/javascript/guides/sveltekit/index.mdx b/docs/platforms/javascript/guides/sveltekit/index.mdx index 05ad336d11548..af3a028d852f3 100644 --- a/docs/platforms/javascript/guides/sveltekit/index.mdx +++ b/docs/platforms/javascript/guides/sveltekit/index.mdx @@ -18,7 +18,7 @@ categories: -The wizard is currently experimental. If you run into any issues, check out the [Manual Setup](/platforms/javascript/guides/sveltekit/manual-setup/) guide. +The AI-powered `sentry init` flow is currently experimental. If you don't want to use it, use the existing framework-specific wizard below or check out the [Manual Setup](/platforms/javascript/guides/sveltekit/manual-setup/) guide. @@ -42,6 +42,18 @@ npx sentry@latest init + + +If you don't want to use the experimental AI-powered flow, run the framework-specific installation wizard instead: + +```bash +npx @sentry/wizard@latest -i sveltekit +``` + +To configure Sentry without a wizard, follow the [Manual Setup](/platforms/javascript/guides/sveltekit/manual-setup/) guide. + + + The Sentry init wizard is AI-powered. It analyzes your project and generates a tailored integration, rather than applying a fixed template. Here's what it does: diff --git a/docs/platforms/javascript/guides/sveltekit/manual-setup.mdx b/docs/platforms/javascript/guides/sveltekit/manual-setup.mdx index 5fcf2f77c1b06..a0f5d63d8c04b 100644 --- a/docs/platforms/javascript/guides/sveltekit/manual-setup.mdx +++ b/docs/platforms/javascript/guides/sveltekit/manual-setup.mdx @@ -5,7 +5,14 @@ description: "Learn how to manually set up Sentry in your SvelteKit app and capt --- - For the fastest setup, we recommend using [`sentry init`](/platforms/javascript/guides/sveltekit). + For automated setup, start with the experimental AI-powered [`sentry init`](/platforms/javascript/guides/sveltekit) flow. + If you'd rather use the existing SvelteKit installation wizard, run: + + ```bash + npx @sentry/wizard@latest -i sveltekit + ``` + + Continue with this guide to set up Sentry manually. From aebbbac1177d26fdbcd4d0c034da019e6cc41c47 Mon Sep 17 00:00:00 2001 From: betegon Date: Thu, 11 Jun 2026 10:48:18 +0200 Subject: [PATCH 3/9] docs(sveltekit): inline classic wizard command --- docs/platforms/javascript/guides/sveltekit/index.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/platforms/javascript/guides/sveltekit/index.mdx b/docs/platforms/javascript/guides/sveltekit/index.mdx index af3a028d852f3..164135b92c644 100644 --- a/docs/platforms/javascript/guides/sveltekit/index.mdx +++ b/docs/platforms/javascript/guides/sveltekit/index.mdx @@ -18,7 +18,7 @@ categories: -The AI-powered `sentry init` flow is currently experimental. If you don't want to use it, use the existing framework-specific wizard below or check out the [Manual Setup](/platforms/javascript/guides/sveltekit/manual-setup/) guide. +The AI-powered `sentry init` flow is currently experimental. If you don't want to use it, run the existing framework-specific wizard with `npx @sentry/wizard@latest -i sveltekit`, or check out the [Manual Setup](/platforms/javascript/guides/sveltekit/manual-setup/) guide. From 0f4219c29756e4d59b5d571a407756bd098ddf45 Mon Sep 17 00:00:00 2001 From: betegon Date: Thu, 11 Jun 2026 11:04:49 +0200 Subject: [PATCH 4/9] docs(sveltekit): avoid duplicating wizard command --- docs/platforms/javascript/guides/sveltekit/index.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/platforms/javascript/guides/sveltekit/index.mdx b/docs/platforms/javascript/guides/sveltekit/index.mdx index 164135b92c644..755dff12cf71f 100644 --- a/docs/platforms/javascript/guides/sveltekit/index.mdx +++ b/docs/platforms/javascript/guides/sveltekit/index.mdx @@ -18,7 +18,7 @@ categories: -The AI-powered `sentry init` flow is currently experimental. If you don't want to use it, run the existing framework-specific wizard with `npx @sentry/wizard@latest -i sveltekit`, or check out the [Manual Setup](/platforms/javascript/guides/sveltekit/manual-setup/) guide. +The AI-powered `sentry init` flow is currently experimental. If you don't want to use it, use the existing framework-specific wizard option below, or check out the [Manual Setup](/platforms/javascript/guides/sveltekit/manual-setup/) guide. From 26359d0632eb2e0b7521f9924e239572d12a8b7d Mon Sep 17 00:00:00 2001 From: betegon Date: Thu, 11 Jun 2026 19:15:49 +0200 Subject: [PATCH 5/9] docs(sveltekit): call sentry init a command --- docs/platforms/javascript/guides/sveltekit/index.mdx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/platforms/javascript/guides/sveltekit/index.mdx b/docs/platforms/javascript/guides/sveltekit/index.mdx index 755dff12cf71f..64a83000a220e 100644 --- a/docs/platforms/javascript/guides/sveltekit/index.mdx +++ b/docs/platforms/javascript/guides/sveltekit/index.mdx @@ -18,7 +18,7 @@ categories: -The AI-powered `sentry init` flow is currently experimental. If you don't want to use it, use the existing framework-specific wizard option below, or check out the [Manual Setup](/platforms/javascript/guides/sveltekit/manual-setup/) guide. +The AI-powered `sentry init` flow is currently experimental. To use the existing framework-specific setup instead, see the option below, or check out the [Manual Setup](/platforms/javascript/guides/sveltekit/manual-setup/) guide. @@ -28,7 +28,7 @@ The AI-powered `sentry init` flow is currently experimental. If you don't want t Run the Sentry init command in your project directory to automatically configure Sentry in your SvelteKit application. -The wizard guides you through setup and asks which optional Sentry features you want to enable beyond error monitoring. +The command guides you through setup and asks which optional Sentry features you want to enable beyond error monitoring. @@ -54,9 +54,9 @@ To configure Sentry without a wizard, follow the [Manual Setup](/platforms/javas - + -The Sentry init wizard is AI-powered. It analyzes your project and generates a tailored integration, rather than applying a fixed template. Here's what it does: +The `sentry init` command is AI-powered. It analyzes your project and generates a tailored integration, rather than applying a fixed template. Here's what it does: - **Analyzes your project** — reads project files and manifests to understand your SvelteKit app structure, including monorepos. It also respects AI instruction files such as `CLAUDE.md`, `AGENTS.md`, and `.cursorrules`. - **Detects your framework** — identifies SvelteKit and selects the `@sentry/sveltekit` SDK. @@ -75,7 +75,7 @@ For full details on what each file does, see the [Manual Setup](/platforms/javas ## Verify Your Setup -The wizard will have prompted you to select which features to enable. Select the same options here to see the relevant verification steps: +The command will have prompted you to select which features to enable. Select the same options here to see the relevant verification steps: -If the wizard added verification files to your project, you can use those instead of adding a temporary test button. +If the command you ran added verification files to your project, you can use those instead of adding a temporary test button. From 4f7b47d4fb12456bef5cb25a9d04e986d8ce2d25 Mon Sep 17 00:00:00 2001 From: betegon Date: Thu, 11 Jun 2026 19:41:56 +0200 Subject: [PATCH 6/9] docs(sveltekit): restore verification content --- .../javascript/guides/sveltekit/index.mdx | 68 ++++--------------- 1 file changed, 13 insertions(+), 55 deletions(-) diff --git a/docs/platforms/javascript/guides/sveltekit/index.mdx b/docs/platforms/javascript/guides/sveltekit/index.mdx index 64a83000a220e..53501e69e7635 100644 --- a/docs/platforms/javascript/guides/sveltekit/index.mdx +++ b/docs/platforms/javascript/guides/sveltekit/index.mdx @@ -75,74 +75,32 @@ For full details on what each file does, see the [Manual Setup](/platforms/javas ## Verify Your Setup -The command will have prompted you to select which features to enable. Select the same options here to see the relevant verification steps: - - +If you haven't tested your Sentry configuration yet, let's do it now. You can confirm that Sentry is working properly and sending data to your Sentry project by using the example page and route created by the installation wizard: - - -Add a test button to one of your pages to trigger an error: - -```svelte - -``` +1. Open the example page `/sentry-example-page` in your browser +2. Click the "Throw Sample Error" button. This triggers two errors: + - a frontend error + - an error within the API route -Start your dev server and click the button. +Sentry captures both of these errors for you. Additionally, the button click starts a trace to measure the time it takes for the API request to complete. -If the command you ran added verification files to your project, you can use those instead of adding a temporary test button. +Don't forget to explore the example files' code in your project to understand what's happening after your button click. -### Check Your Data in Sentry - -**Errors** — [Open Issues](https://sentry.io/orgredirect/organizations/:orgslug/issues/) - -You should see "Sentry Test Error" with a full stack trace pointing to your source code. - - - -**Tracing** — [Open Traces](https://sentry.io/orgredirect/organizations/:orgslug/explore/traces/) - -You should see request and route traces. Learn more about [SvelteKit tracing](/platforms/javascript/guides/sveltekit/tracing/). +### View Captured Data in Sentry - +Now, head over to your project on [Sentry.io](https://sentry.io) to view the collected data (it takes a couple of moments for the data to appear). - - -**Session Replay** — [Open Replays](https://sentry.io/orgredirect/organizations/:orgslug/replays/) - -Watch a video-like recording of your session, including the moment the error occurred. Learn more about [Session Replay configuration](/platforms/javascript/guides/sveltekit/session-replay/). - - - - - -**Logs** — [Open Logs](https://sentry.io/orgredirect/organizations/:orgslug/explore/logs/) - -See structured log entries from your application. Learn more about [Logs configuration](/platforms/javascript/guides/sveltekit/logs/). + - + ## Next Steps -At this point, you should have integrated Sentry into your SvelteKit application and should already be sending data to your Sentry project. +At this point, you should have integrated Sentry into your SvelteKit application and should already be sending error and performance data to your Sentry project. Now's a good time to customize your setup and look into more advanced topics. Our next recommended steps for you are: @@ -150,7 +108,7 @@ Our next recommended steps for you are: - Explore [practical guides](/guides/) on what to monitor, log, track, and investigate after setup - Learn how to [manually capture errors](/platforms/javascript/guides/sveltekit/usage/) - Continue to [customize your configuration](/platforms/javascript/guides/sveltekit/configuration/) -- Learn how to [manually instrument](/platforms/javascript/guides/sveltekit/configuration/build/#load-function-instrumentation) SvelteKit-specific features +- Learn how to [manually instrument](/platforms/javascript/guides/sveltekit/apis#load-function-instrumentation) SvelteKit-specific features - Learn more about [deploying SvelteKit apps to Cloudflare Pages](/platforms/javascript/guides/cloudflare/frameworks/sveltekit/) - Get familiar with [Sentry's product features](/product) like tracing, insights, and alerts From 85632443147710534293154bad3a9badf6b0dd08 Mon Sep 17 00:00:00 2001 From: betegon Date: Thu, 11 Jun 2026 19:45:14 +0200 Subject: [PATCH 7/9] docs(sveltekit): inline init command in manual setup --- .../platforms/javascript/guides/sveltekit/manual-setup.mdx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/platforms/javascript/guides/sveltekit/manual-setup.mdx b/docs/platforms/javascript/guides/sveltekit/manual-setup.mdx index a0f5d63d8c04b..2ba5c51cd7718 100644 --- a/docs/platforms/javascript/guides/sveltekit/manual-setup.mdx +++ b/docs/platforms/javascript/guides/sveltekit/manual-setup.mdx @@ -5,7 +5,12 @@ description: "Learn how to manually set up Sentry in your SvelteKit app and capt --- - For automated setup, start with the experimental AI-powered [`sentry init`](/platforms/javascript/guides/sveltekit) flow. + For automated setup, run the experimental AI-powered `sentry init` command: + + ```bash + npx sentry@latest init + ``` + If you'd rather use the existing SvelteKit installation wizard, run: ```bash From 99ea5379515e39f6b967ef359019ad1fd1175f00 Mon Sep 17 00:00:00 2001 From: betegon Date: Fri, 12 Jun 2026 12:32:13 +0200 Subject: [PATCH 8/9] docs(sveltekit): address init review feedback --- .../javascript/guides/sveltekit/index.mdx | 24 +++++++++---------- .../guides/sveltekit/manual-setup.mdx | 14 ++--------- 2 files changed, 14 insertions(+), 24 deletions(-) diff --git a/docs/platforms/javascript/guides/sveltekit/index.mdx b/docs/platforms/javascript/guides/sveltekit/index.mdx index 53501e69e7635..24403fb8ba881 100644 --- a/docs/platforms/javascript/guides/sveltekit/index.mdx +++ b/docs/platforms/javascript/guides/sveltekit/index.mdx @@ -42,18 +42,6 @@ npx sentry@latest init - - -If you don't want to use the experimental AI-powered flow, run the framework-specific installation wizard instead: - -```bash -npx @sentry/wizard@latest -i sveltekit -``` - -To configure Sentry without a wizard, follow the [Manual Setup](/platforms/javascript/guides/sveltekit/manual-setup/) guide. - - - The `sentry init` command is AI-powered. It analyzes your project and generates a tailored integration, rather than applying a fixed template. Here's what it does: @@ -69,6 +57,18 @@ For full details on what each file does, see the [Manual Setup](/platforms/javas + + +If you don't want to use the experimental AI-powered flow, run the framework-specific installation wizard instead: + +```bash +npx @sentry/wizard@latest -i sveltekit +``` + +To configure Sentry manually, follow the [Manual Setup](/platforms/javascript/guides/sveltekit/manual-setup/) guide. + + + ## Avoid Ad Blockers With Tunneling (Optional) diff --git a/docs/platforms/javascript/guides/sveltekit/manual-setup.mdx b/docs/platforms/javascript/guides/sveltekit/manual-setup.mdx index 2ba5c51cd7718..1982a7a65a9f6 100644 --- a/docs/platforms/javascript/guides/sveltekit/manual-setup.mdx +++ b/docs/platforms/javascript/guides/sveltekit/manual-setup.mdx @@ -5,18 +5,8 @@ description: "Learn how to manually set up Sentry in your SvelteKit app and capt --- - For automated setup, run the experimental AI-powered `sentry init` command: - - ```bash - npx sentry@latest init - ``` - - If you'd rather use the existing SvelteKit installation wizard, run: - - ```bash - npx @sentry/wizard@latest -i sveltekit - ``` - + Looking for automatic setup with `sentry init` or the SvelteKit wizard? Follow + the [SvelteKit quickstart](/platforms/javascript/guides/sveltekit/) instead. Continue with this guide to set up Sentry manually. From a2bfd8d3ade23e59d863a1e867c96c75fba8c003 Mon Sep 17 00:00:00 2001 From: betegon Date: Fri, 12 Jun 2026 13:27:44 +0200 Subject: [PATCH 9/9] docs(sveltekit): clarify init verification path --- docs/platforms/javascript/guides/sveltekit/index.mdx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/platforms/javascript/guides/sveltekit/index.mdx b/docs/platforms/javascript/guides/sveltekit/index.mdx index 24403fb8ba881..c221b1a701160 100644 --- a/docs/platforms/javascript/guides/sveltekit/index.mdx +++ b/docs/platforms/javascript/guides/sveltekit/index.mdx @@ -75,7 +75,9 @@ To configure Sentry manually, follow the [Manual Setup](/platforms/javascript/gu ## Verify Your Setup -If you haven't tested your Sentry configuration yet, let's do it now. You can confirm that Sentry is working properly and sending data to your Sentry project by using the example page and route created by the installation wizard: +The `sentry init` command checks the integration files it creates or modifies before it finishes. To confirm runtime events are reaching Sentry, start your SvelteKit app, exercise the parts of your app that should send events, and then check your Sentry project. + +If you used the SvelteKit installation wizard instead, you can also verify your setup with the example page and route it creates: 1. Open the example page `/sentry-example-page` in your browser 2. Click the "Throw Sample Error" button. This triggers two errors: @@ -86,7 +88,7 @@ Sentry captures both of these errors for you. Additionally, the button click sta -Don't forget to explore the example files' code in your project to understand what's happening after your button click. +If you used the SvelteKit installation wizard, explore the example files' code in your project to understand what's happening after your button click.