Skip to content

[CI] (0ae2102) stripe/stripe-next-js-saas-starter - #1241

Closed
wizard-ci-bot[bot] wants to merge 1 commit into
mainfrom
wizard-ci-0ae2102-stripe-stripe-next-js-saas-starter
Closed

wizard-ci-bot[bot] wants to merge 1 commit into
mainfrom
wizard-ci-0ae2102-stripe-stripe-next-js-saas-starter

Conversation

@wizard-ci-bot

@wizard-ci-bot wizard-ci-bot Bot commented Apr 15, 2026

Copy link
Copy Markdown

Automated wizard CI run

Source: wizard-pr
Trigger ID: 0ae2102
App: stripe/stripe-next-js-saas-starter
App directory: apps/stripe/stripe-next-js-saas-starter
Workbench branch: wizard-ci-0ae2102-stripe-stripe-next-js-saas-starter
Wizard branch: release-please--branches--main--components--wizard
Context Mill branch: main
PostHog (MCP) branch: master
Timestamp: 2026-04-15T19:38:01.606Z
Duration: 294.1s

@wizard-ci-bot

wizard-ci-bot Bot commented Apr 15, 2026

Copy link
Copy Markdown
Author

PR Evaluation Report

Summary

This PR extends an existing PostHog integration in a Next.js SaaS starter app by adding three new event captures: sign_in_failed and sign_up_failed server-side events in the login/signup actions, and a pricing_page_viewed client-side event via a new PricingPageTracker component. The core PostHog setup (initialization, reverse proxy, identify, error tracking) was already in place from a prior wizard run.

Files changed Lines added Lines removed
4 +90 -23

Confidence score: 4/5 👍

  • PII in event properties: The sign_in_failed and sign_up_failed events include email as an event property in posthog.capture(). PII (email) should be set via person properties (/), not sent as event-level properties. [CRITICAL]
  • Email used as distinct_id: When a user is not found (sign_in_failed with reason user_not_found) and for sign_up_failed, the raw email address is used as the distinctId. This creates person profiles keyed to email addresses, which is a PII concern and can cause fragmented data if the user later signs up with a proper database ID. [MEDIUM]
  • Direct posthog-js import in component: pricing-tracker.tsx directly imports posthog from 'posthog-js' instead of using the usePostHog hook from @posthog/react. While this may work if posthog.init() was called in instrumentation-client.ts, it bypasses the recommended React pattern and risks calling methods before initialization. [MEDIUM]
  • useEffect for event capture: The PricingPageTracker component uses useEffect to fire a capture event, which is a React anti-pattern per the framework rules — analytics should ideally be triggered from event handlers, not effects. However, for page-view-style events on mount, this is a common pragmatic pattern. [LOW]

File changes

Filename Score Description
app/(dashboard)/pricing/page.tsx 4/5 Adds PricingPageTracker component with plan metadata passed as props — clean integration
app/(dashboard)/pricing/pricing-tracker.tsx 3/5 New client component capturing pricing_page_viewed — direct posthog-js import instead of usePostHog hook
app/(login)/actions.ts 2/5 Adds server-side failure events but includes PII (email) in capture properties and uses email as distinctId
posthog-setup-report.md 4/5 Updated report reflecting new events and suggested dashboards

App sanity check ⚠️

Criteria Result Description
App builds and runs Yes No syntax errors; new component and server-side captures are structurally valid
Preserves existing env vars & configs Yes No existing configuration modified
No syntax or type errors Yes All code is syntactically correct TypeScript/TSX
Correct imports/exports Yes posthog-js import in client component, getPostHogClient used server-side (assumed pre-existing)
Minimal, focused changes Yes Only adds PostHog event captures — no scope creep
Pre-existing issues None observed Base app PostHog setup appears correct from report context

Issues

  • No critical app sanity issues

Other completed criteria

  • Environment variables are documented (pre-existing setup, no new env vars introduced)
  • Build configuration unchanged and valid
  • All changes relate to PostHog integration

PostHog implementation ⚠️

Criteria Result Description
PostHog SDKs installed Yes Pre-existing: posthog-js and posthog-node already in dependencies (not modified by this PR)
PostHog client initialized Yes Pre-existing: instrumentation-client.ts for client, lib/posthog-server.ts for server (not modified)
capture() Yes Three new capture calls: pricing_page_viewed (client), sign_in_failed and sign_up_failed (server)
identify() N/A Pre-existing identify implementation not modified by this PR; this PR only adds captures
Error tracking Yes Pre-existing: capture_exceptions: true in client init (not modified)
Reverse proxy Yes Pre-existing: next.config.ts rewrites (not modified)

Issues

  • PII (email) in server-side capture properties: The sign_in_failed and sign_up_failed events include { email, reason: '...' } as event properties. Email is PII and should be set via person properties, not as capture event properties. Remove `email` from the `properties` object or move it to. [CRITICAL]
  • Email as distinctId for unknown users: For the user_not_found case in sign_in_failed and for sign_up_failed, the raw email string is used as distinctId. This creates person profiles keyed to email addresses. If the user later registers and gets a database ID, these will be separate persons. Use a hashed or anonymized identifier, or skip the capture for truly unknown users. [MEDIUM]
  • Direct posthog-js import: pricing-tracker.tsx imports posthog directly from posthog-js rather than using the usePostHog() hook from @posthog/react. The React docs recommend always using the hook to ensure the client is initialized. [MEDIUM]

Other completed criteria

  • API key loaded from environment variable (pre-existing)
  • API host correctly configured (pre-existing)
  • Reverse proxy configured via Next.js rewrites (pre-existing)

PostHog insights and events ⚠️

Filename PostHog events Description
app/(login)/actions.ts sign_in_failed, sign_up_failed Server-side failure tracking with reason property differentiating failure types; enables sign-in/sign-up failure funnels
app/(dashboard)/pricing/pricing-tracker.tsx pricing_page_viewed Client-side pricing page impression with plan metadata (name, price_id, unit_amount, interval); enables subscription conversion funnel

Issues

  • PII in event properties: email is included as an event property in sign_in_failed and sign_up_failed. This violates the no-PII-in-capture rule. Email should only appear in person properties via ``. [CRITICAL]
  • Events enriched with good properties: The pricing_page_viewed event includes plan details and the failure events include reason — this is good for segmentation, but the email property must be removed. [MEDIUM]

Other completed criteria

  • Events represent real user actions (failed sign-in, failed sign-up, pricing page view)
  • Events enable product insights (conversion funnel: pricing_page_viewed → checkout_initiated → checkout_completed; failure rate tracking)
  • Event names are descriptive and use consistent snake_case naming

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