integration-nuxt-3.6

Integrate PostHog client and server event tracking into Nuxt 3.0–3.6 applications.

58|5|Updated Jan 19, 2026
One-click install
npx skills add https://github.com/PostHog/skills --skill integration-nuxt-3-6
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: integration-nuxt-3.6
Source: https://github.com/PostHog/skills/tree/main/skills/posthog/integration/skills/nuxt-3.6
Command: npx skills add https://github.com/PostHog/skills --skill integration-nuxt-3-6

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This skill enables end-to-end PostHog analytics integration for Nuxt 3.0–3.6 apps by wiring client and server event tracking.

Core Features & Use Cases

  • Client-side PostHog initialization via a Nuxt plugin to capture events and identify users.
  • Server-side analytics via PostHog Node client in API routes to associate server events with sessions and distinct IDs.
  • Error tracking and logging across client and server with automatic Vue error handling and manual exception captures.
  • Environment-driven configuration using runtime config to securely manage PostHog keys and host.
  • Real-world example patterns show how to wire login, burrito considerations, and profile events across the stack.

Quick Start

Configure the Nuxt project to load the PostHog runtime config, add the plugin, and implement client/server event capture following the Nuxt 3.6 pattern.

Frequently Asked Questions about integration-nuxt-3.6

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

FAQPage Schema
How do I add PostHog analytics to a Nuxt 3.6 application?

To add PostHog analytics to a Nuxt 3.6 application, you configure runtime config for keys, add a client plugin for event capture, and use the PostHog Node client in API routes for server-side tracking.

How does server-side Posthog event tracking work with Nuxt API routes?

Server-side PostHog tracking in Nuxt API routes uses the PostHog Node client to capture events, associating them with user sessions and distinct IDs for consistent analytics correlation across the stack.

Can I track errors automatically with PostHog in a Nuxt plugin?

Yes, PostHog error tracking in a Nuxt plugin provides automatic Vue error handling on the client and manual exception captures on the server to monitor exceptions across the application.

Do I need Nuxt runtime config to manage PostHog keys securely?

Yes, you need Nuxt runtime config to manage PostHog keys securely, ensuring that your PostHog host and API keys are properly loaded into both client and server environments.

Why are my PostHog events missing when navigating between Nuxt routes?

Missing PostHog events during Nuxt route navigation often occur because events are not flushed properly; enforcing correct server shutdown and consistent flushing across API endpoints resolves this.