Skip to content

[CI] (9da603e) next-js/15-pages-router-todo - #4398

Closed
wizard-ci-bot[bot] wants to merge 1 commit into
mainfrom
wizard-ci-9da603e-next-js-15-pages-router-todo
Closed

wizard-ci-bot[bot] wants to merge 1 commit into
mainfrom
wizard-ci-9da603e-next-js-15-pages-router-todo

Conversation

@wizard-ci-bot

@wizard-ci-bot wizard-ci-bot Bot commented Oct 6, 2026

Copy link
Copy Markdown

Automated wizard CI run

Source: wizard-pr
Trigger ID: 9da603e
App: next-js/15-pages-router-todo
App directory: apps/next-js/15-pages-router-todo
Workbench branch: wizard-ci-9da603e-next-js-15-pages-router-todo
Wizard branch: release-please--branches--main--components--wizard
Context Mill branch: main
PostHog (MCP) branch: master
Timestamp: 2026-10-06T15:54:11.080Z
Duration: 378.8s

YARA Scanner

✓ 151 tool calls scanned, 0 violations detected

No violations: ✓ 151 clean scans

@wizard-ci-bot

wizard-ci-bot Bot commented Oct 6, 2026

Copy link
Copy Markdown
Author

Good — the OTel packages resolved successfully. Now let me finalize my review.


PR Evaluation Report

Summary

This PR integrates PostHog into a Next.js 15 Pages Router todo app. It adds client-side initialization via instrumentation-client.ts, custom event captures for todo CRUD operations, an error boundary with captureException, and server-side OpenTelemetry log exports to PostHog. No user identification or reverse proxy is configured, and no posthog-node SDK is used for server-side event capture.

Files changed Lines added Lines removed
10 +170 -3

Confidence score: 4/5 👍

  • No user identification: No posthog.identify() call anywhere in the app. Events cannot be attributed to specific users, breaking funnels, retention, and session replay linkage. [CRITICAL]
  • No reverse proxy configured: Client-side PostHog requests go directly to us.i.posthog.com, making them susceptible to ad blockers. [MEDIUM]
  • No posthog-node for server-side capture: Server-side API routes use OpenTelemetry log emitters instead of posthog-node capture(). While OTel logs work, there are no proper server-side PostHog events, missing the standard pattern for full-stack Next.js apps. [MEDIUM]

File changes

Filename Score Description
instrumentation-client.ts 4/5 Client-side PostHog init with env vars, exception capture, and debug mode. Uses older defaults: '2026-01-30' instead of latest '2026-05-30'.
instrumentation.ts 3/5 OpenTelemetry log exporter setup for server-side logging. Adds 4 OTel dependencies instead of using posthog-node.
components/ErrorBoundary.tsx 4/5 Custom React error boundary with posthog.captureException(). Works but could use the PostHogErrorBoundary from @posthog/react.
components/todos/todo-list.tsx 4/5 Adds capture calls for todo CRUD in event handlers (correct pattern).
pages/_app.tsx 5/5 Wraps app with ErrorBoundary — clean, minimal change.
pages/api/todos/[id].ts 3/5 Adds OTel log emissions for update/delete. Not standard PostHog capture.
pages/api/todos/index.ts 3/5 Adds OTel log emission for create. Not standard PostHog capture.
package.json 3/5 Adds posthog-js ✓ but also 4 OTel packages for what could be done with posthog-node alone.
.env.example 5/5 Documents required env vars.
.gitignore 5/5 Excludes .env.local.

App sanity check ⚠️

Criteria Result Description
App builds and runs Yes All dependencies resolve; syntax is valid
Preserves existing env vars & configs Yes Existing app code unchanged except wrapping with ErrorBoundary
No syntax or type errors Yes TypeScript types correct, async handlers properly updated
Correct imports/exports Yes All imports resolve to correct packages
Minimal, focused changes No OTel log infrastructure adds 4 extra dependencies and ~50 lines when posthog-node would have been simpler and more aligned
Pre-existing issues None Base app is clean

Issues

  • Excessive OTel complexity: Instead of using posthog-node (the standard server-side SDK for Next.js), the PR adds 4 OpenTelemetry packages and ~50 lines of OTel log exporter boilerplate. The docs recommend posthog-node with flushAt: 1 for server-side captures in Next.js. [MEDIUM]

Other completed criteria

  • Environment variables documented in .env.example
  • .env.local added to .gitignore
  • Build config (package.json) has valid structure and all packages resolve

PostHog implementation ⚠️

Criteria Result Description
PostHog SDKs installed Yes posthog-js: ^1.438.1 added to dependencies
PostHog client initialized Yes instrumentation-client.ts calls posthog.init() with env vars — correct Next.js pattern
capture() Yes Three client-side posthog.capture() calls for todo CRUD
identify() No No posthog.identify() call anywhere; no posthog.reset() on logout
Error tracking Yes Custom ErrorBoundary with captureException() + capture_exceptions: true in init
Reverse proxy No No reverse proxy or Next.js rewrites configured

Issues

  • Missing user identification: No posthog.identify() is called anywhere in the app. All events are anonymous, preventing user attribution across sessions, breaking person profiles, and making session replays unlinkable. Add posthog.identify(userId, { email, name }) after login and posthog.reset() on logout. [CRITICAL]
  • No reverse proxy: Client-side requests go directly to us.i.posthog.com. Configure Next.js rewrites or the managed reverse proxy to prevent ad-blocker interception. [MEDIUM]
  • Older defaults date: defaults: '2026-01-30' is used instead of the latest '2026-05-30', missing newer default configuration improvements. [LOW]

Other completed criteria

  • API key loaded from NEXT_PUBLIC_POSTHOG_KEY environment variable (not hardcoded)
  • API host configured via NEXT_PUBLIC_POSTHOG_HOST environment variable
  • capture_exceptions: true enables automatic exception autocapture
  • Custom ErrorBoundary correctly calls posthog.captureException(error) with component stack

PostHog insights and events ⚠️

Filename PostHog events Description
components/todos/todo-list.tsx todo_created, todo_completion_changed, todo_deleted Client-side captures for todo CRUD actions in event handlers
components/ErrorBoundary.tsx captureException Captures React component errors with component stack
instrumentation-client.ts autocapture, capture_exceptions Enables autocapture and automatic exception tracking
pages/api/todos/[id].ts OTel log: Todo completion updated, Todo deleted Server-side OTel log emissions (not PostHog events)
pages/api/todos/index.ts OTel log: Todo created Server-side OTel log emission (not PostHog event)

Issues

  • todo_deleted has no properties: The todo_deleted event is captured without any properties, missing useful context like completion status at time of deletion. [LOW]

Other completed criteria

  • Events represent real user actions (create, complete, delete todos)
  • Events enable product insights — can build create→complete→delete funnel
  • todo_created includes has_description; todo_completion_changed includes completed status
  • No PII in event properties
  • Event names use consistent snake_case convention and describe the action

Reviewed by wizard workbench PR evaluator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants