error-tracking-web

द्वारा posthog

PostHog error tracking for Web (JavaScript)

npx skills add https://github.com/posthog/skills --skill error-tracking-web

PostHog error tracking for Web (JavaScript)

This skill helps you add PostHog error tracking to Web (JavaScript) applications.

Reference files

  • references/web.md - Web 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

  • Remember that source code is available in the node_modules directory
  • Check package.json for type checking or build scripts to validate changes
  • posthog-js is the JavaScript SDK package name
  • posthog.init() MUST be called before any other PostHog methods (capture, identify, etc.)
  • posthog-js is browser-only — do NOT import it in Node.js or server-side contexts (use posthog-node instead)
  • Autocapture is ON by default with posthog-js (tracks clicks, form submissions, pageviews). Do NOT disable autocapture unless the user explicitly requests it.
  • NEVER send PII in posthog.capture() event properties — no emails, full names, phone numbers, physical addresses, IP addresses, or user-generated content
  • PII belongs in posthog.identify() person properties (email, name, role), NOT in capture() event properties
  • Call posthog.identify(userId, { email, name, role }) on login AND on page refresh if the user is already logged in
  • Call posthog.reset() on logout to unlink future events from the current user
  • For SPAs without a framework router, capture pageviews with posthog.capture($pageview) or use the capture_pageview history_change option in init for History API routing

posthog की और Skills

managing-experiment-lifecycle
posthog
प्रयोग स्थिति परिवर्तनों का मार्गदर्शन करता है: लॉन्च करना, रोकना, फिर से शुरू करना, समाप्त करना, वेरिएंट भेजना, संग्रहीत करना, रीसेट करना और डुप्लिकेट करना। पूर्व शर्तों को शामिल करता है,…
official
configuring-experiment-analytics
posthog
Configures the analytics side of a PostHog experiment — exposure criteria (default `$feature_flag_called` vs custom exposure events), primary and secondary…
official
error-tracking-hono
posthog
PostHog द्वारा Hono के लिए त्रुटि ट्रैकिंग
official
error-tracking-react
posthog
PostHog द्वारा React के लिए त्रुटि ट्रैकिंग
official
integration-android
posthog
Android अनुप्रयोगों के लिए PostHog एकीकरण
official
integration-ruby
posthog
किसी भी Ruby एप्लिकेशन के लिए Ruby SDK का उपयोग करते हुए PostHog एकीकरण
official
tuning-incremental-sync-config
posthog
एक सिंक का कॉन्फ़िगरेशन ExternalDataSchema पर रहता है और इसे external-data-schemas-partial-update के माध्यम से कभी भी बदला जा सकता है। अधिकांश परिवर्तन गैर-विनाशकारी होते हैं (अगले सिंक पर प्रभावी होते हैं), लेकिन कुछ (sync_type बदलना, प्राथमिक कुंजियाँ बदलना) को सिंक किए गए डेटा को दूषित होने से बचाने के लिए सावधानीपूर्वक संभालने की आवश्यकता होती है।
official
instrument-integration
posthog
इस कौशल का उपयोग किसी एप्लिकेशन में PostHog SDK जोड़ने के लिए करें। इसका उपयोग PostHog को पहली बार सेट करते समय या PRs की समीक्षा करते समय करें जिनमें PostHog इनिशियलाइज़ेशन की आवश्यकता हो। इसमें SDK इंस्टॉलेशन, प्रोवाइडर सेटअप और बुनियादी कॉन्फ़िगरेशन शामिल है। किसी भी फ्रेमवर्क या भाषा को सपोर्ट करता है।
official