Repository navigation
[CI] (cc5471b) stripe/stripe-next-js-saas-starter - #4804
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 all the context I need. The base app already has a full PostHog integration (posthog-js + posthog-node, instrumentation-client.ts, identify/reset in layout, reverse proxy via Next.js rewrites). This PR from the revenue-analytics wizard only adds Stripe metadata for revenue tracking. PR Evaluation ReportSummaryThis revenue-analytics wizard PR adds
Confidence score: 5/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 (pre-existing) |
| PostHog client initialized | Yes | instrumentation-client.ts calls posthog.init() with env vars and correct config (pre-existing) |
| capture() | Yes | Autocapture enabled by default; layout has identify/reset patterns (pre-existing) |
| identify() | Yes | app/(dashboard)/layout.tsx calls posthog.identify(String(user.id)) — matches the posthog_person_distinct_id value used in this PR |
| Error tracking | Yes | capture_exceptions: true in posthog.init config (pre-existing) |
| Reverse proxy | Yes | next.config.ts rewrites /ingest/* → us.i.posthog.com and /ingest/static/* → us-assets.i.posthog.com (pre-existing) |
Issues
- No issues introduced by this PR
Other completed criteria
- API key loaded from
NEXT_PUBLIC_POSTHOG_PROJECT_TOKENenvironment variable, not hardcoded - Host correctly configured via reverse proxy (
/ingest→https://us.i.posthog.com) - Distinct ID consistency:
String(user.id)used in bothposthog.identify()andposthog_person_distinct_idmetadata — this is critical for revenue analytics to correctly link Stripe customers to PostHog persons client_reference_idreused for the sameposthogDistinctIdvalue, maintaining backward compatibility
PostHog insights and events ✅
| Filename | PostHog events | Description |
|---|---|---|
lib/payments/stripe.ts |
Stripe metadata: posthog_person_distinct_id |
Attaches PostHog distinct ID to Checkout Session metadata and Subscription metadata, enabling PostHog revenue analytics to correlate Stripe subscription data with PostHog person profiles |
Issues
- No issues
Other completed criteria
- Metadata key
posthog_person_distinct_idfollows PostHog's expected naming convention for revenue analytics - Distinct ID uses real auth context (
user.id), not fabricated values - No PII in metadata — only a numeric user ID
- Metadata applied to both Checkout Session and Subscription, ensuring revenue tracking works for both initial purchase and ongoing subscription lifecycle 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: scheduled
Trigger ID:
cc5471bApp:
stripe/stripe-next-js-saas-starterApp directory:
apps/stripe/stripe-next-js-saas-starterWorkbench branch:
wizard-ci-cc5471b-stripe-stripe-next-js-saas-starterWizard branch:
mainContext Mill branch:
mainPostHog (MCP) branch:
masterTimestamp: 2026-10-28T17:14:23.450Z
Duration: 223.6s
YARA Scanner