Agent skill · data analytics · jeremylongshore

posthog-common-errors

Diagnose PostHog ingestion, identity, feature-flag, SDK, and private-API failures from concrete evidence. Use when events are missing, flags return unexpected values, or PostHog requests fail. Trigger with "debug PostHog", "PostHog events missing", or "PostHog 401".

Why this skill is useful

Provides specific troubleshooting steps and code snippets for common PostHog errors that the AI wouldn't reliably generate on its own.

What it needs

Requires posthog-js, posthog-node installed locally. Requires posthog account access. About 4k tokens when loaded. Last updated 2026-08-07. 2,604 stars on the source repository.

What this skill does

PostHog Common Errors Overview Diagnosis and solutions for the most common PostHog integration errors. Covers event capture failures, authentication issues, feature flag problems, identity fragmentation, and SDK initialization errors. Prerequisites PostHog SDK installed (posthog-js or posthog-node) Access to browser console or server logs PostHog project API key (phc...) available Instructions Tool discipline Use Read to inspect the relevant configuration and implementation before proposing changes. Use Grep to locate initialization, capture, flag, and credential boundaries. Error 1: Events Not Appearing in Dashboard Symptoms: posthog.capture() calls execute without error but events never show in PostHog Activity tab. Diagnoses and fixes: Error 2: Feature Flag Returns undefined or Wrong Value Error 3: 401 Unauthorized on API Calls Error 4: 429 Rate Limited Error 5: Identity Fragmentation (Duplicate Users) Error 6: posthog-js Not Loading or Initializing Quick Diagnostic Commands Error Handling Error HTTP Code Cause Solution ------- ----------- ------- ---------- Events missing N/A Not flushed await posthog.shutdown() Auth failed 401 Wrong key type Use phx for admin, phc for capture Rate limited 429 Too many API calls Backoff, cache results Flag undefined N/A Flags not loaded Use onFeatureFlags callback CSP blocked N/A Missing CSP entry Add us.i.posthog.com to connect-src Duplicate users N/A Identity mismatch Call posthog.identify() consistently Output Root cause identified for PostHog integration errors Fix applied with verification steps Diagnostic output confirming resolution Examples Given “server-side flags return undefined after deploy,” verify the region host, project token, feature-flags secure key, initialization lifetime, and fallback behavior. Return the first failed boundary, the evidence that proves it, and the smallest reversible correction. Resources See official PostHog references for current authority and verification boundaries. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills jeremylongshore/posthog-common-errors

View the source on GitHub

Browse the @skills marketplace