Skip to content

[CI] (33127b6) next-js/15-app-router-saas - #3670

Closed
wizard-ci-bot[bot] wants to merge 1 commit into
mainfrom
wizard-ci-33127b6-next-js-15-app-router-saas
Closed

wizard-ci-bot[bot] wants to merge 1 commit into
mainfrom
wizard-ci-33127b6-next-js-15-app-router-saas

Conversation

@wizard-ci-bot

@wizard-ci-bot wizard-ci-bot Bot commented Aug 28, 2026

Copy link
Copy Markdown

Automated wizard CI run

Source: wizard-pr
Trigger ID: 33127b6
App: next-js/15-app-router-saas
App directory: apps/next-js/15-app-router-saas
Workbench branch: wizard-ci-33127b6-next-js-15-app-router-saas
Wizard branch: release-please--branches--main--components--wizard
Context Mill branch: main
PostHog (MCP) branch: master
Timestamp: 2026-08-28T22:30:26.224Z
Duration: 337.8s

YARA Scanner

✓ 148 tool calls scanned, 0 violations detected

No violations: ✓ 148 clean scans

@wizard-ci-bot

wizard-ci-bot Bot commented Aug 28, 2026

Copy link
Copy Markdown
Author

PR Evaluation Report

Summary

This PR integrates PostHog into a Next.js 15 App Router SaaS application using posthog-js for client-side analytics. It adds initialization via instrumentation-client.ts, user identification with deduplication logic, custom event captures across login/dashboard/security/pricing flows, error tracking via global-error.tsx, and environment variable documentation.

Files changed Lines added Lines removed
10 +129 -9

Confidence score: 5/5 🧙

  • No reverse proxy configured — browser-side events are vulnerable to ad blockers [MEDIUM]
  • Most custom events lack contextual properties — only team_invite_submitted includes enriching properties [MEDIUM]
  • defaults date set to '2025-05-24' instead of the current '2026-05-30', which means older configuration defaults apply [LOW]

File changes

Filename Score Description
instrumentation-client.ts 5/5 PostHog init with env vars, exception autocapture, dev debug mode, and missing-key guard
app/(dashboard)/layout.tsx 5/5 User identification via SWR data with ref-based dedup, reset on sign out and user switch
app/global-error.tsx 5/5 New global error boundary capturing exceptions via posthog.captureException()
app/(login)/login.tsx 4/5 Sign in/up event capture — clean but no properties
app/(dashboard)/dashboard/page.tsx 4/5 Subscription, team member, and invite events; invite has role property
app/(dashboard)/dashboard/general/page.tsx 4/5 Account update event capture
app/(dashboard)/dashboard/security/page.tsx 4/5 Password update and account deletion event captures
app/(dashboard)/pricing/submit-button.tsx 4/5 Checkout started event on button click
.env.example 5/5 Documents NEXT_PUBLIC_POSTHOG_KEY and NEXT_PUBLIC_POSTHOG_HOST
package.json 5/5 Adds posthog-js dependency

App sanity check ✅

Criteria Result Description
App builds and runs Yes Valid TypeScript, correct Next.js conventions, no missing dependencies
Preserves existing env vars & configs Yes All existing env vars and configs preserved; use import removed but was unused in the file
No syntax or type errors Yes All files are syntactically valid; types match existing codebase patterns
Correct imports/exports Yes posthog-js imported correctly in all 'use client' components
Minimal, focused changes Yes All changes directly relate to PostHog integration
Pre-existing issues None —

Issues

No issues.

Other completed criteria

  • All changes are PostHog-related with no unrelated edits
  • Correct file modified for Next.js (instrumentation-client.ts)
  • Code follows existing codebase patterns (handleSubmit wrapper pattern, SWR usage)
  • Environment variables documented in .env.example
  • Build configuration valid with posthog-js added to dependencies

PostHog implementation ⚠️

Criteria Result Description
PostHog SDKs installed Yes posthog-js: ^1.422.5 added to package.json
PostHog client initialized Yes instrumentation-client.ts with posthog.init(), env var guard, capture_exceptions: true, dev debug mode
capture() Yes 9 custom event captures across login, dashboard, security, and pricing flows
identify() Yes posthog.identify(String(user.id), { email, name, role }) in dashboard layout with ref-based dedup and posthog.reset() on logout and user switch
Error tracking Yes capture_exceptions: true in init config + posthog.captureException(error) in global-error.tsx
Reverse proxy No No reverse proxy configured in next.config.ts or elsewhere

Issues

  • No reverse proxy configured: The next.config.ts has no rewrites for proxying PostHog requests. Browser-side events sent directly to us.i.posthog.com are susceptible to ad blockers. Add Next.js rewrites to proxy /ingest to the PostHog host. [MEDIUM]
  • Older defaults date: defaults: '2025-05-24' should be updated to '2026-05-30' for the latest configuration snapshot. [LOW]

Other completed criteria

  • API key loaded from NEXT_PUBLIC_POSTHOG_KEY environment variable, not hardcoded
  • Host correctly configured from NEXT_PUBLIC_POSTHOG_HOST environment variable
  • Identify uses stable user.id (not email) as distinct_id
  • Person properties (email, name, role) correctly passed via identify(), not capture()
  • posthog.reset() called on sign out and before re-identify on user switch
  • Ref-based deduplication prevents redundant identify calls

PostHog insights and events ✅

Filename PostHog events Description
login.tsx sign_in_submitted, sign_up_submitted Tracks auth form submissions with mode-based event naming
dashboard/page.tsx subscription_management_opened, team_member_removal_submitted, team_invite_submitted Dashboard team and subscription management actions; invite includes invited_role property
dashboard/general/page.tsx account_update_submitted Account info update tracking
dashboard/security/page.tsx password_update_submitted, account_deletion_submitted Security-related action tracking
pricing/submit-button.tsx checkout_started Pricing checkout initiation
global-error.tsx captureException Captures unhandled errors via global error boundary
layout.tsx identify, reset User identification and session reset

Issues

  • Most events lack contextual properties: Only team_invite_submitted includes an invited_role property. Events like checkout_started, sign_in_submitted, account_update_submitted, etc. have no enriching properties. Adding context (e.g., plan type on checkout, page context on login) would improve analytical value. [MEDIUM]

Other completed criteria

  • Events represent real user actions mapped to actual product flows (auth, team management, billing, security)
  • Events enable product insights — can build signup→checkout funnel, track team growth, monitor security actions
  • No PII in capture() properties — email/name only in identify() person properties
  • Consistent snake_case naming convention with descriptive action names

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