Official Sentry SDK for SvelteKit

Compatibility
The minimum supported version of SvelteKit is 2.0.0
. The SDK works best with Vite 4.2 and newer. Older Vite versions
might not generate source maps correctly.
Check our docs for SvelteKit adapter compatibility.
General
This package is a wrapper around @sentry/node
for the server and @sentry/svelte
for the client side, with added
functionality related to SvelteKit.
Installation
To get started installing the SDK, use the Sentry Next.js Wizard by running the following command in your terminal or
read the Getting Started Docs:
npx @sentry/wizard@latest -i sveltekit
The wizard will guide you throuhg logging in to Sentry and setting up the SDK. After the wizard setup is completed, the SDK will automatically capture
unhandled errors, and optionally, traces and replays.
Links
9.39.0
Important Changes
- feat(browser): Add
afterStartPageloadSpan
hook to improve spanId assignment on web vital spans (#16893)
This PR adds a new afterStartPageloadSpan lifecycle hook to more robustly assign the correct pageload span ID to web vital spans, replacing the previous unreliable "wait for a tick" approach with a direct callback that fires when the pageload span becomes available.
- feat(nextjs): Client-side parameterized routes (#16934)
This PR implements client-side parameterized routes for Next.js by leveraging an injected manifest within the existing app-router instrumentation to automatically parameterize all client-side transactions (e.g. users/123
and users/456
now become become users/:id
).
- feat(node): Drop 401-404 and 3xx status code spans by default (#16972)
This PR changes the default behavior in the Node SDK to drop HTTP spans with 401-404 and 3xx status codes by default to reduce noise in tracing data.
Other Changes
- feat(core): Prepend vercel ai attributes with
vercel.ai.X
(#16908)
- feat(nextjs): Add
disableSentryWebpackConfig
flag (#17013)
- feat(nextjs): Build app manifest (#16851)
- feat(nextjs): Inject manifest into client for turbopack builds (#16902)
- feat(nextjs): Inject manifest into client for webpack builds (#16857)
- feat(node-native): Add option to disable event loop blocked detection (#16919)
- feat(react-router): Ensure http.server route handling is consistent (#16986)
- fix(core): Avoid prolonging idle span when starting standalone span (#16928)
- fix(core): Remove side-effect from
tracing/errors.ts
(#16888)
- fix(core): Wrap
beforeSendLog
in consoleSandbox
(#16968)
- fix(node-core): Apply correct SDK metadata (#17014)
- fix(react-router): Ensure that all browser spans have
source=route
(#16984)
Work in this release was contributed by @janpapenbrock. Thank you for your contribution!