Repository navigation
[CI] (c212e50) next-js/15-app-router-saas - #4325
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
PR Evaluation ReportSummaryThis PR integrates PostHog into a Next.js 15 App Router SaaS application with both client-side (
Confidence score: 5/5 🧙
File changes
App sanity check
|
| Criteria | Result | Description |
|---|---|---|
| App builds and runs | Yes | No syntax errors, valid TypeScript, correct module resolution |
| Preserves existing env vars & configs | Yes | Existing env vars and configs untouched; only PostHog additions |
| No syntax or type errors | Yes | All files use valid syntax and types |
| Correct imports/exports | Yes | All imports resolve correctly — posthog-js client-only, posthog-node server-only, server-only guard on logs |
| Minimal, focused changes | Yes | All changes relate to PostHog integration |
| Pre-existing issues | None | No pre-existing issues observed |
Issues
- Outdated defaults date:
instrumentation-client.tsusesdefaults: '2026-01-30'instead of the latest'2026-05-30'from PostHog docs. Update to the latest date to ensure optimal default configuration. [LOW]
Other completed criteria
- Environment variables documented in
.env.example .gitignoreprevents.envfrom being committedpackage.jsondependencies are valid with proper version rangesimport 'server-only'guard onposthog-logs.tsprevents accidental client-side importuseimport correctly replaced withuseEffectsince the new identify logic requires it
PostHog implementation ⚠️
| Criteria | Result | Description |
|---|---|---|
| PostHog SDKs installed | Yes | posthog-js ^1.435.6 and posthog-node ^5.55.0 added to package.json |
| PostHog client initialized | Yes | Client: instrumentation-client.ts with posthog.init(). Server: singleton in lib/posthog-server.ts with flushAt: 1, flushInterval: 0 |
| capture() | Yes | 9 server-side events + client-side autocapture enabled |
| identify() | Yes | Uses stable String(user.id) with email, name, role as person properties. Fires in useEffect when SWR loads user data. posthog.reset() called on sign-out |
| Error tracking | Yes | global-error.tsx with captureException(), plus capture_exceptions: true in init config |
| Reverse proxy | No | next.config.ts has no rewrites. PostHog requests go directly to us.i.posthog.com |
Issues
- No reverse proxy configured: The
next.config.tsis empty — no PostHog rewrites are set up. Client-side PostHog requests will go directly tous.i.posthog.comand may be blocked by ad blockers. Add rewrites per the Next.js proxy docs. [MEDIUM]
Other completed criteria
- API key loaded from
NEXT_PUBLIC_POSTHOG_PROJECT_TOKENenvironment variable (not hardcoded) - API host loaded from
NEXT_PUBLIC_POSTHOG_HOSTenvironment variable - Env var validation with clear error messages in development mode
- Server-side client correctly uses
flushAt: 1andflushInterval: 0per Next.js docs enableExceptionAutocapture: trueon server-side client- OpenTelemetry logging integration sends structured logs to PostHog
PostHog insights and events ✅
| Filename | PostHog events | Description |
|---|---|---|
app/(login)/actions.ts |
user_signed_in, user_signed_up, password_updated, account_deleted, account_updated, team_member_removed, team_member_invited |
Server-side events covering the full user lifecycle and team management |
app/api/stripe/checkout/route.ts |
checkout_completed |
Captures successful Stripe checkout with subscription status |
lib/payments/stripe.ts |
checkout_started, subscription_portal_opened |
Captures checkout initiation and billing portal access |
app/global-error.tsx |
captureException |
Captures unhandled client-side errors |
app/api/stripe/webhook/route.ts |
OTel logs | Logs webhook events (signature failures, subscription changes) |
instrumentation-client.ts |
autocapture, captureException |
Automatic pageviews, clicks, and exception autocapture |
Issues
No issues.
Other completed criteria
- Events represent real user actions mapped to actual product flows (signup → checkout → subscription management)
- Events enable product insights: sign-up → sign-in → checkout funnel, team management analytics, subscription tracking
- Events include relevant properties:
joined_via_invitation,role,has_existing_customer,subscription_status - No PII in event properties — email/name only in
identify()person properties - Event names use consistent
snake_caseconvention with descriptive action names
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:
c212e50App:
next-js/15-app-router-saasApp directory:
apps/next-js/15-app-router-saasWorkbench branch:
wizard-ci-c212e50-next-js-15-app-router-saasWizard branch:
posthog/functional-r9-19-bring-docs-readmes-and-skills-in-line-wiContext Mill branch:
mainPostHog (MCP) branch:
masterTimestamp: 2026-10-01T19:37:50.362Z
Duration: 538.8s
YARA Scanner