Installation
Basic Setup
Initialize Sentry in your entry point (main.js or main.ts) before bootstrapping your Svelte app:
Error Tracking
Automatic Error Capture
Uncaught errors are automatically captured:Manual Error Capture
Performance Monitoring
Browser Tracing
Track page load and navigation performance:Custom Performance Spans
Context & Breadcrumbs
User Context
Custom Context & Tags
Breadcrumbs
Session Replay
Capture session replays to understand user behavior:Svelte Stores Integration
Track store updates:Advanced Features
- User Feedback
- HTTP Monitoring
- Browser Profiling
Collect feedback from users:Or manually trigger feedback:
Component-Level Error Handling
Source Maps
Generate and upload source maps for better stack traces:- Vite
- Rollup
Configure Vite to generate source maps:
sentry-cli:
Configuration Options
Common Configuration
Common Configuration
Best Practices
Initialize Early
Call
Sentry.init() before creating your Svelte app.Source Maps
Always generate and upload source maps for production builds.
Store Tracking
Add breadcrumbs for store updates to understand state changes.
Context
Set user context and tags to make debugging easier.
Migration to SvelteKit
If you’re using SvelteKit, switch to the dedicated SDK:Next Steps
SvelteKit
Upgrade to SvelteKit SDK for full-stack support
Source Maps
Learn how to upload source maps
Session Replay
Set up session replay
Performance
Deep dive into performance monitoring