{"id":"posthog","kind":"sdk","name":"PostHog","slug":"posthog","description":"Product analytics, feature flags, session replay, and experiments.","vendor":"PostHog","languages":["javascript","typescript","nodejs","python","go","ruby","php","java","elixir","dart","swift","kotlin"],"categories":["analytics","devtools"],"homepage":"https://posthog.com","docsUrl":"https://posthog.com/docs","githubUrl":"https://github.com/PostHog","tags":["analytics","feature-flags"],"packages":[{"registry":"npm","name":"posthog-js","url":"https://www.npmjs.com/package/posthog-js"},{"registry":"npm","name":"posthog-node","url":"https://www.npmjs.com/package/posthog-node"},{"registry":"pypi","name":"posthog","url":"https://pypi.org/project/posthog/"}],"skills":[{"name":"posthog-instrumentation","url":"https://skills.sh/posthog/posthog-for-claude/posthog-instrumentation","install":"npx skills add posthog/posthog-for-claude --skill posthog-instrumentation","sdk":"posthog","key":"posthog/posthog-instrumentation","description":"Automatically add PostHog analytics instrumentation to code. Triggers when user asks to add tracking, instrument events, add analytics, or implement feature flags in their codebase.","hasContent":true,"content":"---\nname: posthog-instrumentation\ndescription: Automatically add PostHog analytics instrumentation to code. Triggers when user asks to add tracking, instrument events, add analytics, or implement feature flags in their codebase.\n---\n\n# PostHog Instrumentation Skill\n\nHelp users add PostHog analytics, event tracking, and feature flags to their code.\n\n## When to Use\n\n- User asks to \"add PostHog\" or \"add analytics\"\n- User wants to track events or user actions\n- User needs to implement feature flags\n- User asks about instrumenting their code\n\n## Workflow\n\n1. Identify the framework (React, Next.js, Python, Node.js, etc.)\n2. Check for existing PostHog setup\n3. Add appropriate instrumentation\n\n## Code Patterns\n\n### JavaScript/TypeScript\n```javascript\n// Event tracking\nposthog.capture('button_clicked', { button_name: 'signup' })\n\n// Feature flags\nif (posthog.isFeatureEnabled('new-feature')) {\n  // Show new feature\n}\n\n// User identification\nposthog.identify(userId, { email: user.email })\n```\n\n### Python\n```python\nfrom posthog import Posthog\nposthog = Posthog(api_key='<ph_project_api_key>')\n\n# Event tracking\nposthog.capture(distinct_id='user_123', event='purchase_completed')\n\n# Feature flags\nif posthog.feature_enabled('new-feature', 'user_123'):\n    # Show new feature\n```\n\n### React\n```jsx\nimport { usePostHog } from 'posthog-js/react'\n\nfunction MyComponent() {\n  const posthog = usePostHog()\n\n  const handleClick = () => {\n    posthog.capture('button_clicked')\n  }\n}\n```\n\n## Best Practices\n\n- Use consistent event naming (snake_case recommended)\n- Include relevant properties with events\n- Identify users early in their session\n- Use feature flags for gradual rollouts\n","contentSource":"skills.sh/api/download/posthog/posthog-for-claude/posthog-instrumentation","contentFetchedAt":"2026-07-27T08:59:27.572Z"}],"official":true,"generatedAt":"2026-07-27T09:02:29.956Z"}