error-tracking-react

Instructions and guidance for using PostHog for error tracking in React applications.

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "error-tracking-react" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-e7742b38a4ab1c916598ac5a99c02cfc592e7a802e64f9b446626ec04ed8579d. Verify the upstream source and version against https://skills.sh/posthog/skills/error-tracking-react before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

skills.sh

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

Instructions and guidance for using PostHog for error tracking in React applications.

0 Downloads

Introduction source: third_party · posthog · 1.0.0 Reference

SkillPi interpretation

Tasks
PostHog error tracking for React
Audience
Not specified in the source documentation.
Inputs and outputs
Not specified in the source documentation.
Software, accounts and paid services
Not specified in the source documentation.
Limits and differences
Not specified in the source documentation.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: error-tracking-react
description: PostHog error tracking for React
metadata:
  author: PostHog
  version: 1.9.4

PostHog error tracking for React

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

Reference files

  • references/react.md - React 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

  • For feature flags, use useFeatureFlagEnabled() or useFeatureFlagPayload() hooks - they handle loading states and external sync automatically
  • Add analytics capture in event handlers where user actions occur, NOT in useEffect reacting to state changes
  • Do NOT use useEffect for data transformation - calculate derived values during render instead
  • Do NOT use useEffect to respond to user events - put that logic in the event handler itself
  • Do NOT use useEffect to chain state updates - calculate all related updates together in the event handler
  • Do NOT use useEffect to notify parent components - call the parent callback alongside setState in the event handler
  • To reset component state when a prop changes, pass the prop as the component's key instead of using useEffect
  • useEffect is ONLY for synchronizing with external systems (non-React widgets, browser APIs, network subscriptions)

Current listing version

1.0.0

Verify the source revision ↗

Safety and assessment details

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value75/100

Highlights

  • 提供 React 应用集成 PostHog 错误追踪的实用解决方案
  • 针对开发者群体的明确需求,具有较高的实用价值
Trigger Precision85/100

Highlights

  • 触发词精准完整,明确指向 PostHog React 错误追踪场景
Structure and Standards70/100

Areas to improve

  • 缺少具体示例和使用场景说明 Reported severity: Minor

    文档缺少端到端的代码示例和具体使用场景说明

    Recommendation: 建议添加完整的安装配置示例和常见使用场景的代码片段

Highlights

  • 结构清晰,包含关键原则和框架指南
  • 提供了详细的实施最佳实践
Execution Reliability65/100

Areas to improve

  • 引用文件缺失 Reported severity: Major

    SKILL.md 引用了多个 reference 文件但未实际传入

    Recommendation: 请确保所有被引用的文件都包含在 Skill 包中,或移除无法提供的引用

  • 缺少具体安装和实施代码 Reported severity: Minor

    未提供具体的安装命令、配置代码和 API 调用示例

    Recommendation: 建议添加 npm 安装命令、初始化配置代码和常见使用场景的代码示例

Highlights

  • 强调了重要的实施原则,如环境变量使用和 source maps 上传
  • 提供了框架特定的最佳实践指导
Evidence Verifiability (mean of the first four)74/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

These common operations were not identified in the main document. This does not mean no permissions or risks exist.

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Not specified in the source documentation.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.