[CI] (6fb03e7) next-js/15-pages-router-todo#1476
Closed
wizard-ci-bot[bot] wants to merge 1 commit into
Closed
Conversation
Author
|
Now I have all the context needed. Let me produce the evaluation. PR Evaluation ReportSummaryThis PR integrates PostHog into a Next.js 15 Pages Router todo app. 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; valid TypeScript, correct imports |
| Preserves existing env vars & configs | Yes | Only adds PostHog-related config; existing nextConfig preserved |
| No syntax or type errors | Yes | All code is syntactically valid |
| Correct imports/exports | Yes | posthog-js imported client-side, posthog-node server-side — correct separation |
| Minimal, focused changes | Yes | All changes relate to PostHog integration |
| Pre-existing issues | None | Base app appears clean |
Issues
- Environment variables not documented:
.env.localis gitignored and no.env.exampleis committed. Developers cloning the repo won't know to setNEXT_PUBLIC_POSTHOG_KEYandNEXT_PUBLIC_POSTHOG_HOST. [MEDIUM]
Other completed criteria
- Build configuration is valid —
package.jsonscripts are standard Next.js - All imports resolve to correct packages
- No unrelated modifications or reformatting
PostHog implementation ⚠️
| Criteria | Result | Description |
|---|---|---|
| PostHog SDKs installed | Yes | posthog-js@^1.373.4 and posthog-node@^5.34.1 added to package.json |
| PostHog client initialized | Yes | instrumentation-client.ts uses the recommended Next.js 15.3+ pattern with posthog.init() |
| capture() | Yes | 4 client-side captures (todo_created, todo_completed, todo_uncompleted, todo_deleted) + 2 server-side captures |
| identify() | No | No posthog.identify() or posthog.reset() calls anywhere. This is a full-stack app where user identification should be implemented |
| Error tracking | Yes | capture_exceptions: true in init config + manual posthog.captureException(error) in 3 catch blocks |
| Reverse proxy | Yes | Properly configured via Next.js rewrites: /ingest/static/* and /ingest/array/* → us-assets.i.posthog.com, /ingest/* → us.i.posthog.com |
Issues
- No identify() implementation: No
posthog.identify()call exists. Even though the todo app may lack authentication, the integration is incomplete without user identification. At minimum, a comment or stub should indicate where to add it. [MEDIUM] - Server-side shutdown() never called: The
shutdownPostHog()helper exists inposthog-server.tsbut is never invoked in the API routes. In serverless/edge environments, events may be dropped because the queue isn't flushed before the function terminates. [MEDIUM] - API key loaded from env var: Uses
process.env.NEXT_PUBLIC_POSTHOG_KEY!— correct pattern with non-null assertion. Host is also from env var on the server side. [OK]
Other completed criteria
- API host correctly configured via reverse proxy (
/ingest) on client and direct host on server defaults: '2026-01-30'correctly set in initskipTrailingSlashRedirect: trueset in next.config.ts for reverse proxy compatibility- Server-side client uses singleton pattern appropriate for Pages Router API routes
- Session ID correlation via
X-POSTHOG-SESSION-IDheader on server-side captures
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 (todo_id, has_description); exception tracking in catch blocks |
pages/api/todos/index.ts |
todo_created |
Server-side creation event with todo_id, has_description, `` |
pages/api/todos/[id].ts |
todo_deleted |
Server-side deletion event with todo_id, `` |
Issues
- No issues with event quality — events are well-named, represent real user actions, and include relevant properties without PII.
Other completed criteria
- Events represent real user actions (create, complete, uncomplete, delete todos)
- Events enable product insights — can build creation trends, completion funnels, deletion rate analysis
- Events include relevant properties (
todo_id,has_description) for filtering and breakdown - No PII in event properties
- Consistent snake_case naming convention
- Both client-side and server-side events for key actions provides redundancy
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: scheduled
Trigger ID:
6fb03e7App:
next-js/15-pages-router-todoApp directory:
apps/next-js/15-pages-router-todoWorkbench branch:
wizard-ci-6fb03e7-next-js-15-pages-router-todoWizard branch:
mainContext Mill branch:
mainPostHog (MCP) branch:
masterTimestamp: 2026-05-13T17:26:47.400Z
Duration: 355.8s