Skip to content

[CI] (b6c5097) next-js/15-pages-router-todo - #4072

Closed
wizard-ci-bot[bot] wants to merge 1 commit into
mainfrom
wizard-ci-b6c5097-next-js-15-pages-router-todo
Closed

wizard-ci-bot[bot] wants to merge 1 commit into
mainfrom
wizard-ci-b6c5097-next-js-15-pages-router-todo

Conversation

@wizard-ci-bot

@wizard-ci-bot wizard-ci-bot Bot commented Sep 22, 2026

Copy link
Copy Markdown

Automated wizard CI run

Source: wizard-pr
Trigger ID: b6c5097
App: next-js/15-pages-router-todo
App directory: apps/next-js/15-pages-router-todo
Workbench branch: wizard-ci-b6c5097-next-js-15-pages-router-todo
Wizard branch: posthog/functional-a1-min
Context Mill branch: main
PostHog (MCP) branch: master
Timestamp: 2026-09-22T01:21:20.413Z
Duration: 320.0s

YARA Scanner

✓ 118 tool calls scanned, 0 violations detected

No violations: ✓ 118 clean scans

@wizard-ci-bot

wizard-ci-bot Bot commented Sep 22, 2026

Copy link
Copy Markdown
Author

PR Evaluation Report

Summary

This PR integrates PostHog into a Next.js 15 Pages Router todo app. It adds posthog-js to dependencies, initializes it in _app.tsx with a browser-side guard, captures three custom events in the todo list component (create, toggle, delete), and implements a class-based error boundary with captureException. No user identification or reverse proxy is configured.

Files changed Lines added Lines removed
5 +82 -1

Confidence score: 5/5 🧙

  • No identify() call: The app has no user identification anywhere. When users log in or perform actions, events remain anonymous. This prevents linking sessions to known users and breaks cross-session/cross-device tracking. [CRITICAL]
  • No reverse proxy configured: PostHog requests go directly to the PostHog host, making them vulnerable to ad blockers. A Next.js rewrite in next.config.js or similar should be set up. [MEDIUM]
  • Outdated defaults value: defaults: '2026-01-30' is used instead of the latest recommended '2026-05-30'. This may miss newer default configuration improvements. [LOW]

File changes

Filename Score Description
pages/_app.tsx 4/5 Initializes PostHog with browser guard, env var validation, error boundary with captureException. Uses direct posthog-js import instead of @posthog/react PostHogProvider — functional but not idiomatic for React.
components/todos/todo-list.tsx 4/5 Adds three well-structured capture calls for todo CRUD actions with meaningful properties.
package.json 5/5 Adds posthog-js dependency correctly.
.env.example 5/5 Documents both required PostHog env vars.
.gitignore 5/5 Excludes .env from version control.

App sanity check ⚠️

Criteria Result Description
App builds and runs Yes No syntax errors; browser guard prevents SSR issues
Preserves existing env vars & configs Yes Only the return statement in _app.tsx was modified; all original functionality preserved
No syntax or type errors Yes TypeScript types are correct throughout
Correct imports/exports Yes posthog-js imported correctly in both files
Minimal, focused changes Yes All changes directly support PostHog integration
Pre-existing issues None —

Issues

  • defaults version outdated: Uses '2026-01-30' instead of the latest '2026-05-30', potentially missing newer default configuration improvements. [LOW]

Other completed criteria

  • Environment variables documented in .env.example
  • .env excluded via .gitignore
  • Build configuration valid (package.json properly updated)

PostHog implementation ⚠️

Criteria Result Description
PostHog SDKs installed Yes posthog-js@^1.434.5 added to package.json
PostHog client initialized Yes posthog.init() called in _app.tsx with browser guard (typeof window !== 'undefined'), project token, and host from env vars
capture() Yes Three meaningful capture calls: todo_created, todo_completion_changed, todo_deleted
identify() No No posthog.identify() call anywhere in the codebase. All events are anonymous.
Error tracking Yes Class-based GlobalErrorBoundary wrapping the app with posthog.captureException(error), plus capture_exceptions: true in init config for automatic exception capture
Reverse proxy No No Next.js rewrites or middleware proxy configured. Requests go directly to PostHog host.

Issues

  • Missing identify() call: No user identification is implemented. The docs state "Identifying users is required." At minimum, posthog.identify() should be called when user identity is known (login, page load with auth). Without it, all captured events are anonymous and cannot be linked to user profiles. [CRITICAL]
  • No reverse proxy: For a client-side web app, a reverse proxy (e.g., Next.js rewrites in next.config.js) is recommended to prevent ad blockers from intercepting PostHog requests. [MEDIUM]
  • Not using @posthog/react provider pattern: The integration directly imports posthog from posthog-js in components rather than using PostHogProvider and usePostHog hook from @posthog/react. This works but is not the idiomatic React pattern and won't support React hooks like useFeatureFlagEnabled. [LOW]

Other completed criteria

  • API key loaded from NEXT_PUBLIC_POSTHOG_PROJECT_TOKEN environment variable (not hardcoded)
  • Host correctly configured from NEXT_PUBLIC_POSTHOG_HOST environment variable
  • capture_exceptions: true enables automatic exception capture in addition to the error boundary

PostHog insights and events ✅

Filename PostHog events Description
components/todos/todo-list.tsx todo_created, todo_completion_changed, todo_deleted Captures core CRUD actions on todos with contextual properties (has_description, total_todos, completed, remaining_todos). Enables funnel analysis of todo lifecycle.
pages/_app.tsx captureException Error boundary captures React rendering exceptions via posthog.captureException(). Autocapture for exceptions also enabled via capture_exceptions: true.

Issues

  • No issues with event quality.

Other completed criteria

  • Events represent real user actions (create, complete/uncomplete, delete todos)
  • Events enable product insights (can build create→complete funnel, track completion rates)
  • Events include relevant properties (has_description, total count, completion state)
  • No PII in event properties
  • Consistent snake_case naming 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