Repository navigation
[CI] (0ae2102) next-js/15-app-router-todo - #1226
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 needed to write the evaluation. The app is a Next.js 15 App Router todo app with no authentication. Let me produce the review. PR Evaluation ReportSummaryThis PR integrates PostHog into a Next.js 15 App Router todo application by adding 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, correct imports |
| Preserves existing env vars & configs | Yes | Only PostHog additions to existing files, no existing code removed |
| No syntax or type errors | Yes | All TypeScript is valid, imports resolve correctly |
| 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 functional |
Issues
- No
.env.examplefile: Environment variablesNEXT_PUBLIC_POSTHOG_PROJECT_TOKENandNEXT_PUBLIC_POSTHOG_HOSTare not documented in any committed file. While.env.localexists locally, it's gitignored. New developers won't know what variables to set. [MEDIUM] - Missing
await posthog.shutdown(): The server-side API routes create/use the PostHog client but never callawait posthog.shutdown(). The Next.js docs specifically recommend calling shutdown in short-lived serverless functions to ensure events are flushed. Since the client is a singleton, events may eventually flush, but there's no guarantee in serverless environments. [LOW]
Other completed criteria
- Build configuration is valid —
package.jsonhas correct dependency entries - Code follows existing codebase patterns — naming, structure, and indentation match surrounding code
- No unnecessary modifications — all changes are PostHog-related
PostHog implementation ✅
| Criteria | Result | Description |
|---|---|---|
| PostHog SDKs installed | Yes | posthog-js@^1.369.0 and posthog-node@^5.29.2 in package.json |
| PostHog client initialized | Yes | Client via instrumentation-client.ts (correct Next.js 15.3+ pattern), server via lib/posthog-server.ts singleton |
| capture() | Yes | Multiple meaningful captures: todo_created, todo_completed, todo_reopened, todo_deleted, todo_updated on both client and server |
| identify() | N/A | App has no authentication — no user accounts, login, or session management |
| Error tracking | Yes | capture_exceptions: true in init config for automatic exception capture, plus manual posthog.captureException(error) in catch blocks |
| Reverse proxy | Yes | Next.js rewrites in next.config.ts routing /ingest/* → https://us.i.posthog.com/* and /ingest/static/* → https://us-assets.i.posthog.com/static/* |
Issues
- Duplicate client/server events with same names:
todo_created,todo_deletedare captured on both client and server with the same event name. This will cause double-counting in PostHog dashboards. Either remove server-side duplicates or use distinct names (e.g.,server_todo_created). [MEDIUM]
Other completed criteria
- API key loaded from environment variable
NEXT_PUBLIC_POSTHOG_PROJECT_TOKEN— not hardcoded - API host correctly configured — client uses
/ingest(reverse proxy), server uses env varNEXT_PUBLIC_POSTHOG_HOST - Server-side client uses
flushAt: 1andflushInterval: 0for serverless compatibility - PostHog identity headers (
x-posthog-distinct-id,x-posthog-session-id) 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_reopened, todo_deleted, captureException |
Client-side tracking of all CRUD operations with properties (todo_id, has_description), plus exception capture in all catch blocks |
app/api/todos/route.ts |
todo_created |
Server-side capture on POST with todo_id, has_description, `` |
app/api/todos/[id]/route.ts |
todo_updated, todo_deleted |
Server-side capture on PATCH/DELETE with todo_id, completed status, `` |
Issues
- Duplicate event names across client and server: The same action triggers events with the same name on both client and server, which inflates counts in dashboards. [MEDIUM]
Other completed criteria
- Events represent real user actions — creating, completing, reopening, and deleting todos map directly to product usage
- Events enable product insights — can build todo creation trends, completion funnels (created → completed), deletion rates
- Events include relevant properties —
todo_id,has_description,completedstatus provide meaningful context - No PII in event properties — only IDs and boolean flags
- Event names are descriptive and consistent — snake_case convention, action-based naming
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:
0ae2102App:
next-js/15-app-router-todoApp directory:
apps/next-js/15-app-router-todoWorkbench branch:
wizard-ci-0ae2102-next-js-15-app-router-todoWizard branch:
release-please--branches--main--components--wizardContext Mill branch:
mainPostHog (MCP) branch:
masterTimestamp: 2026-04-15T19:18:45.475Z
Duration: 402.3s