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
<!-- Use this checklist to make sure your PR is ready for merge. You may
delete any sections you don't need. -->
## DESCRIBE YOUR PR
Reworked the SvelteKit Getting Started guide into a Quick Start guide
(for wizard setup).
closes: #13398
## IS YOUR CHANGE URGENT?
Help us prioritize incoming PRs by letting us know when the change needs
to go live.
- [ ] Urgent deadline (GA date, etc.): <!-- ENTER DATE HERE -->
- [ ] Other deadline: <!-- ENTER DATE HERE -->
- [x] None: Not urgent, can wait up to 1 week+
## SLA
- Teamwork makes the dream work, so please add a reviewer to your PRs.
- Please give the docs team up to 1 week to review your PR unless you've
added an urgent due date to it.
Thanks in advance for your help!
## PRE-MERGE CHECKLIST
*Make sure you've checked the following before merging your changes:*
- [ ] Checked Vercel preview for correctness, including links
- [ ] PR was reviewed and approved by any necessary SMEs (subject matter
experts)
- [ ] PR was reviewed and approved by a member of the [Sentry docs
team](https://github.com/orgs/getsentry/teams/docs)
## LEGAL BOILERPLATE
<!-- Sentry employees and contractors can delete or ignore this section.
-->
Look, I get it. The entity doing business as "Sentry" was incorporated
in the State of Delaware in 2015 as Functional Software, Inc. and is
gonna need some rights from me in order to utilize my contributions in
this here PR. So here's the deal: I retain all rights, title and
interest in and to my contributions, and by keeping this boilerplate
intact I confirm that Sentry can use, modify, copy, and redistribute my
contributions, under Sentry's choice of terms.
## EXTRA RESOURCES
- [Sentry Docs contributor guide](https://docs.sentry.io/contributing/)
description: "Learn how to set up and configure Sentry in your SvelteKit application using the installation wizard, capture your first errors, and view them in Sentry."
3
4
sdk: sentry.javascript.sveltekit
4
5
categories:
5
6
- javascript
@@ -8,110 +9,71 @@ categories:
8
9
- server-node
9
10
---
10
11
11
-
Sentry's SvelteKit SDK enables automatic reporting of errors and performance data.
12
-
13
-
## Compatibility
14
-
15
-
The minimum supported SvelteKit version is `2.0.0`.
16
-
This SDK works best with **Vite 4.2** and newer. Older Vite versions might not generate source maps correctly.
17
-
18
-
<Alert>
19
-
20
-
The SvelteKit SDK is designed to work out of the box with the following SvelteKit adapters:
21
-
22
-
-[Adapter-auto](https://kit.svelte.dev/docs/adapter-auto) - for Vercel; other platforms might work but we don't guarantee compatibility at this time.
23
-
-[Adapter-vercel](https://kit.svelte.dev/docs/adapter-vercel) - only for Node (Lambda) runtimes, not yet Vercel's edge runtime.
24
-
-[Adapter-cloudflare](https://kit.svelte.dev/docs/adapter-cloudflare) - supported but requires [additional Setup](/platforms/javascript/guides/cloudflare/frameworks/sveltekit/).
Sentry captures data by using an SDK within your application’s runtime.
39
-
40
-
We recommend installing the SDK by running our installation wizard in the root directory of your project:
16
+
To install Sentry using the installation wizard, run the following command within your project:
41
17
42
18
```bash
43
19
npx @sentry/wizard@latest -i sveltekit
44
20
```
45
21
46
-
The wizard will prompt you to log in to Sentry. It will then automatically do the following steps for you:
47
-
48
-
- create or update SvelteKit files with the default Sentry configuration:
49
-
-`hooks.(client|server).js` to initialize the SDK and instrument [SvelteKit's hooks](https://kit.svelte.dev/docs/hooks)
50
-
-`vite.config.js` to add source maps upload and auto-instrumentation via Vite plugins.
51
-
- create a `.sentryclirc` file with an auth token to upload source maps (this file is automatically added to `.gitignore`)
52
-
- add an example page to your app to verify your Sentry setup
22
+
The wizard then guides you through the setup process, asking you to enable additional (optional) Sentry features for your application beyond error monitoring.
53
23
54
-
After the wizard setup is completed, the SDK will automatically capture unhandled errors, and monitor performance.
55
-
You can also <PlatformLinkto="/usage/">manually capture errors</PlatformLink>.
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.
58
27
59
-
If the setup through the wizard doesn't work for you, you can also <PlatformLinkto="/manual-setup/">set up the SDK manually</PlatformLink>.
28
+
<Expandabletitle="What does the installation wizard change inside your application?">
60
29
61
-
</Alert>
30
+
- Creates or updates `hooks.(client|server).js` to initialize the SDK and instrument [SvelteKit's hooks](https://kit.svelte.dev/docs/hooks)
31
+
- Creates or updates `vite.config.js` to add source maps upload and auto-instrumentation via Vite plugins
32
+
- Creates `.sentryclirc` with an auth token to upload source maps (this file is automatically added to `.gitignore`)
33
+
- Adds an example page to your application to help verify your Sentry setup
62
34
63
-
## Configure
35
+
</Expandable>
64
36
65
-
Configuration should happen as early as possible in your application's lifecycle.
37
+
## Step 2: Verify Your Setup
66
38
67
-
To complete your configuration, add <PlatformLinkto="/configuration/options/">options</PlatformLink> to your `Sentry.init()` calls.
68
-
Here you can also set context data - data about the <PlatformLinkto="/enriching-events/identify-user/">user</PlatformLink>, for example, or <PlatformLinkto="/enriching-events/tags/">tags</PlatformLink>, or even <PlatformLinkto="/enriching-events/context/">arbitrary data</PlatformLink> - which will be added to every event sent to Sentry.
39
+
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:
69
40
41
+
1. Open the example page `/sentry-example-page` in your browser
42
+
2. Click the "Throw Sample Error" button. This triggers two errors:
43
+
- a frontend error
44
+
- an error within the API route
70
45
71
-
## Verify
46
+
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.
72
47
73
-
This snippet includes an intentional error, so you can test that everything is working as soon as you set it up.
48
+
<Alertlevel="success"title="Tip">
74
49
75
-
Add a button to a frontend component that throws an error:
Errors triggered from within Browser DevTools are sandboxed and will not trigger error monitoring. Keep this in mind when verifying your Sentry SDK installation.
64
+
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.
108
65
109
-
</Alert>
66
+
Now's a good time to customize your setup and look into more advanced topics.
67
+
Our next recommended steps for you are:
110
68
111
-
<Alert>
69
+
- Learn how to [manually capture errors](/platforms/javascript/guides/sveltekit/usage/)
70
+
- Continue to [customize your configuration](/platforms/javascript/guides/sveltekit/configuration/)
71
+
- Get familiar with [Sentry's product features](/product) like tracing, insights, and alerts
112
72
113
-
Learn more about manually capturing an error or message in our <PlatformLinkto="/usage/">Usage documentation</PlatformLink>.
73
+
<Expandablepermalink={false}title="Are you having problems setting up the SDK?">
114
74
115
-
</Alert>
75
+
- If you encountered issues with our installation wizard, try [setting up Sentry manually](/platforms/javascript/guides/sveltekit/manual-setup/)
76
+
- Find various support topics in [troubleshooting](/platforms/javascript/guides/sveltekit/troubleshooting/)
To view and resolve the recorded error, log into [sentry.io](https://sentry.io) and select your project. Clicking on the error's title will open a page where you can see detailed information and mark it as resolved.
0 commit comments