[CI] (d819646) next-js/15-app-router-todo#1494
Closed
wizard-ci-bot[bot] wants to merge 1 commit into
Closed
Conversation
Author
PR Evaluation ReportSummaryThis PR integrates PostHog into a Next.js 15 App 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 correctly |
| Preserves existing env vars & configs | Yes | Existing next.config.ts structure preserved, only PostHog additions |
| No syntax or type errors | Yes | TypeScript is valid across all changed files |
| Correct imports/exports | Yes | posthog-js on client, posthog-node on server — correct separation |
| Minimal, focused changes | Yes | All changes are PostHog-related |
| Pre-existing issues | None | Base app appears functional |
Issues
- No
.env.examplefile: The required environment variables (NEXT_PUBLIC_POSTHOG_PROJECT_TOKEN,NEXT_PUBLIC_POSTHOG_HOST) are not documented for other developers or CI/CD setup. [MEDIUM]
Other completed criteria
- All changes are PostHog-related with no unrelated modifications
- Correct files modified for Next.js app router pattern
- Code follows existing codebase conventions (TypeScript, consistent formatting)
- Build configuration (package.json) is valid with correct dependency additions
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 the recommended Next.js 15.3+ pattern; server singleton in lib/posthog-server.ts |
| capture() | Yes | Client: todo_created, todo_completed, todo_uncompleted, todo_deleted. Server: todo_created, todo_updated, todo_deleted |
| identify() | No | No posthog.identify() call anywhere in the codebase. Users are never linked to events. |
| Error tracking | Yes | capture_exceptions: true in init config + manual posthog.captureException(error) in catch blocks |
| 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()implementation: There is noposthog.identify()call anywhere in the app. The docs state "Identifying users is required" — without it, all client events are anonymous and cannot be linked to specific users. This should be called on login/session load. [CRITICAL] - Hardcoded
distinctId: 'server'on server-side captures: All three server-sideposthog.capture()calls usedistinctId: 'server', meaning every server event is attributed to one fake "user". This produces meaningless analytics. The server should extract a real user identifier from the request (e.g., session cookie, auth token). [CRITICAL] - No
await posthog.shutdown()in API routes: Per the Next.js PostHog docs, server-side routes should callawait posthog.shutdown()to flush queued events. Without this, events may be lost in short-lived serverless functions. [MEDIUM]
Other completed criteria
- API key loaded from environment variable (
process.env.NEXT_PUBLIC_POSTHOG_PROJECT_TOKEN) - Host correctly configured (reverse proxy
/ingestfor client, env var for server) - Server-side client uses correct
flushAt: 1andflushInterval: 0settings - Reverse proxy routes both
/static/*and/array/*to the assets origin
PostHog insights and events ⚠️
| Filename | PostHog events | Description |
|---|---|---|
components/todos/todo-list.tsx |
todo_created, todo_completed, todo_uncompleted, todo_deleted, captureException |
Client-side tracking of all todo CRUD actions with properties (todo_id, has_description); exception capture on API failures |
app/api/todos/route.ts |
todo_created |
Server-side capture when a todo is persisted, includes todo_id and has_description |
app/api/todos/[id]/route.ts |
todo_updated, todo_deleted |
Server-side capture on update (with completed status) and delete |
Issues
- Hardcoded
distinctId: 'server'prevents product insights: Since all server events use the same fake distinct ID, they cannot be used in funnels, retention charts, or user-level analysis. Server events are effectively useless for product analytics. [CRITICAL] - Duplicate event names across client and server without differentiation:
todo_createdandtodo_deletedare captured on both client and server with the same event name. While the server events includesource: 'api', this could lead to double-counting in insights if not carefully filtered. [LOW]
Other completed criteria
- Events represent real user actions (create, complete, uncomplete, delete todos)
- Events could enable product insights (creation trends, completion funnels) if identify were implemented
- Events include relevant properties (todo_id, has_description, completed status)
- No PII in event properties
- Event names are descriptive and use consistent snake_case 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: manual
Trigger ID:
d819646App:
next-js/15-app-router-todoApp directory:
apps/next-js/15-app-router-todoWorkbench branch:
wizard-ci-d819646-next-js-15-app-router-todoWizard branch:
mainContext Mill branch:
mainPostHog (MCP) branch:
masterTimestamp: 2026-05-14T16:35:32.399Z
Duration: 274.9s