Repository navigation
[CI] (359d82a) next-js/15-pages-router-todo - #2457
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 all the information I need to produce the evaluation. PR Evaluation ReportSummaryThis PR integrates PostHog into a Next.js 15 Pages Router todo app, adding both client-side (
Confidence score: 4/5 👍
File changes
App sanity check
|
| Criteria | Result | Description |
|---|---|---|
| App builds and runs | Yes | No syntax errors; all imports resolve to installed packages |
| Preserves existing env vars & configs | Yes | Existing next.config.ts structure preserved; rewrites added cleanly |
| No syntax or type errors | Yes | All TypeScript is valid; ! assertions used appropriately for env vars |
| Correct imports/exports | Yes | posthog-js imported client-side, posthog-node server-side; no cross-environment contamination |
| Minimal, focused changes | Yes | All changes relate to PostHog integration |
| Pre-existing issues | None | Base app appears functional |
Issues
- No
.env.examplefile: The.env.localis gitignored but no.env.exampleis committed to document the required environment variables (NEXT_PUBLIC_POSTHOG_PROJECT_TOKEN,NEXT_PUBLIC_POSTHOG_HOST). The setup report mentions this as a TODO but doesn't resolve it. [MEDIUM]
Other completed criteria
- Build configuration is valid —
package.jsonhas correct dependency entries - All changes are relevant to PostHog integration
- Code follows existing codebase patterns (TypeScript, consistent formatting)
PostHog implementation ⚠️
| Criteria | Result | Description |
|---|---|---|
| PostHog SDKs installed | Yes | posthog-js@^1.398.2 and posthog-node@^5.40.0 added to package.json |
| PostHog client initialized | Yes | instrumentation-client.ts calls posthog.init() with env var token and /ingest proxy host — correct Next.js 15 pattern |
| capture() | Yes | Client: todo_created, todo_completed, todo_uncompleted, todo_deleted. Server: server_todo_created, server_todo_updated, server_todo_deleted |
| identify() | No | No posthog.identify() or posthog.reset() calls anywhere. The docs state "Identifying users is required." |
| Error tracking | Yes | capture_exceptions: true in init config, plus manual posthog.captureException(error) in catch blocks |
| Reverse proxy | Yes | Next.js rewrites correctly proxy /ingest/* to us.i.posthog.com and /ingest/static/*, /ingest/array/* to us-assets.i.posthog.com |
Issues
- No user identification: There are zero calls to
posthog.identify()orposthog.reset()in the entire codebase. Per PostHog docs, "Identifying users is required" to connect frontend events, session replays, and error tracking to the same person. Without this, all analytics are anonymous. [CRITICAL] - Server-side fallback to
'anonymous'string: When noX-POSTHOG-DISTINCT-IDheader is present, the server code uses the literal string'anonymous'asdistinctId. This merges all unauthenticated requests into a single PostHog person, corrupting data. It should either use the anonymous distinct_id from the header or skip server capture. [MEDIUM] - No
shutdown()on server-side client: The singletonposthog-nodeclient is never shut down after API route handling. The docs recommendawait posthog.shutdown()to ensure all events are flushed. WithflushAt: 1the events likely flush immediately, but this is not guaranteed. [MEDIUM]
Other completed criteria
- API key loaded from
NEXT_PUBLIC_POSTHOG_PROJECT_TOKENenvironment variable (not hardcoded) - Host correctly configured via
/ingestreverse proxy withui_hostset tohttps://us.posthog.com - Both client and server SDKs correctly installed and initialized in appropriate contexts
- Tracing headers (
X-POSTHOG-DISTINCT-ID,X-POSTHOG-SESSION-ID) manually passed from client to server for session correlation
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 actions with todo_id and has_description properties. Exception capture in all error handlers. |
pages/api/todos/index.ts |
server_todo_created |
Server-side creation event with todo_id and has_description properties |
pages/api/todos/[id].ts |
server_todo_updated, server_todo_deleted |
Server-side update/delete events with todo_id and completed status |
Issues
- No issues with event quality — events are well-named, map to real user actions, and include relevant properties.
Other completed criteria
- Events represent real user actions (create, complete, uncomplete, delete todos)
- Events enable product insights — can build create→complete funnels, deletion trends, completion rates
- Events include relevant properties (
todo_id,has_description,completed) - 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: wizard-pr
Trigger ID:
359d82aApp:
next-js/15-pages-router-todoApp directory:
apps/next-js/15-pages-router-todoWorkbench branch:
wizard-ci-359d82a-next-js-15-pages-router-todoWizard branch:
chore/bump-warlock-0.2.3Context Mill branch:
mainPostHog (MCP) branch:
masterTimestamp: 2026-07-07T20:21:36.748Z
Duration: 436.7s
YARA Scanner