ashish7802/awesome-api-skills/posthog
Claude Code and agent skill by ashish7802/awesome-api-skills
- community
Checking that the SKILL.md file is still in the repository.
Install
npx vskill@latest install ashish7802/awesome-api-skills/posthogSKILL.md
The same SKILL.md was published earlier as ashish7802/awesome-api-skills/posthog.
PostHog API Skill
Quick Start
PostHog provides complete product analytics. The Node.js SDK allows you to capture events, identify users, and evaluate feature flags from your backend.
Common Workflows
User Identification and Events
When a user signs up, call posthog.identify() to map their internal DB ID to their analytics profile. Then, call posthog.capture() for key backend actions (e.g., 'Subscription Created').
Production Patterns
Feature Flag Evaluation
Evaluate feature flags on the backend before returning UI states. Use posthog.getFeatureFlag(flagKey, distinctId) to gate beta features securely. Local evaluation can dramatically speed up flag checks without hitting the API.
Error Recovery
The posthog-node SDK batches events and flushes them asynchronously. Ensure you call await posthog.shutdown() during your application's graceful shutdown sequence, or you will lose pending events.
Security Notes
Do not log PII (Passwords, SSNs, raw financial data) to PostHog. Scrub payloads before capture. Utilize PostHog's proxy capabilities to bypass ad-blockers securely.
Performance Considerations
Backend feature flag evaluation requires a network round-trip unless you configure Local Evaluation, which periodically syncs flag definitions and evaluates them entirely in-memory.
Testing Guidance
Disable PostHog in unit tests by passing a dummy API key and setting enable: false in the client configuration, or mock the posthog module entirely.
Troubleshooting
If events are missing in the dashboard, verify that you are flushing the queue before the serverless function (e.g., AWS Lambda) terminates. Standard asynchronous event capture will be killed instantly in Lambda.
References
Related Skills
Why use this skill
Use this when your agent works with posthog — structured patterns beat pasted docs and prevent common hallucinations.
AI pitfalls
- Using outdated SDK or API versions from training data
- Inventing environment variable names
- Omitting error handling and retry logic
Production checklist
- [ ] Secrets in environment variables, not source code
- [ ] Error handling and logging in place
- [ ] Rate limits and timeouts configured
Related skills
- `mixpanel` — related to
Last Verified: 2026-07-02
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/posthog/SKILL.md
Popularity
- Repository stars
- 13
- Repository forks
- 6
- 7-day trend score
- 13
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/ashish7802/awesome-api-skills/posthog)