Repository navigation
[CI] (a5131dd) next-js/15-pages-router-todo - #2473
Closed
wizard-ci-bot[bot] wants to merge 1 commit into
Closed
wizard-ci-bot[bot] wants to merge 1 commit into
wizard-ci-bot[bot] wants to merge 1 commit into
Conversation
Author
|
Now I have enough context. Let me produce the evaluation. PR Evaluation ReportSummaryThis PR integrates PostHog into a Next.js 15 Pages Router todo application, adding both client-side (
Confidence score: 4/5 👍
File changes
App sanity check
|
| Criteria | Result | Description |
|---|---|---|
| App builds and runs | Yes | No syntax errors; imports are valid, TypeScript is correct |
| Preserves existing env vars & configs | Yes | Only adds PostHog-related rewrites and dependencies |
| No syntax or type errors | Yes | All files are syntactically valid TypeScript |
| Correct imports/exports | Yes | posthog-js imported client-side, posthog-node server-side — correct separation |
| Minimal, focused changes | Yes | All changes are PostHog-related |
| Pre-existing issues | None | Base app appears clean |
Issues
- No
.env.examplefile: Required environment variables (NEXT_PUBLIC_POSTHOG_PROJECT_TOKEN,NEXT_PUBLIC_POSTHOG_HOST) are not documented in any committed file. New developers won't know what to set. [MEDIUM]
Other completed criteria
- All imports resolve correctly —
posthog-json client,posthog-nodeon server - Dependencies added to
package.jsonwith appropriate version ranges - Build configuration (next.config.ts) is valid with proper rewrite rules
- Existing app code and functionality preserved
PostHog implementation ⚠️
| Criteria | Result | Description |
|---|---|---|
| PostHog SDKs installed | Yes | posthog-js ^1.398.2 and posthog-node ^5.40.0 in package.json |
| PostHog client initialized | Yes | Correctly initialized in instrumentation-client.ts using the Next.js 15.3+ pattern |
| capture() | Yes | Multiple meaningful capture calls for todo CRUD operations on both client and server |
| identify() | No | No posthog.identify() call anywhere — no user identification implemented |
| Error tracking | Yes | capture_exceptions: true in init config + manual posthog.captureException() in all catch blocks |
| Reverse proxy | Yes | Properly configured via Next.js rewrites with /ingest/* routing to us.i.posthog.com and us-assets.i.posthog.com |
Issues
- No user identification:
posthog.identify()is never called. The PostHog docs explicitly state this is required for linking frontend captures, session replays, and error tracking to known users. The app should callidentify()when a user is known (e.g., on login/app load). [CRITICAL] - Server-side distinct_id fallback to
'anonymous': Whenx-posthog-distinct-idheader is missing, the code falls back to the hardcoded string'anonymous', which will merge all unauthenticated server events into a single person. This creates fragmented/merged data. [MEDIUM] - No
posthog.shutdown()in API routes: Server-side capture calls don't awaitshutdown(). The docs warn: "Make sure to always callawait client.shutdown()after sending events from the server-side." With the singleton pattern,shutdown()should be called per-request orawait posthog.flush()should be used instead. [MEDIUM]
Other completed criteria
- API key loaded from
NEXT_PUBLIC_POSTHOG_PROJECT_TOKENenvironment variable — not hardcoded - Host configured correctly pointing to
us.i.posthog.comvia reverse proxy - Reverse proxy correctly routes
/ingest/static/*and/ingest/array/*tous-assets.i.posthog.com - Client initialization follows the recommended
instrumentation-client.tspattern for Next.js 15.3+ - Server-side client uses correct singleton pattern with
flushAt: 1andflushInterval: 0
PostHog insights and events ✅
| Filename | PostHog events | Description |
|---|---|---|
components/todos/todo-list.tsx |
todo_created, todo_completed, todo_uncompleted, todo_deleted, captureException |
Client-side CRUD events with properties (has_description, was_completed); exception tracking in all catch blocks |
pages/api/todos/index.ts |
server_todo_created |
Server-side event on successful POST with has_description property |
pages/api/todos/[id].ts |
server_todo_updated, server_todo_deleted |
Server-side events on successful PATCH and DELETE with completed property |
Issues
No critical issues with event quality.
Other completed criteria
- Events represent real user actions (create, complete, uncomplete, delete todos)
- Events enable product insights — can build a create→complete funnel, track deletion patterns
- Events include relevant properties (
has_description,was_completed,completed) - No PII in event properties — only boolean flags and completion status
- Event names are descriptive, consistent snake_case (
todo_created,server_todo_updated, etc.)
Reviewed by wizard workbench PR evaluator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Automated wizard CI run
Source: wizard-pr
Trigger ID:
a5131ddApp:
next-js/15-pages-router-todoApp directory:
apps/next-js/15-pages-router-todoWorkbench branch:
wizard-ci-a5131dd-next-js-15-pages-router-todoWizard branch:
fix/warlock-smoke-test-remove-killswitchContext Mill branch:
mainPostHog (MCP) branch:
masterTimestamp: 2026-07-07T21:45:40.097Z
Duration: 401.0s
YARA Scanner