posthog-common-errors

Featured

Diagnose and fix common PostHog errors: events not appearing, flags returning undefined, 401/429 errors, SDK initialization failures, and identity issues. Trigger: "posthog error", "fix posthog", "posthog not working", "debug posthog", "posthog events missing", "posthog broken".

AI & Automation 2,940 stars 439 forks Updated today MIT

Install

View on GitHub

Quality Score: 99/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# 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 ### 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:** ```typescript // Problem A: Not flushing in serverless/scripts // posthog-node queues events — they're lost if process exits before flush const posthog = new PostHog('phc_...'); posthog.capture({ distinctId: 'user-1', event: 'test' }); // FIX: Always flush before exit await posthog.shutdown(); // or await posthog.flush() // Problem B: Wrong API host posthog.init('phc_...', { api_host: 'https://app.posthog.com', // WRONG — this is the UI }); // FIX: Use the ingest endpoint posthog.init('phc_...', { api_host: 'https://us.i.posthog.com', // CORRECT for US Cloud // api_host: 'https://eu.i.posthog.com', // For EU Cloud }); // Problem C: Ad blocker blocking posthog-js requests // FIX: Set up a reverse proxy (see posthog-sdk-patterns) // next.config.js rewrites: /ingest/* → us.i.posthog.com/* // Then: posthog.init('phc_...', { api_host: '/ingest' }); ``` ### Error 2: Feature...

Details

Author
jeremylongshore
Repository
jeremylongshore/claude-code-plugins-plus-skills
Created
1 years ago
Last Updated
today
Language
Python
License
MIT

Integrates with

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category