posthog

Integrate PostHog analytics, feature flags, and session replay into Next.js applications.

Updated Mar 2, 2026
One-click install
npx skills add https://github.com/vitoropereira/claude-starter-kit --skill posthog-vitoropereira
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: posthog
Source: https://github.com/vitoropereira/claude-starter-kit/tree/main/.claude/skills/analytics/posthog
Command: npx skills add https://github.com/vitoropereira/claude-starter-kit --skill posthog-vitoropereira

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill simplifies the integration and utilization of PostHog for comprehensive analytics, feature flagging, and session replay in Next.js applications, enabling data-driven product decisions.

Core Features & Use Cases

  • Event Tracking: Implement robust event tracking for user actions and application events.
  • Feature Flags & Experiments: Manage feature flags and A/B tests to control feature rollouts and experiment with variations.
  • Session Replay: Set up session recording to understand user behavior and troubleshoot issues.
  • Analytics & Reporting: Leverage HogQL and PostHog's reporting tools for insights into user funnels, retention, and SEO.

Quick Start

Configure PostHog analytics in your Next.js app by adding the provided environment variables and updating your next.config.ts and provider files.

Frequently Asked Questions about posthog

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up PostHog analytics in a Next.js application?

To set up PostHog analytics in Next.js, add the required environment variables, update your next.config.ts for reverse proxy support, and configure the PostHog provider files for client-side and server-side tracking.

Can I use feature flags and A/B testing with PostHog in Next.js?

Yes, you can implement feature flags and A/B testing with PostHog in Next.js to control feature rollouts and experiment with variations using the provided provider configurations.

How does session replay work for troubleshooting user behavior in Next.js?

Session replay records user interactions within your Next.js application, allowing you to review user behavior, understand navigation patterns, and troubleshoot issues visually.

Does this PostHog integration support server-side event tracking?

Yes, the PostHog integration supports both client-side and server-side event tracking, enabling comprehensive capture of user actions and application events across your Next.js environment.

What is the best way to query PostHog analytics data for SEO insights?

You can leverage HogQL and PostHog's reporting tools to query analytics data, gaining insights into user funnels, retention metrics, and SEO performance via Google Search Console integration.

Do I need a reverse proxy to run PostHog analytics on my Next.js domain?

Configuring a reverse proxy in your next.config.ts is supported to route PostHog analytics traffic through your own domain, preventing ad-blockers from interfering with event tracking.