[CI] (3393d57) next-js/15-app-router-todo#884
Closed
wizard-ci-bot[bot] wants to merge 1 commit intomainfrom
Closed
[CI] (3393d57) next-js/15-app-router-todo#884wizard-ci-bot[bot] wants to merge 1 commit intomainfrom
wizard-ci-bot[bot] wants to merge 1 commit intomainfrom
Conversation
Author
|
Now I have all the information I need to produce the evaluation report. PR Evaluation ReportSummaryThis PR integrates PostHog into a Next.js 15 App Router todo application. It adds both client-side (
Confidence score: 4/5 👍
File changes
App sanity check
|
| Criteria | Result | Description |
|---|---|---|
| App builds and runs | Yes | No syntax errors; valid TypeScript; dependencies correctly added |
| Preserves existing env vars & configs | Yes | Existing code and configs preserved; PostHog additions are additive |
| No syntax or type errors | Yes | All files have valid syntax and types |
| Correct imports/exports | Yes | posthog-js used client-side, posthog-node server-side; correct import paths |
| Minimal, focused changes | Yes | All changes relate to PostHog integration |
| Pre-existing issues | None | No pre-existing issues observed |
Issues
- No
.env.examplecommitted: The.env.localfile exists locally but is gitignored. No.env.exampleor README update documents the required environment variables (NEXT_PUBLIC_POSTHOG_PROJECT_TOKEN,NEXT_PUBLIC_POSTHOG_HOST). New developers cloning the repo won't know what env vars are needed. [MEDIUM]
Other completed criteria
- App builds without errors — valid TypeScript, correct dependency versions
- No existing functionality broken — all additions are additive
- Build configuration is valid —
package.jsonscripts unchanged, dependencies parseable
PostHog implementation ⚠️
| Criteria | Result | Description |
|---|---|---|
| PostHog SDKs installed | Yes | posthog-js@^1.360.2 and posthog-node@^5.28.2 added to package.json |
| PostHog client initialized | Yes | Client initialized in instrumentation-client.ts with env var token, reverse proxy host, capture_exceptions: true, and defaults. Server singleton in lib/posthog-server.ts with flushAt: 1 and flushInterval: 0 |
| capture() | Yes | Client-side: todo_created, todo_completed, todo_reopened, todo_deleted. Server-side: todo_created_api, todo_updated_api, todo_deleted_api |
| identify() | No | No posthog.identify() call anywhere. No posthog.reset() on logout. This is a full-stack Next.js app that would benefit from user identification |
| Error tracking | Yes | capture_exceptions: true in init config for automatic exception capture; posthog.captureException(error) in client-side catch blocks |
| Reverse proxy | Yes | Next.js rewrites configured in next.config.ts proxying /ingest/* to us.i.posthog.com and /ingest/static/* to us-assets.i.posthog.com; api_host: "/ingest" in client init |
Issues
- No
identify()implementation: Noposthog.identify()call exists anywhere in the codebase. The PostHog docs state "Identifying users is required." Without identification, all client-side events are anonymous and cannot be linked to specific users across sessions or devices. [CRITICAL] - Hardcoded
distinctId: 'anonymous'on server: All three server-sideposthog.capture()calls usedistinctId: 'anonymous', which means all server events collapse into a single "anonymous" person in PostHog. Events should use a real user identifier or at minimum forward the PostHog distinct ID from client cookies. [CRITICAL] - Missing
await posthog.shutdown(): Server-side API route handlers do not callawait posthog.shutdown()after capturing events. WhileflushAt: 1should cause immediate flushing, the PostHog Next.js docs explicitly recommend callingshutdown()in short-lived server functions. Events could be lost if the runtime terminates before the flush completes. [MEDIUM] - Non-standard env var name: The env var
NEXT_PUBLIC_POSTHOG_PROJECT_TOKENdiffers from the conventionalNEXT_PUBLIC_POSTHOG_TOKENused in PostHog documentation. While functional, this creates confusion for developers comparing against docs. [LOW]
Other completed criteria
- API key loaded from environment variable (
NEXT_PUBLIC_POSTHOG_PROJECT_TOKEN) — not hardcoded - API host correctly configured — reverse proxy
/ingeston client,NEXT_PUBLIC_POSTHOG_HOSTon server - Reverse proxy correctly set up with Next.js rewrites including static assets path and
skipTrailingSlashRedirect
PostHog insights and events ⚠️
| Filename | PostHog events | Description |
|---|---|---|
components/todos/todo-list.tsx |
todo_created, todo_completed, todo_reopened, todo_deleted, captureException |
Client-side event capture for all CRUD operations in event handlers; exception capture in catch blocks |
app/api/todos/route.ts |
todo_created_api |
Server-side capture when a todo is successfully created via POST |
app/api/todos/[id]/route.ts |
todo_updated_api, todo_deleted_api |
Server-side capture when a todo is updated or deleted via PATCH/DELETE |
instrumentation-client.ts |
capture_exceptions (automatic) |
Automatic exception capture enabled in PostHog init config |
Issues
- Hardcoded
distinctId: 'anonymous'fragments server data: Server-side events all use the samedistinctId, making them useless for per-user analysis. A todo completion funnel mixing client and server events would not work because client events use PostHog's auto-generated anonymous ID while server events all map to a single "anonymous" string. [CRITICAL]
Other completed criteria
- Events represent real user actions — create, complete, reopen, delete map to actual product flows
- Events enable product insights — can build creation trend, completion funnel, deletion rate
- Events include relevant properties —
todo_id,has_description,completedstatus - No PII in event properties — only todo IDs and boolean flags
- Event names are descriptive and consistent —
snake_caseconvention, meaningful names
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:
3393d57App:
next-js/15-app-router-todoApp directory:
apps/next-js/15-app-router-todoWorkbench branch:
wizard-ci-3393d57-next-js-15-app-router-todoWizard branch:
release-please--branches--main--components--wizardContext Mill branch:
mainPostHog (MCP) branch:
masterTimestamp: 2026-03-17T00:18:10.379Z
Duration: 285.6s