[CI] (d819646) next-js/15-pages-router-todo#1495
Closed
wizard-ci-bot[bot] wants to merge 1 commit into
Closed
Conversation
Author
|
Now I have all the information needed. Let me compile the evaluation. PR Evaluation ReportSummaryThis PR integrates PostHog into a Next.js 15 Pages Router todo application. It adds client-side initialization via
Confidence score: 4/5 👍
File changes
App sanity check
|
| Criteria | Result | Description |
|---|---|---|
| App builds and runs | Yes | No syntax errors; all imports resolve; dependencies added correctly |
| Preserves existing env vars & configs | Yes | Only additions to existing configs; no deletions |
| No syntax or type errors | Yes | TypeScript is valid throughout |
| Correct imports/exports | Yes | posthog-js used client-side, posthog-node server-side; correct package separation |
| Minimal, focused changes | Yes | All changes relate strictly to PostHog integration |
| Pre-existing issues | None | Base app appears well-structured |
Issues
- No
.env.examplecommitted: The.env.localis gitignored but no.env.exampleexists to document required variables (NEXT_PUBLIC_POSTHOG_PROJECT_TOKEN,NEXT_PUBLIC_POSTHOG_HOST). The setup report mentions them but is non-standard. [MEDIUM]
Other completed criteria
- Build configuration is valid with proper
next.config.tsrewrites - All imports resolve to correct packages
- No existing functionality broken
PostHog implementation ⚠️
| Criteria | Result | Description |
|---|---|---|
| PostHog SDKs installed | Yes | posthog-js@^1.373.4 and posthog-node@^5.34.1 in package.json |
| PostHog client initialized | Yes | instrumentation-client.ts uses posthog.init() with env var token, reverse proxy host, defaults, capture_exceptions, and debug mode |
| capture() | Yes | 4 client-side captures (todo_created, todo_completed, todo_uncompleted, todo_deleted) and matching server-side captures |
| identify() | No | No posthog.identify() call exists anywhere in the app |
| Error tracking | Yes | capture_exceptions: true set in init config |
| Reverse proxy | Yes | Next.js rewrites in next.config.ts correctly route /ingest/static/* and /ingest/array/* to us-assets.i.posthog.com and /ingest/* to us.i.posthog.com |
Issues
- No identify() call: No
posthog.identify()is called anywhere. Users are never linked to known identities, making all analytics anonymous. This should be added at login or page load when the user is authenticated. [CRITICAL] - Server-side events always anonymous: The server-side API routes read
x-posthog-distinct-idandx-posthog-session-idfrom request headers, but the client-sidefetch()calls intodo-list.tsxnever send these headers. Additionally,__add_tracing_headersis not configured inposthog.init(). All server-side events will havedistinctId: 'anonymous', collapsing all server events into a single user. [CRITICAL]
Other completed criteria
- API key loaded from
process.env.NEXT_PUBLIC_POSTHOG_PROJECT_TOKEN(not hardcoded) - Host correctly configured through reverse proxy (
/ingest→us.i.posthog.com) - Reverse proxy includes both
/static/*and/array/*asset routes tous-assets.i.posthog.com skipTrailingSlashRedirect: truecorrectly set for proxy compatibility- Server-side client uses singleton pattern with
flushAt: 1for immediate flushing
PostHog insights and events ⚠️
| Filename | PostHog events | Description |
|---|---|---|
components/todos/todo-list.tsx |
todo_created, todo_completed, todo_uncompleted, todo_deleted |
Client-side captures in event handlers for all CRUD operations with todo_id and has_description properties |
pages/api/todos/index.ts |
todo_created |
Server-side capture on POST with todo_id, has_description, and session ID |
pages/api/todos/[id].ts |
todo_completed, todo_uncompleted, todo_deleted |
Server-side captures on PATCH/DELETE with todo_id and session ID |
instrumentation-client.ts |
capturedException (via capture_exceptions: true) |
Automatic exception capture for unhandled errors |
Issues
- Duplicate client/server events without correlation: The same events (
todo_created,todo_completed, etc.) are captured on both client and server. Without tracing headers linking them, this creates duplicate uncorrelated events. Either send tracing headers or remove server-side duplicates. [MEDIUM]
Other completed criteria
- Events represent real user actions (creating, completing, deleting todos)
- Events enable product insights (can build creation trends, completion funnels, deletion rates)
- Events include relevant properties (
todo_id,has_description) - No PII in event properties
- Event names are descriptive and use consistent
snake_caseconvention
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: manual
Trigger ID:
d819646App:
next-js/15-pages-router-todoApp directory:
apps/next-js/15-pages-router-todoWorkbench branch:
wizard-ci-d819646-next-js-15-pages-router-todoWizard branch:
mainContext Mill branch:
mainPostHog (MCP) branch:
masterTimestamp: 2026-05-14T16:35:58.856Z
Duration: 273.4s