[CI] (4c70a79) next-js/15-app-router-saas - #3864
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 (
Confidence score: 5/5 🧙
File changes
App sanity check ✅
IssuesNo issues.
|
| Criteria | Result | Description |
|---|---|---|
| PostHog SDKs installed | Yes | posthog-js ^1.429.0 and posthog-node ^5.51.8 in package.json |
| PostHog client initialized | Yes | instrumentation-client.ts with posthog.init() using env vars, correct Next.js pattern |
| capture() | Yes | 10 server-side captureServerEvent calls + client-side autocapture enabled |
| identify() | Yes | posthog.identify(String(user.id), { email, name, role }) with stable DB ID; posthog.reset() on sign-out; ref guard prevents duplicate calls |
| Error tracking | Yes | global-error.tsx with posthog.captureException(error) + capture_exceptions: true in init config |
| Reverse proxy | No | No rewrites in next.config.ts, no middleware proxy. Client-side events will be blocked by ad blockers. |
Issues
- No reverse proxy: The integration does not configure a reverse proxy for PostHog. Next.js rewrites in
next.config.tsor Vercel rewrites should be added to route/ingest/*to PostHog, ensuring both/static/*and/array/*paths are proxied. [MEDIUM]
Other completed criteria
- API key loaded from environment variable (
NEXT_PUBLIC_POSTHOG_PROJECT_TOKEN) - Host correctly configured from environment variable (
NEXT_PUBLIC_POSTHOG_HOST) - Tracing headers configured with
window.location.hostnamefor client-server session linking - Server-side client uses
flushAt: 1andflushInterval: 0per Next.js best practices - Identify uses stable database ID, not email
PostHog insights and events ✅
| Filename | PostHog events | Description |
|---|---|---|
instrumentation-client.ts |
autocapture, , |
Client-side initialization with autocapture enabled by default |
app/(dashboard)/layout.tsx |
identify, reset |
User identification on dashboard load; reset on sign-out |
app/(login)/actions.ts |
user_signed_in, account_signed_up, user_signed_out, password_updated, account_deleted, account_updated, team_member_removed, team_member_invited |
Server-side capture of all key auth and account management actions |
app/api/stripe/checkout/route.ts |
subscription_activated |
Tracks successful Stripe checkout with subscription status |
lib/payments/stripe.ts |
subscription_checkout_started |
Tracks when checkout session creation begins |
app/global-error.tsx |
captureException |
Captures uncaught errors at the app boundary |
Issues
No issues.
Other completed criteria
- Events represent real user actions mapping to actual SaaS product flows (auth → subscription → team management)
- Events enable product insights: sign-up → sign-in → checkout → subscription funnel; team growth tracking
- Events include relevant properties (
joined_via_invitation,role,subscription_status) - No PII in event properties; email and name correctly placed in
identify()person properties - Consistent snake_case naming convention across all events
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:
4c70a79App:
next-js/15-app-router-saasApp directory:
apps/next-js/15-app-router-saasWorkbench branch:
wizard-ci-4c70a79-next-js-15-app-router-saasWizard branch:
release-please--branches--main--components--wizardContext Mill branch:
mainPostHog (MCP) branch:
masterTimestamp: 2026-09-09T22:23:37.998Z
Duration: 443.6s
YARA Scanner