Skip to content

[CI] (ba86941) stripe/stripe-next-js-saas-starter - #5152

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

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

Conversation

@wizard-ci-bot

@wizard-ci-bot wizard-ci-bot Bot commented Nov 12, 2026

Copy link
Copy Markdown

Automated wizard CI run

Source: manual
Trigger ID: ba86941
App: stripe/stripe-next-js-saas-starter
App directory: apps/stripe/stripe-next-js-saas-starter
Workbench branch: wizard-ci-ba86941-stripe-stripe-next-js-saas-starter
Wizard branch: main
Context Mill branch: main
PostHog (MCP) branch: master
Timestamp: 2026-11-12T05:22:15.900Z
Duration: 192.8s

YARA Scanner

✓ 27 tool calls scanned, 0 violations detected

No violations: ✓ 27 clean scans

@wizard-ci-bot

wizard-ci-bot Bot commented Nov 12, 2026

Copy link
Copy Markdown
Author

Now I have all the context needed. Let me produce the evaluation.


PR Evaluation Report

Summary

This PR adds PostHog revenue analytics metadata to an existing Next.js + Stripe SaaS starter app. The changes are minimal and focused: posthog_person_distinct_id metadata is added to both the Stripe Checkout Session and its subscription_data, using the authenticated user.id.toString() as the distinct ID. A report file documents the changes and manual verification steps.

Files changed Lines added Lines removed
2 +36 -1

Confidence score: 5/5 🧙

  • The Stripe Customer object is not tagged with posthog_person_distinct_id metadata — only the Checkout Session and Subscription are. If the Stripe data source syncs Customer objects to PostHog, revenue attribution may be incomplete for returning customers who don't go through a new checkout flow. [MEDIUM]
  • The .env.example file was not updated with the PostHog environment variables (NEXT_PUBLIC_POSTHOG_PROJECT_TOKEN, NEXT_PUBLIC_POSTHOG_HOST). Only .env.local (uncommitted) was modified. New developers cloning the repo won't discover the required PostHog vars from the example file. [LOW]

File changes

Filename Score Description
lib/payments/stripe.ts 5/5 Adds posthog_person_distinct_id metadata to Checkout Session and subscription_data. Clean, minimal, correct TypeScript.
posthog-revenue-report.md 4/5 Documents changes, verification steps, and manual follow-ups. References the env vars that were added to .env.local.

App sanity check ✅

Criteria Result Description
App builds and runs Yes Report confirms pnpm build compiled and passed TypeScript checking. Build halted only due to missing POSTGRES_URL, a pre-existing issue.
Preserves existing env vars & configs Yes No existing configs modified or removed. PostHog and Stripe setups remain intact.
No syntax or type errors Yes Valid TypeScript. Metadata objects use user.id.toString() which returns string, matching Stripe's metadata type requirement.
Correct imports/exports Yes No new imports needed — the changes only add object properties to an existing Stripe API call.
Minimal, focused changes Yes Only 7 lines added and 1 removed in the source file. Changes are strictly limited to Stripe metadata for PostHog revenue analytics.
Pre-existing issues POSTGRES_URL not configured Build cannot fully complete page data collection without database connection. Not introduced by this PR.

Issues

  • .env.example not updated: The PostHog env vars (NEXT_PUBLIC_POSTHOG_PROJECT_TOKEN, NEXT_PUBLIC_POSTHOG_HOST) were added to .env.local (uncommitted) but not to .env.example. The revenue report documents them, but new developers won't find them in the canonical example file. [LOW]

Other completed criteria

  • Build configuration unchanged and valid
  • Existing PostHog client-side and server-side integrations preserved
  • No unrelated refactoring or reformatting

PostHog implementation ✅

Criteria Result Description
PostHog SDKs installed Yes posthog-js (^1.369.0) and posthog-node (^5.29.2) already present in package.json.
PostHog client initialized Yes Pre-existing instrumentation-client.ts initializes posthog-js; lib/posthog-server.ts initializes posthog-node.
capture() Yes Pre-existing integration has autocapture enabled via posthog-js init. No new capture calls needed for revenue metadata tagging.
identify() Yes The user.id.toString() used for posthog_person_distinct_id is consistent with the client_reference_id already used in the checkout flow.
Error tracking Yes Pre-existing capture_exceptions: true in the posthog-js init config.
Reverse proxy Yes Pre-existing Next.js proxy configured at /ingest in the app.

Issues

  • Stripe Customer object not tagged: The posthog_person_distinct_id metadata is added to the Checkout Session and Subscription, but not to the Stripe Customer object. If PostHog's Stripe source syncs Customers, those records won't be linked to PostHog persons unless they're matched through subscription metadata. Consider adding stripe.customers.update(customerId, { metadata: { posthog_person_distinct_id: user.id.toString() } }) where the customer is created or linked. [MEDIUM]

Other completed criteria

  • API key loaded from NEXT_PUBLIC_POSTHOG_PROJECT_TOKEN environment variable, not hardcoded
  • Host correctly set to https://us.i.posthog.com
  • Screen views: N/A (web framework, posthog-js autocaptures pageviews)
  • All targets initialized: N/A (single-target project)

PostHog insights and events ✅

Filename PostHog events Description
lib/payments/stripe.ts posthog_person_distinct_id metadata Stripe Checkout Session and Subscription tagged with PostHog person distinct ID, enabling PostHog revenue analytics to attribute Stripe revenue to specific PostHog persons.

Issues

None.

Other completed criteria

  • Metadata represents real user actions (checkout and subscription creation tied to authenticated users)
  • Enables revenue analytics insights (links Stripe revenue data to PostHog person profiles for Top Customers, revenue trends)
  • Metadata includes the authenticated user ID as the distinct identifier — no PII, no fabricated values
  • posthog_person_distinct_id follows a clear, descriptive naming convention consistent with PostHog's expected metadata key

Reviewed by wizard workbench PR evaluator

@wizard-ci-bot wizard-ci-bot Bot added the CI/CD label Nov 12, 2026
@wizard-ci-bot wizard-ci-bot Bot closed this Nov 12, 2026
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