Skip to content

[CI] (cef44b4) nuxt/movies-nuxt-4#1401

Closed
wizard-ci-bot[bot] wants to merge 1 commit intomainfrom
wizard-ci-cef44b4-nuxt-movies-nuxt-4
Closed

[CI] (cef44b4) nuxt/movies-nuxt-4#1401
wizard-ci-bot[bot] wants to merge 1 commit intomainfrom
wizard-ci-cef44b4-nuxt-movies-nuxt-4

Conversation

@wizard-ci-bot
Copy link
Copy Markdown

@wizard-ci-bot wizard-ci-bot Bot commented May 1, 2026

Automated wizard CI run

Source: context-mill-pr
Trigger ID: cef44b4
App: nuxt/movies-nuxt-4
App directory: apps/nuxt/movies-nuxt-4
Workbench branch: wizard-ci-cef44b4-nuxt-movies-nuxt-4
Wizard branch: main
Context Mill branch: basic-skills-v2
PostHog (MCP) branch: master
Timestamp: 2026-05-01T21:03:05.669Z
Duration: 346.4s

@wizard-ci-bot
Copy link
Copy Markdown
Author

wizard-ci-bot Bot commented May 1, 2026


PR Evaluation Report

Summary

This PR integrates PostHog into a Nuxt 4 movies app using the @posthog/nuxt module and posthog-node for server-side tracking. It adds client-side event captures across login, logout, search, media browsing, and video playback flows, plus a server-side login event. Error tracking is enabled on both client and server via configuration.

Files changed Lines added Lines removed
11 +163 -24

Confidence score: 4/5 👍

  • Missing identify on page refresh: posthog.identify() is only called during the login handler but not on app load when the user is already authenticated via cookie. This causes anonymous events for returning users until they log in again. [CRITICAL]
  • No reverse proxy configured: PostHog is called directly from the browser at us.i.posthog.com with no Nitro proxy routes configured, making requests vulnerable to ad blockers. [MEDIUM]
  • Environment variables not documented in committed files: .env.example was not updated with NUXT_PUBLIC_POSTHOG_PROJECT_TOKEN and NUXT_PUBLIC_POSTHOG_HOST. The .env file exists but was not committed. [MEDIUM]

File changes

Filename Score Description
nuxt.config.ts 4/5 Added @posthog/nuxt module with client/server config, env-driven API key and host
package.json 5/5 Added @posthog/nuxt and posthog-node dependencies
server/utils/posthog.ts 4/5 Singleton PostHog Node client for server-side capture
pages/login.vue 3/5 Identify and login capture added, but only on login — not on app reload
components/NavBar.vue 5/5 Correctly captures logout event and calls posthog.reset()
pages/search.vue 4/5 Search capture with query property; function moved unnecessarily
pages/[type]/[id].vue 4/5 Media viewed capture with relevant properties
components/media/Card.vue 5/5 Media card click capture with media metadata
components/video/Card.vue 5/5 Video play capture with video metadata
server/api/auth/login.post.ts 4/5 Server-side login capture with session correlation headers
posthog-setup-report.md 3/5 Setup report; not relevant to integration quality

App sanity check ⚠️

Criteria Result Description
App builds and runs Yes @posthog/nuxt module registration and config are valid; dependencies properly added
Preserves existing env vars & configs Yes Existing modules, runtimeConfig entries, and app functionality preserved
No syntax or type errors Yes All Vue SFC and TypeScript syntax is valid
Correct imports/exports Yes usePostHog() auto-imported by @posthog/nuxt; posthog-node import in server util is correct
Minimal, focused changes No Gratuitous reformatting in login.vue (self-closing tags, whitespace) and search.vue (function reordering)
Pre-existing issues None Base app appears functional

Issues

  • Environment variables not documented: .env.example was not updated with NUXT_PUBLIC_POSTHOG_PROJECT_TOKEN and NUXT_PUBLIC_POSTHOG_HOST. The .env file exists locally but was not committed. A new developer cloning this repo would not know which PostHog env vars to set. [MEDIUM]
  • Unnecessary reformatting: login.vue changes self-closing HTML tags to non-self-closing, reformats whitespace, and changes catch/finally blocks. search.vue moves the search function below fetch. These are unrelated to PostHog integration. [LOW]

Other completed criteria

  • All changes relate to PostHog integration
  • Correct files modified for Nuxt framework (nuxt.config.ts, components, pages, server utils)
  • Code follows existing codebase patterns (Vue composables, optional chaining for PostHog)
  • Imports and exports are correct throughout

PostHog implementation ⚠️

Criteria Result Description
PostHog SDKs installed Yes @posthog/nuxt@^1.7.20 and posthog-node@^5.32.1 added to package.json dependencies
PostHog client initialized Yes @posthog/nuxt module registered in nuxt.config.ts with posthogConfig block; client auto-initialized by module. Server-side singleton in server/utils/posthog.ts
capture() Yes 7 meaningful capture calls across client and server (login, logout, search, media view, video play, card click, server login)
identify() No Only called during login handler; not called on app load/page refresh when user is already authenticated via cookie
Error tracking Yes Client: capture_exceptions: true in clientConfig. Server: enableExceptionAutocapture: true in serverConfig
Reverse proxy No No Nitro proxy routes configured for PostHog; browser requests go directly to us.i.posthog.com

Issues

  • Missing identify on app load/refresh: posthog.identify() is only called in the login handler. When a user refreshes the page or returns later (with a valid auth cookie), useAuth() restores the user from the cookie but identify is never called again. All events from that session will be anonymous until the user logs in again. A Nuxt plugin or middleware should call posthog.identify(user) on app initialization when the user is already authenticated. [CRITICAL]
  • No reverse proxy: The @posthog/nuxt module does not automatically set up a reverse proxy. Nitro route rules or server routes should be added to proxy /ingest/* to us.i.posthog.com to avoid ad blocker interference with client-side tracking. [MEDIUM]

Other completed criteria

  • API key loaded from environment variable NUXT_PUBLIC_POSTHOG_PROJECT_TOKEN
  • Host correctly configured via NUXT_PUBLIC_POSTHOG_HOST with sensible default
  • posthog.reset() correctly called on logout
  • Server-side PostHog client properly initialized as singleton with correct host/key
  • Error tracking enabled on both client and server

PostHog insights and events ✅

Filename PostHog events Description
pages/login.vue user_logged_in, identify Captures login success and identifies user by username
components/NavBar.vue user_logged_out, reset Captures logout and resets PostHog identity
pages/search.vue search_performed Captures search with query property for search analytics
pages/[type]/[id].vue media_viewed Captures media detail page views with ID, type, and title
components/media/Card.vue media_card_clicked Captures card navigation clicks with media metadata
components/video/Card.vue video_played Captures video/trailer plays with video metadata
server/api/auth/login.post.ts server_login Server-side login event with session correlation headers

Issues

  • Username in server event properties: The server_login event includes username: sanitizedUsername in capture properties. While username is not strictly PII (not email/phone/name), identity-related data is better placed in `` person properties for cleaner data hygiene. [LOW]

Other completed criteria

  • Events represent real user actions mapped to actual product flows (auth, discovery, engagement)
  • Events enable product insights: login → browse → view → play funnel is capturable
  • Events include relevant contextual properties (media_id, media_type, media_title, query, video metadata)
  • Event names are descriptive, consistent snake_case convention
  • No emails, phone numbers, or physical addresses in event properties

Reviewed by wizard workbench PR evaluator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants