Skip to content

[CI] (edaca63) nuxt/movies-nuxt-4 - #2890

Closed
wizard-ci-bot[bot] wants to merge 1 commit into
mainfrom
wizard-ci-edaca63-nuxt-movies-nuxt-4
Closed

wizard-ci-bot[bot] wants to merge 1 commit into
mainfrom
wizard-ci-edaca63-nuxt-movies-nuxt-4

Conversation

@wizard-ci-bot

@wizard-ci-bot wizard-ci-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown

Automated wizard CI run

Source: wizard-pr
Trigger ID: edaca63
App: nuxt/movies-nuxt-4
App directory: apps/nuxt/movies-nuxt-4
Workbench branch: wizard-ci-edaca63-nuxt-movies-nuxt-4
Wizard branch: release-please--branches--main--components--wizard
Context Mill branch: main
PostHog (MCP) branch: master
Timestamp: 2026-07-16T17:15:19.936Z
Duration: 207.7s

YARA Scanner

✓ 91 tool calls scanned, 0 violations detected

No violations: ✓ 91 clean scans

@wizard-ci-bot

wizard-ci-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown
Author

PR Evaluation Report

Summary

This PR integrates PostHog into a Nuxt 4 movies application using the @posthog/nuxt module for client-side capture and posthog-node for server-side authentication events. It adds meaningful event tracking across media browsing, search, authentication flows, and includes proper user identification with SHA-256 hashed user IDs.

Files changed Lines added Lines removed
12 +197 -16

Confidence score: 5/5 🧙

  • __add_tracing_headers is not a documented config option: The nuxt.config.ts uses __add_tracing_headers in clientConfig, but the documented PostHog option is tracing_headers (an array of hostnames). The double-underscore prefix suggests an internal/undocumented property that may not work as intended. [MEDIUM]
  • enableExceptionAutocapture is not a valid posthog-node client option: In server/utils/posthog.ts, enableExceptionAutocapture: true is passed to the PostHog Node constructor, but this is a @posthog/nuxt module-level serverConfig option, not a posthog-node SDK option. It will be silently ignored. [LOW]
  • posthog.flush() used instead of posthog.shutdown(): The server-side login and logout handlers call posthog.flush() but reuse a singleton client. While flush() works, the singleton pattern means the client is never shut down. This is acceptable for long-lived server processes but differs from the documented pattern of calling shutdown(). [LOW]

File changes

Filename Score Description
nuxt.config.ts 4/5 Adds @posthog/nuxt module with config using env vars; uses questionable __add_tracing_headers option
package.json 5/5 Adds @posthog/nuxt and posthog-node dependencies
.env.example 5/5 Documents NUXT_PUBLIC_POSTHOG_KEY and NUXT_PUBLIC_POSTHOG_HOST
composables/useAuth.ts 5/5 Adds identify on login/return, capture on login/logout, reset on logout, tracing headers
components/media/Card.vue 5/5 Adds media_card_selected event with enriched properties
components/media/Details.vue 5/5 Adds media_details_tab_selected event
pages/[type]/[id].vue 5/5 Adds media_details_viewed event on mount
pages/search.vue 5/5 Adds search_submitted event with query length
server/utils/posthog.ts 4/5 Server-side PostHog singleton; includes invalid enableExceptionAutocapture option
server/api/auth/login.post.ts 5/5 Server-side login event with session correlation
server/api/auth/logout.post.ts 5/5 Server-side logout event with session correlation
posthog-setup-report.md 4/5 Good documentation but is an extra file

App sanity check ✅

Criteria Result Description
App builds and runs Yes No syntax errors; all imports use auto-imported composables correctly for Nuxt
Preserves existing env vars & configs Yes Existing BASE_URL env var preserved; existing modules list extended, not replaced
No syntax or type errors Yes All Vue SFC changes are syntactically correct; TypeScript types are consistent
Correct imports/exports Yes usePostHog is auto-imported by @posthog/nuxt; posthog-node imported correctly server-side
Minimal, focused changes Yes All changes relate to PostHog integration; minor code style changes (arrow to function, catch formatting) are minimal
Pre-existing issues None

Issues

  • __add_tracing_headers may not be the correct config key: The documented option for posthog-js is tracing_headers (an array of hostnames). The __add_tracing_headers key with a double-underscore prefix appears to be an internal/undocumented property. This may silently fail to enable tracing headers. Use tracing_headers: ['localhost'] instead. [MEDIUM]

Other completed criteria

  • Environment variables documented in .env.example
  • Build configuration valid with proper dependency additions
  • Code follows existing Nuxt/Vue patterns (composables, usePostHog, optional chaining)

PostHog implementation ✅

Criteria Result Description
PostHog SDKs installed Yes @posthog/nuxt ^1.7.80 and posthog-node ^5.44.0 added to package.json
PostHog client initialized Yes @posthog/nuxt module added to nuxt.config.ts with posthogConfig including publicKey and host from env vars; server-side singleton in server/utils/posthog.ts
capture() Yes 6 client-side and 2 server-side capture calls for meaningful user actions
identify() Yes posthog?.identify(response.userId) on login, re-identification on return visits via stored userId cookie, posthog?.reset() on logout
Error tracking Yes capture_exceptions: true in client config and enableExceptionAutocapture: true in server config via @posthog/nuxt module
Reverse proxy No No reverse proxy configured; the @posthog/nuxt module does not automatically set up a proxy and no rewrite rules are present

Issues

  • No reverse proxy configured: Client-side events are sent directly to the PostHog host. For a Nuxt app, a reverse proxy via Nitro server routes or Vercel/Cloudflare rewrites is recommended to avoid ad blocker interference. [MEDIUM]

Other completed criteria

  • API key loaded from NUXT_PUBLIC_POSTHOG_KEY environment variable
  • Host configured from NUXT_PUBLIC_POSTHOG_HOST environment variable
  • User identification uses SHA-256 hashed username (stable, non-PII distinct ID)
  • posthog.reset() called on logout
  • Re-identification on return visits from stored cookie
  • Tracing headers forwarded to server-side endpoints

PostHog insights and events ✅

Filename PostHog events Description
composables/useAuth.ts user_logged_in, user_logged_out Auth flow tracking with identify/reset; enables login funnel analysis
pages/search.vue search_submitted Search behavior tracking with query_length property
pages/[type]/[id].vue media_details_viewed Media detail page view with media_id and media_type
components/media/Details.vue media_details_tab_selected Tab interaction tracking with tab property
components/media/Card.vue media_card_selected Media card click with media_id, media_type, source
server/api/auth/login.post.ts server_login_completed Server-side login verification with session correlation
server/api/auth/logout.post.ts server_logout_completed Server-side logout with session correlation

Issues

No issues found.

Other completed criteria

  • Events represent real user actions (browsing, searching, authenticating)
  • Events enable product insights: login → search → media browse → detail view funnel
  • Events include enriched properties (media_id, media_type, source, query_length, tab)
  • No PII in event properties; username is hashed for distinct_id
  • Event names are descriptive and use consistent snake_case convention

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