Repository navigation
[CI] (8dccaac) next-js/15-pages-router-todo - #2357
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 to produce 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; imports and dependencies are correct |
| Preserves existing env vars & configs | Yes | Existing nextConfig object preserved, rewrites added cleanly |
| No syntax or type errors | Yes | All code is syntactically valid TypeScript |
| 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 | No pre-existing issues observed |
Issues
- No
.env.examplefile: The.env.localis gitignored but there is no.env.exampledocumenting the requiredNEXT_PUBLIC_POSTHOG_PROJECT_TOKENandNEXT_PUBLIC_POSTHOG_HOSTvariables. [MEDIUM]
Other completed criteria
- Build configuration is valid with correct package.json dependencies
- No unrelated changes or gratuitous reformatting
- Code follows existing codebase patterns and conventions
PostHog implementation ⚠️
| Criteria | Result | Description |
|---|---|---|
| PostHog SDKs installed | Yes | posthog-js ^1.396.5 and posthog-node ^5.39.4 added to package.json |
| PostHog client initialized | Yes | Client initialized in instrumentation-client.ts with reverse proxy host; server client via singleton in lib/posthog-server.ts |
| capture() | Yes | Multiple meaningful client-side and server-side capture calls |
| identify() | No | No identify() call anywhere in the codebase. This is a full-stack Next.js app where identify should be implemented |
| Error tracking | Yes | capture_exceptions: true in init config plus manual captureException() calls in 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
- Hardcoded
distinctId: 'anonymous': All three server-side capture calls usedistinctId: 'anonymous', which means every server event is attributed to one fake user. This defeats the purpose of server-side analytics. The code should extract a real identifier from the request (session, cookie, or header). [CRITICAL] - No
identify()orreset()calls: The app has no user identification. Even though this is a simple todo app, a call toidentify()should be present to properly link events to users. [MEDIUM] - API key loaded from env var: Yes, uses
process.env.NEXT_PUBLIC_POSTHOG_PROJECT_TOKEN!— correct pattern. [OK] - Host configured: Client uses
/ingest(reverse proxy), server usesprocess.env.NEXT_PUBLIC_POSTHOG_HOST— correct. [OK]
Other completed criteria
- SDK packages correctly added to dependencies
- Client-side init follows the recommended
instrumentation-client.tspattern for Next.js - Server-side client uses singleton with
flushAt: 1andflushInterval: 0as recommended - Reverse proxy correctly routes both
/static/*and/array/*tous-assets.i.posthog.com skipTrailingSlashRedirect: trueset in next.config.ts as required for proxyui_hostcorrectly set to allow toolbar access through the reverse proxy
PostHog insights and events ⚠️
| Filename | PostHog events | Description |
|---|---|---|
components/todos/todo-list.tsx |
todo_created, todo_completed, todo_reopened, todo_deleted, captureException |
Client-side CRUD events with relevant properties (todo_id, has_description, was_completed); exception tracking in catch blocks |
pages/api/todos/index.ts |
server_todo_created |
Server-side event on POST with todo_id and has_description properties |
pages/api/todos/[id].ts |
server_todo_updated, server_todo_deleted |
Server-side events on PATCH and DELETE with todo_id and completed status |
Issues
- Server events use hardcoded
distinctId: Server-side events withdistinctId: 'anonymous'cannot be linked to any real user, making them useless for per-user analysis or funnels that span client and server. [CRITICAL]
Other completed criteria
- Events represent real user actions (create, complete, reopen, delete todos)
- Events enable product insights — could build funnels (create → complete), retention charts, activity trends
- Events include enriched properties (todo_id, has_description, was_completed, completed status)
- No PII in event properties
- Event names are descriptive and use consistent snake_case naming convention
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:
8dccaacApp:
next-js/15-pages-router-todoApp directory:
apps/next-js/15-pages-router-todoWorkbench branch:
wizard-ci-8dccaac-next-js-15-pages-router-todoWizard branch:
release-please--branches--main--components--wizardContext Mill branch:
mainPostHog (MCP) branch:
masterTimestamp: 2026-07-03T00:36:41.801Z
Duration: 304.9s
YARA Scanner