Skill Store 33

Error Tracking Svelte

PostHog error tracking for SvelteKit apps: installs the PostHog SDK, enables exception autocapture,

by posthog · MIT

The skill

PostHog error tracking for SvelteKit apps: installs the PostHog SDK, enables exception autocapture, adds captureException() calls at error boundaries and catch blocks, uploads source maps, and sets up alerts, fingerprints, and issue assignment. Use when adding or configuring PostHog error tracking in a Svelte or SvelteKit project, including svelte.config.js, source map uploads, or reviewing PostHog error issues.

PostHog error tracking for Svelte

This skill helps you add PostHog error tracking to Svelte applications.

Reference files

  • references/svelte.md - Sveltekit error tracking installation - docs
  • references/fingerprints.md - Fingerprints - docs
  • references/alerts.md - Send error tracking alerts - docs
  • references/monitoring.md - Monitor and search issues - docs
  • references/assigning-issues.md - Assign issues to teammates - docs
  • references/upload-source-maps.md - Upload source maps - docs

Consult the documentation for API details and framework-specific patterns.

Key principles

  • Environment variables: Always use environment variables for PostHog keys and host URLs. Never hardcode them.
  • Minimal changes: Add error tracking alongside existing error handling. Don't replace or restructure existing error handling code.
  • Autocapture first: Enable exception autocapture in the SDK initialization before adding manual captures.
  • Source maps: Upload source maps so stack traces resolve to original source code, not minified bundles.
  • Manual capture for boundaries: Use captureException() at error boundaries and catch blocks for errors that don't propagate to the global handler.

Framework guidelines

  • Set paths.relative to false in svelte.config.js — this is required for PostHog session replay to work correctly with SSR and is easy to miss
  • Use the Svelte MCP server tools to check Svelte documentation (list-sections, get-documentation) and validate components (svelte-autofixer) — always run svelte-autofixer on new or modified .svelte files before finishing

Use this skill

Connect your agent to the Skill Store MCP server and ask for it by ref: posthog/error-tracking-svelte-28752014415.

Download SKILL.md · Markdown version

Details

Publisher
posthog
Category
Software Development › DevOps & cloud
License
MIT
Updated
2026-10-19

References

More from posthog