Repository navigation
[CI] (624abe2) next-js/15-app-router-saas - #4461
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 context I need. Let me produce the evaluation report. PR Evaluation ReportSummaryThis PR integrates PostHog into a Next.js 15 App Router SaaS application. Client-side setup uses
Confidence score: 5/5 🧙
File changes
App sanity check
|
| Criteria | Result | Description |
|---|---|---|
| App builds and runs | Yes | Syntax is valid, imports resolve, Next.js 15 after() API used correctly |
| Preserves existing env vars & configs | Yes | Existing .env.example entries and next.config.ts preserved |
| No syntax or type errors | Yes | All files have valid TypeScript/TSX syntax |
| Correct imports/exports | Yes | posthog-js imported correctly in client components; @/instrumentation exports used in route |
| Minimal, focused changes | Yes | All changes are PostHog-related, though the OTLP approach is more complex than needed |
| Pre-existing issues | None | Base app appears functional |
Issues
- OpenTelemetry package versions may be invalid: Versions
^0.223.0for@opentelemetry/api-logsand related packages appear unusually high and may not exist, which would causenpm installto fail. [LOW]
Other completed criteria
- Environment variables documented in
.env.example .gitignoreadded to prevent.envleaks- Build configuration (package.json) is syntactically valid
PostHog implementation ⚠️
| Criteria | Result | Description |
|---|---|---|
| PostHog SDKs installed | Yes | posthog-js: ^1.438.2 added to package.json |
| PostHog client initialized | Yes | posthog.init() in instrumentation-client.ts with env vars and capture_exceptions: true |
| capture() | Yes | 9 meaningful posthog.capture() calls across auth, dashboard, pricing, and security pages |
| identify() | Yes | posthog.identify(String(user.id), { email, name, role }) in dashboard layout using stable DB user ID; posthog.reset() on sign-out |
| Error tracking | Yes | global-error.tsx calls posthog.captureException(error) + capture_exceptions: true in init config |
| Reverse proxy | No | No reverse proxy configured; Next.js rewrites or Vercel proxy not set up |
Issues
- No reverse proxy: The Next.js docs recommend configuring a reverse proxy via Next.js rewrites, middleware, or Vercel rewrites. Without this, ad blockers will silently drop client-side events. Add rewrites in
next.config.tsto proxy/ingestto the PostHog host. [MEDIUM] - Server-side uses OTLP logs instead of
posthog-node: Theinstrumentation.tsfile sets up an OpenTelemetry log exporter that sends log records to/i/v1/logs. This is not the documented Next.js server-side pattern. The standard approach isposthog-nodewithPostHogclient,capture()calls, andawait posthog.shutdown(). OTLP log records are not PostHog events — they won't appear in funnels, trends, or retention charts. Installposthog-nodeand use the documentedPostHogClientpattern. [MEDIUM] - Older
defaultsdate:defaults: "2026-01-30"is used instead of the current"2026-05-30". This means the SDK uses older default configuration values. [LOW]
Other completed criteria
- API key loaded from
NEXT_PUBLIC_POSTHOG_PROJECT_TOKENenvironment variable (not hardcoded) - API host loaded from
NEXT_PUBLIC_POSTHOG_HOSTenvironment variable posthog.reset()correctly called on sign-out before navigation- Identify uses stable
user.idfrom the database, not email as distinct ID - Person properties (email, name, role) set via identify, not in capture properties
PostHog insights and events ⚠️
| Filename | PostHog events | Description |
|---|---|---|
login.tsx |
authentication_submitted |
Captures sign-in/sign-up form submission with { mode } property |
layout.tsx |
user_signed_out |
Captures sign-out action, followed by posthog.reset() |
dashboard/page.tsx |
subscription_portal_opened, team_member_removal_submitted, team_invitation_submitted |
Dashboard management events — no contextual properties |
dashboard/general/page.tsx |
account_update_submitted |
Account info form submission — no properties |
dashboard/security/page.tsx |
password_update_submitted, account_deletion_submitted |
Security-related actions — no properties |
pricing/submit-button.tsx |
checkout_started |
Pricing checkout click — no price/plan properties |
global-error.tsx |
captureException |
Global error boundary for uncaught React errors |
api/stripe/checkout/route.ts |
OTLP logs: stripe_checkout_completion_started, _succeeded, _failed |
Server-side checkout lifecycle via OTLP logs (not PostHog events) |
Issues
- Events lack enriched properties: Only
authentication_submittedincludes a property (mode). Critical events likecheckout_startedshould includeplan,price_id, orcurrency.team_invitation_submittedshould includerole.team_member_removal_submittedshould includemember_id. Without properties, these events provide limited analytical value beyond counts. [MEDIUM] - Server-side OTLP logs lack
distinct_id: ThelogCheckoutLifecyclecalls in the Stripe checkout route emit OTLP logs without any user identifier. Even as logs, they cannot be attributed to specific users. [MEDIUM]
Other completed criteria
- Events represent real user actions (authentication, checkout, team management, account settings)
- Event names are descriptive and use consistent
snake_caseconvention - Events could form meaningful funnels (authentication → checkout → subscription management)
- No PII in capture properties; email/name correctly placed in identify person properties
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:
624abe2App:
next-js/15-app-router-saasApp directory:
apps/next-js/15-app-router-saasWorkbench branch:
wizard-ci-624abe2-next-js-15-app-router-saasWizard branch:
release-please--branches--main--components--wizardContext Mill branch:
mainPostHog (MCP) branch:
masterTimestamp: 2026-10-08T09:17:14.103Z
Duration: 423.3s
YARA Scanner