[CI] (3f39e0e) stripe/stripe-next-js-saas-starter - #4182
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
|
Now I have a complete picture. Let me write the evaluation. PR Evaluation ReportSummaryThis PR from the revenue-analytics wizard adds
Confidence score: 4/5 👍
File changes
App sanity check ✅
Issues
|
| Criteria | Result | Description |
|---|---|---|
| PostHog SDKs installed | Yes | posthog-js@^1.369.0 and posthog-node@^5.29.2 in package.json |
| PostHog client initialized | Yes | instrumentation-client.ts calls posthog.init() with env var token and /ingest reverse proxy host |
| capture() | Yes | checkout_completed in checkout route, subscription_updated/subscription_canceled in webhook |
| identify() | Yes | Dashboard layout identifies with String(userData.id) and person properties {email, name}; calls posthog.reset() on sign-out |
| Error tracking | Yes | capture_exceptions: true in init config |
| Reverse proxy | Yes | next.config.ts rewrites /ingest/static/* → us-assets.i.posthog.com and /ingest/* → us.i.posthog.com |
Issues
- Webhook distinctId mismatch — metadata added but never consumed: The PR adds
posthog_person_distinct_idmetadata to the Stripe subscription, but the webhook handler atapp/api/stripe/webhook/route.tsstill usessubscription.customer(Stripe customer ID) as thedistinctId. This meanssubscription_updatedandsubscription_canceledevents are attributed tocus_xxxinstead of the user's actual PostHog distinct ID (String(user.id)). The metadata this PR adds exists precisely to fix this, but the webhook handler was never updated to readsubscription.metadata.posthog_person_distinct_id. Revenue attribution will be broken for all subscription lifecycle events. [CRITICAL]
Other completed criteria
- API key loaded from
NEXT_PUBLIC_POSTHOG_PROJECT_TOKENenvironment variable, not hardcoded - Host configured via reverse proxy (
/ingest) on client-side and env var on server-side - Reverse proxy correctly routes both
/ingest/static/*(assets) and/ingest/*(ingestion) posthog.reset()called on logout- Identify uses stable database ID (
String(userData.id)) with email/name as person properties
PostHog insights and events ⚠️
| Filename | PostHog events | Description |
|---|---|---|
lib/payments/stripe.ts |
(metadata only) | Adds posthog_person_distinct_id to Stripe session and subscription metadata for linking Stripe events to PostHog persons |
app/api/stripe/checkout/route.ts |
checkout_completed |
Captures checkout completion with plan_name, product_id, subscription_id, status — uses correct String(user.id) distinct ID |
app/api/stripe/webhook/route.ts |
subscription_updated, subscription_canceled |
Captures subscription lifecycle events but uses Stripe customerId as distinctId — broken attribution |
app/(dashboard)/layout.tsx |
identify, reset |
Identifies user on dashboard load with database ID; resets on sign-out |
Issues
- Subscription events attributed to wrong person:
subscription_updatedandsubscription_canceledevents use Stripe customer ID (cus_xxx) asdistinctId. These create orphaned person records that don't link to the identified user (String(user.id)). The webhook handler should readsubscription.metadata.posthog_person_distinct_idand use that as thedistinctIdinstead. [CRITICAL]
Other completed criteria
- Events represent real user actions (checkout, subscription changes)
- Events include rich properties (plan_name, product_id, subscription_status, stripe_customer_id)
- No PII in capture() properties — email is only in identify() person properties
- Event names are descriptive and use consistent snake_case convention
- Checkout event enables revenue funnel analysis (pricing → checkout → completion)
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:
3f39e0eApp:
stripe/stripe-next-js-saas-starterApp directory:
apps/stripe/stripe-next-js-saas-starterWorkbench branch:
wizard-ci-3f39e0e-stripe-stripe-next-js-saas-starterWizard branch:
release-please--branches--main--components--wizardContext Mill branch:
mainPostHog (MCP) branch:
masterTimestamp: 2026-09-23T22:26:08.480Z
Duration: 138.5s
YARA Scanner