Skip to content

[CI] (dabf817) next-js/15-app-router-saas#146

Closed
wizard-ci-bot[bot] wants to merge 1 commit intomainfrom
wizard-ci-dabf817-next-js-15-app-router-saas
Closed

[CI] (dabf817) next-js/15-app-router-saas#146
wizard-ci-bot[bot] wants to merge 1 commit intomainfrom
wizard-ci-dabf817-next-js-15-app-router-saas

Conversation

@wizard-ci-bot
Copy link

@wizard-ci-bot wizard-ci-bot bot commented Jan 14, 2026

Automated wizard CI run

Trigger ID: dabf817
App: next-js/15-app-router-saas
App directory: apps/next-js/15-app-router-saas
Workbench branch: wizard-ci-dabf817-next-js-15-app-router-saas
Wizard branch: feat-skill-based-integration
Examples branch: rearchitect-generator
PostHog (MCP) branch: feat-mcp-skill-deployment
Timestamp: 2026-01-14T20:55:53.445Z
Duration: 320.2s

@wizard-ci-bot
Copy link
Author

wizard-ci-bot bot commented Jan 14, 2026

Now I have all the information I need to evaluate this PR. Let me compile the evaluation report.


PR Evaluation Report

Summary

This PR integrates PostHog analytics into a Next.js 15 App Router SaaS application. It adds client-side initialization via instrumentation-client.ts, server-side client setup, reverse proxy configuration for ad-blocker bypass, and event tracking across authentication, subscription management, team operations, and account settings flows. User identification is implemented on sign-in/sign-up.

Files changed Lines added Lines removed
12 +539 -11

Confidence score: 4/5 👍

  • PII in events: The sign_in_submitted and sign_up_submitted events capture user email as a property and use email as the identifier for posthog.identify(). While using email as a distinct ID is common, capturing it redundantly as a property may expose PII unnecessarily. [MEDIUM]
  • Server client unused: lib/posthog-server.ts is created but never imported or used anywhere in the codebase. Dead code adds maintenance burden. [MEDIUM]
  • Environment variables not documented: .env.example was not updated with NEXT_PUBLIC_POSTHOG_KEY and NEXT_PUBLIC_POSTHOG_HOST variables. Users setting up the app won't know these are required. [MEDIUM]

File changes

Filename Score Description
instrumentation-client.ts 4/5 New file - PostHog client initialization using Next.js 15.3+ instrumentation pattern with exception capture, reverse proxy host, and debug mode
lib/posthog-server.ts 3/5 New file - Server-side PostHog client with singleton pattern, but never used anywhere in the codebase
next.config.ts 5/5 Added reverse proxy rewrites for /ingest to PostHog endpoints, correctly handles static assets
package.json 5/5 Added posthog-js and posthog-node dependencies with appropriate versions
app/(login)/login.tsx 3/5 Added sign-in/sign-up events with email capture and identification - email in properties is potential PII concern
app/(dashboard)/layout.tsx 5/5 Added sign-out tracking with posthog.reset() for proper session cleanup
app/(dashboard)/pricing/submit-button.tsx 5/5 Added checkout started event on button click
app/(dashboard)/dashboard/page.tsx 4/5 Added subscription, team invite, and team member removal events with relevant properties
app/(dashboard)/dashboard/general/page.tsx 4/5 Added account update event tracking
app/(dashboard)/dashboard/security/page.tsx 4/5 Added password update and account deletion events
pnpm-lock.yaml 5/5 Lockfile correctly updated with PostHog dependencies and transitive dependencies
posthog-setup-report.md 4/5 Documentation file but mentions .env file creation that doesn't appear in the diff

App sanity check: 4/5 ✅

Criteria Result Description
App builds and runs Yes Dependencies properly added, no syntax errors, TypeScript types are valid
Preserves existing env vars & configs Partial Original next.config.ts preserved, but .env.example not updated with PostHog env vars
No syntax or type errors Yes All PostHog imports and usage are type-safe
Correct imports/exports Yes posthog from 'posthog-js' correctly imported in all client components
Minimal, focused changes Yes Changes are focused on PostHog integration only

Issues

  • Missing env documentation: .env.example was not updated with NEXT_PUBLIC_POSTHOG_KEY and NEXT_PUBLIC_POSTHOG_HOST. The setup report mentions .env file creation but this isn't shown in the diff. Users will need to manually add these variables. [MEDIUM]

Other completed criteria

  • All 'use client' directives preserved where PostHog is used
  • Form actions preserved alongside onSubmit handlers
  • Error handling patterns maintained
  • Suspense boundaries unchanged
  • Component structure preserved

PostHog implementation: 4/5 ✅

Criteria Result Description
PostHog SDKs installed Yes posthog-js@^1.321.2 and posthog-node@^5.21.0 added to dependencies
PostHog client initialized Yes Client init in instrumentation-client.ts with api_host pointing to reverse proxy /ingest
capture() Yes 10 custom events captured across authentication, subscription, team, and account flows
identify() Yes User identification on sign-in and sign-up using email as distinct ID
Error tracking Yes capture_exceptions: true enabled in client initialization
Reverse proxy Yes Next.js rewrites configured for /ingest/* to us.i.posthog.com and /ingest/static/* to us-assets.i.posthog.com

Issues

  • Server client unused: lib/posthog-server.ts exports getPostHogClient() and shutdownPostHog() but neither is imported or called anywhere. This is dead code. [MEDIUM]
  • Email as property: sign_in_submitted and sign_up_submitted events capture email as both an event property and use it for identify(). The property is redundant and may cause PII concerns in some contexts. [LOW]

Other completed criteria

  • Proper posthog.reset() called on sign-out
  • Debug mode tied to development environment
  • UI host correctly set to https://us.posthog.com
  • Uses modern defaults: '2025-05-24' configuration
  • Non-null assertion on env var is acceptable for required config

PostHog insights and events: 4/5 ✅

Filename PostHog events Description
login.tsx sign_in_submitted, sign_up_submitted Authentication funnel entry points with email for user identification
layout.tsx sign_out_clicked Session end tracking with posthog.reset() for clean state
submit-button.tsx checkout_started Pricing/conversion funnel - tracks when users initiate checkout
dashboard/page.tsx subscription_managed, team_member_invited, team_member_removed Subscription management and team collaboration metrics with properties (plan_name, status, member details)
general/page.tsx account_updated Account settings engagement tracking
security/page.tsx password_update_submitted, account_deletion_submitted Security actions and churn indicator tracking

Issues

  • Missing price_id on checkout: The checkout_started event doesn't capture which pricing plan was selected. Adding price_id would enable conversion analysis by plan tier. [LOW]
  • No failure tracking: Events fire on form submission but don't track whether actions succeeded or failed. Consider adding success/failure events. [LOW]

Other completed criteria

  • Events cover full user lifecycle (signup → usage → churn)
  • Team collaboration events enable growth metric analysis
  • Subscription events enable revenue attribution
  • Event names follow snake_case convention consistently
  • Properties are enriched with contextual data (plan_name, subscription_status, member_role)

Reviewed by wizard workbench PR evaluator

@wizard-ci-bot wizard-ci-bot bot added the CI/CD label Jan 14, 2026
@wizard-ci-bot wizard-ci-bot bot closed this Jan 14, 2026
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