Repository navigation
[CI] (359d82a) next-js/15-app-router-todo - #2459
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 everything I need to evaluate this PR. 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, valid TypeScript, all imports resolve |
| Preserves existing env vars & configs | Yes | Existing app logic preserved; only PostHog additions made |
| No syntax or type errors | Yes | All code is syntactically valid |
| Correct imports/exports | Yes | posthog-js on client, posthog-node on server — 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 example file. New contributors won't know what to set. [MEDIUM]
Other completed criteria
- Build configuration is valid —
package.jsonscripts intact, new dependencies properly added - Existing functionality preserved — todo CRUD operations unchanged, PostHog additions are additive
PostHog implementation ⚠️
| Criteria | Result | Description |
|---|---|---|
| PostHog SDKs installed | Yes | posthog-js ^1.398.2 and posthog-node ^5.40.0 in package.json |
| PostHog client initialized | Yes | instrumentation-client.ts uses posthog.init() with env var token and /ingest reverse proxy host — correct Next.js 15.3+ pattern |
| capture() | Yes | Multiple meaningful capture() calls on both client and server for todo CRUD operations |
| identify() | No | No posthog.identify() call anywhere in the codebase. Server-side routes fall back to 'anonymous' string as distinctId, which merges all unauthenticated users into one person |
| Error tracking | Yes | capture_exceptions: true enabled in init config; posthog.captureException(error) called in catch blocks |
| Reverse proxy | Yes | Next.js rewrites correctly route /ingest/static/* and /ingest/array/* to us-assets.i.posthog.com and /ingest/* to us.i.posthog.com |
Issues
- No identify() implementation: No
posthog.identify()is called anywhere. The docs state "Identifying users is required." While this todo app may lack auth, the server-side fallback to the hardcoded string'anonymous'asdistinctIdwill cause all unauthenticated server events to be attributed to one person, creating data quality issues. Even without auth, the clientposthog.get_distinct_id()header should be used exclusively (and is — but the?? 'anonymous'fallback is problematic). [CRITICAL] - No
posthog.shutdown()in API routes: Per the Next.js docs, server-side functions can be short-lived. The singleton pattern withflushAt: 1partially mitigates this, butshutdown()should still be called. Events could be lost in serverless/edge environments. [MEDIUM] ui_hostuses wrong domain:ui_hostis set to'https://us.posthog.com'but should be'https://us.posthog.com'— actually this is correct for the PostHog UI. No issue. [LOW]
Other completed criteria
- API key loaded from
NEXT_PUBLIC_POSTHOG_PROJECT_TOKENenvironment variable — not hardcoded in source - API host correctly configured via reverse proxy at
/ingest - Both client and server SDKs properly separated —
posthog-jsonly in client components,posthog-nodeonly in server code - Reverse proxy correctly routes both
/ingest/static/*and/ingest/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 captures for all CRUD operations with todo_id and has_description properties. Exception tracking in all catch blocks. |
app/api/todos/route.ts |
todo_created |
Server-side capture with todo_id, has_description, and `` properties |
app/api/todos/[id]/route.ts |
todo_updated, todo_deleted |
Server-side captures with todo_id, completed status, and `` properties |
instrumentation-client.ts |
autocapture, captureException (global) |
capture_exceptions: true enables global exception autocapture |
Issues
- Duplicate events on client and server:
todo_createdandtodo_deletedare captured on both client and server for the same action. This leads to double-counting in funnels and trends. Typically, you'd capture on one side or the other, not both. [MEDIUM]
Other completed criteria
- Events represent real user actions — creating, completing, uncompleting, and deleting todos map to actual product flows
- Events enable product insights — can build a create→complete funnel, track task churn (deletions vs creations), measure completion rates
- Events include relevant properties —
todo_id,has_description,completedstatus provide context - No PII in event properties — only IDs and boolean flags
- Event names are descriptive and consistent — snake_case convention used throughout (
todo_created,todo_completed, etc.)
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-app-router-todoApp directory:
apps/next-js/15-app-router-todoWorkbench branch:
wizard-ci-359d82a-next-js-15-app-router-todoWizard branch:
chore/bump-warlock-0.2.3Context Mill branch:
mainPostHog (MCP) branch:
masterTimestamp: 2026-07-07T20:22:47.584Z
Duration: 524.7s
YARA Scanner