mcpField
E
error-tracking-angular

error-tracking-angular

github.com/posthogDevelopment7691 installsUpdated today
Repository

About error-tracking-angular

A skill for adding PostHog error tracking to Angular applications. It covers exception capture, issue monitoring, and source maps, and provides Angular-specific service and component guidance.

Key features

  1. 01Automatic and manual exception capture
  2. 02Issue monitoring and search
  3. 03Alerts and issue assignment
  4. 04Source map uploads
  5. 05Wrap the SDK in a singleton PosthogService

Use cases

  1. 01Add PostHog error tracking to an Angular app
  2. 02Capture exceptions at error boundaries
  3. 03Investigate issues and assign them to teammates

Install

Copy the command and run it in a terminal.

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

After installing, type/error-tracking-angularin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

references/
alerts.md
angular.md
assigning-issues.md
fingerprints.md
monitoring.md
upload-source-maps.md

Details

From the project README

PostHog error tracking for Angular

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

Reference files

  • references/angular.md - Angular 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

  • Use inject() instead of constructor injection. PostHog service should be injected via inject() in components/services that need it.
  • Create a dedicated PosthogService as a singleton root service that wraps the PostHog SDK.
  • Always use standalone components over NgModules.
  • Configure PostHog credentials in src/environments/environment.ts files, as Angular reads environment variables from these configuration files

Comments

Markdown supported