[CI] (275b928) next-js/15-app-router-saas - #3127
Closed
wizard-ci-bot[bot] wants to merge 1 commit into
Closed
Conversation
Author
PR Evaluation ReportSummaryThis PR integrates PostHog into a Next.js 15 App Router SaaS application with both client-side (posthog-js) and server-side (posthog-node) SDKs. Client initialization uses
Confidence score: 5/5 🧙
File changes
App sanity check ✅
IssuesNo issues introduced by this PR.
|
| Criteria | Result | Description |
|---|---|---|
| PostHog SDKs installed | Yes | posthog-js@^1.407.3 and posthog-node@^5.46.1 added to package.json. |
| PostHog client initialized | Yes | Client initialized in instrumentation-client.ts (correct Next.js pattern). Server singleton in lib/posthog-server.ts with flushAt: 1, flushInterval: 0. |
| capture() | Yes | 10 meaningful server-side events + autocapture on client. |
| identify() | Yes | posthog.identify(user.id.toString(), { email, name, role }) on authenticated dashboard load; posthog.reset() on sign-out. Stable numeric user ID used as distinct_id. |
| Error tracking | Yes | capture_exceptions: true in client init enables global browser exception autocapture. |
| Reverse proxy | No | No reverse proxy configured. Next.js rewrites or managed proxy recommended for client-side event delivery reliability. |
Issues
- No reverse proxy: Client-side events go directly to
us.i.posthog.com, making them susceptible to ad-blocker interception. Configure Next.js rewrites or PostHog's managed reverse proxy. [MEDIUM] - Missing
defaultsoption:posthog.init()omits thedefaults: '2026-05-30'configuration snapshot recommended in the Next.js docs. [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 - Server client uses singleton pattern with lazy initialization and
server-onlyguard - Server client calls
flush()after each capture for immediate delivery in short-lived Next.js functions - Development-mode error thrown when env vars missing, graceful no-op in production
PostHog insights and events ✅
| Filename | PostHog events | Description |
|---|---|---|
instrumentation-client.ts |
captureException (auto) |
Browser exception autocapture via capture_exceptions: true |
app/(dashboard)/layout.tsx |
identify, reset |
User identification on dashboard load, reset on sign-out |
app/(login)/actions.ts |
user_signed_in, user_signed_up, user_signed_out, password_updated, account_updated, account_deleted, team_member_invited, team_member_removed |
Full auth and team lifecycle events with relevant properties |
lib/payments/stripe.ts |
checkout_started |
Checkout initiation with has_existing_subscription property |
app/api/stripe/checkout/route.ts |
subscription_checkout_completed |
Successful checkout with subscription_status and plan_name |
Issues
No issues with event quality.
Other completed criteria
- Events represent real user actions across the full SaaS lifecycle (auth → team management → billing)
- Events enable product insights: signup→signin funnel, checkout conversion funnel, team growth tracking
- Events include contextual properties:
signup_method,invited_role,subscription_status,plan_name,has_existing_subscription - No PII in event properties — email/name/role set via
identify()person properties only - Consistent snake_case naming convention across all event 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:
275b928App:
next-js/15-app-router-saasApp directory:
apps/next-js/15-app-router-saasWorkbench branch:
wizard-ci-275b928-next-js-15-app-router-saasWizard branch:
release-please--branches--main--components--wizardContext Mill branch:
mainPostHog (MCP) branch:
masterTimestamp: 2026-07-27T19:14:16.130Z
Duration: 400.0s
YARA Scanner