Skip to content

[CI] (dbf5526) next-js/15-pages-router-todo - #3184

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

[CI] (dbf5526) next-js/15-pages-router-todo#3184
wizard-ci-bot[bot] wants to merge 1 commit into
mainfrom
wizard-ci-dbf5526-next-js-15-pages-router-todo

Conversation

@wizard-ci-bot

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

Copy link
Copy Markdown

Automated wizard CI run

Source: wizard-pr
Trigger ID: dbf5526
App: next-js/15-pages-router-todo
App directory: apps/next-js/15-pages-router-todo
Workbench branch: wizard-ci-dbf5526-next-js-15-pages-router-todo
Wizard branch: release-please--branches--main--components--wizard
Context Mill branch: main
PostHog (MCP) branch: master
Timestamp: 2026-07-28T16:55:01.696Z
Duration: 231.9s

YARA Scanner

✓ 121 tool calls scanned, 0 violations detected

No violations: ✓ 121 clean scans

@wizard-ci-bot

wizard-ci-bot Bot commented Jul 28, 2026

Copy link
Copy Markdown
Author

PR Evaluation Report

Summary

This PR adds PostHog client-side analytics to a Next.js 15 Pages Router todo app via instrumentation-client.ts, capturing three todo CRUD events (todo_created, todo_completion_toggled, todo_deleted) with exception autocapture enabled. The posthog-node server SDK is installed but entirely unused.

Files changed Lines added Lines removed
5 +96 -0

Confidence score: 4/5 👍

  • posthog-node is installed as a dependency but never used anywhere in the PR — unnecessary bloat that adds a server SDK to a client-only integration [MEDIUM]
  • No reverse proxy is configured; client-side posthog-js events are exposed to ad blockers [MEDIUM]
  • todo_deleted event has zero properties — no context about what was deleted (e.g., whether it was completed) [MEDIUM]

File changes

Filename Score Description
instrumentation-client.ts 4/5 Correct Next.js 15 client-side initialization with env vars, exception autocapture, and dev-mode error for missing config
components/todos/todo-list.tsx 3/5 Adds three capture calls for CRUD actions; todo_deleted lacks any properties
package.json 3/5 Adds posthog-js (correct) and posthog-node (unused)
.env.example 5/5 Documents both required PostHog env vars with correct NEXT_PUBLIC_ prefix
posthog-setup-report.md 3/5 Wizard-generated setup report — not a code change

App sanity check ⚠️

Criteria Result Description
App builds and runs Yes Report confirms pnpm build passed successfully
Preserves existing env vars & configs Yes No existing code or configs modified destructively
No syntax or type errors Yes All changed files have valid syntax
Correct imports/exports Yes posthog-js imported correctly in both files
Minimal, focused changes No posthog-node installed but never used; posthog-setup-report.md added unnecessarily
Pre-existing issues None No pre-existing issues detected

Issues

  • Unused posthog-node dependency: posthog-node v5.46.1 is added to package.json but no server-side PostHog code exists in the PR. Remove it to avoid unnecessary dependency bloat. [MEDIUM]

Other completed criteria

  • Environment variables documented in .env.example with correct NEXT_PUBLIC_ prefix
  • Build configuration remains valid with new dependencies

PostHog implementation ⚠️

Criteria Result Description
PostHog SDKs installed Yes posthog-js ^1.407.5 added to package.json
PostHog client initialized Yes posthog.init() in instrumentation-client.ts using correct Next.js pattern with env vars, defaults, and capture_exceptions
capture() Yes Three posthog.capture() calls for todo CRUD operations
identify() N/A App has no authentication or user accounts — no identity to link
Error tracking Yes capture_exceptions: true enables global browser exception autocapture
Reverse proxy No No reverse proxy configured; client-side events are vulnerable to ad blockers

Issues

  • No reverse proxy configured: The integration sends events directly to us.i.posthog.com from the browser. For Next.js, a reverse proxy via Next.js rewrites or Vercel rewrites should be configured to improve event delivery reliability. [MEDIUM]

Other completed criteria

  • API key loaded from NEXT_PUBLIC_POSTHOG_PROJECT_TOKEN environment variable (not hardcoded)
  • API host loaded from NEXT_PUBLIC_POSTHOG_HOST environment variable
  • Conditional initialization guards against missing env vars with helpful dev-mode errors
  • defaults: '2026-01-30' correctly sets SDK defaults

PostHog insights and events ⚠️

Filename PostHog events Description
components/todos/todo-list.tsx todo_created Captures successful todo creation with has_description and initially_completed properties
components/todos/todo-list.tsx todo_completion_toggled Captures completion state change with completed boolean property
components/todos/todo-list.tsx todo_deleted Captures todo deletion with no properties
instrumentation-client.ts captureException (autocapture) Global browser exception autocapture via capture_exceptions: true

Issues

  • todo_deleted lacks properties: The event is captured with no contextual properties. Adding at minimum whether the deleted todo was completed (was_completed) would enable insights like "do users delete completed or incomplete todos more often?" [MEDIUM]

Other completed criteria

  • Events represent real user actions (CRUD operations on todos)
  • Events enable product insights — can build a create→complete→delete funnel
  • No PII in event properties (no todo text, user info, etc.)
  • Event names use consistent snake_case convention and are descriptive of the action

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