[CI] (c537a08) tanstack-start/tanstack-start-saas#1534
Closed
wizard-ci-bot[bot] wants to merge 1 commit into
Closed
[CI] (c537a08) tanstack-start/tanstack-start-saas#1534wizard-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. Let me produce the evaluation. PR Evaluation ReportSummaryThis PR integrates PostHog into a TanStack Start SaaS invoicing app, adding both client-side (
Confidence score: 4/5 👍
File changes
App sanity check
|
| Criteria | Result | Description |
|---|---|---|
| App builds and runs | Yes | All imports resolve, packages added, no syntax issues |
| Preserves existing env vars & configs | Yes | Existing code preserved; only PostHog additions made |
| No syntax or type errors | Yes | All changed files are syntactically valid |
| Correct imports/exports | Yes | @posthog/react, posthog-node, posthog-js imports are all correct |
| Minimal, focused changes | Yes | All changes relate to PostHog integration |
| Pre-existing issues | None | No pre-existing issues detected |
Issues
- Environment variables not documented: No
.env.examplefile was created or updated. The.envfile exists but is not committed (not in the diff). New users would not knowVITE_PUBLIC_POSTHOG_PROJECT_TOKENandVITE_PUBLIC_POSTHOG_HOSTare required. [MEDIUM]
Other completed criteria
- All changes are relevant to PostHog integration
- Code follows existing codebase patterns (hooks in components, singleton for server)
- Build configuration (package.json, vite.config.ts) is valid
PostHog implementation ⚠️
| Criteria | Result | Description |
|---|---|---|
| PostHog SDKs installed | Yes | posthog-js@^1.374.3, @posthog/react@^1.9.0, posthog-node@^5.34.7 added to package.json |
| PostHog client initialized | Yes | PostHogProvider in __root.tsx with apiKey from env var, reverse proxy host, capture_exceptions, and debug mode |
| capture() | Yes | Multiple meaningful captures: invoice_created, invoice_paid, invoice_pdf_download_clicked, team_member_viewed, plus server-side events |
| identify() | No | No posthog.identify() calls anywhere in the codebase. No posthog.reset() on logout either |
| Error tracking | Yes | capture_exceptions: true in PostHogProvider options enables exception autocapture |
| Reverse proxy | Yes | Vite dev proxy correctly routes /ingest/static and /ingest/array → us-assets.i.posthog.com, /ingest → us.i.posthog.com |
Issues
- No user identification: No
posthog.identify()is called anywhere — not on login, not on page load, nowhere. All client events remain anonymous. For a SaaS invoicing app with users, this is a critical gap that prevents associating events with known users. [CRITICAL] - Broken server-side session/user correlation: The
__add_tracing_headersoption is not passed toposthog.init(), so the client never sendsX-POSTHOG-SESSION-IDorX-POSTHOG-DISTINCT-IDheaders. The server API routes read these headers but will always getnull, falling back todistinctId: 'anonymous'. This merges all server-side events into a single "anonymous" user, destroying data integrity. [CRITICAL] - No
posthog.shutdown()in server API routes: The docs requireawait posthog.shutdown()after server-side captures to ensure events are flushed. WhileflushAt: 1andflushInterval: 0mitigate this, events could still be lost in short-lived serverless contexts. [MEDIUM] - Reverse proxy is dev-only: The Vite
server.proxyconfig only applies duringvite dev. Production deployments would need a separate proxy (e.g., Vercel rewrites, Nginx). Not blocking, but worth noting. [LOW]
Other completed criteria
- API key loaded from
VITE_PUBLIC_POSTHOG_PROJECT_TOKENenvironment variable (not hardcoded) - Host correctly configured via reverse proxy
/ingestpath - Server-side PostHog client correctly uses singleton pattern with appropriate
flushAt/flushIntervalsettings ui_hostcorrectly set for PostHog toolbar access
PostHog insights and events ⚠️
| Filename | PostHog events | Description |
|---|---|---|
src/routes/posts.index.tsx |
invoice_created |
Client-side: tracks when user submits the create invoice form, with title, amount, due_date |
src/routes/posts..tsx |
invoice_paid |
Client-side: tracks when user marks invoice as paid from detail view |
src/routes/posts_..deep.tsx |
invoice_paid, invoice_pdf_download_clicked |
Client-side: tracks mark-as-paid and PDF download from deep view |
src/routes/users..tsx |
team_member_viewed |
Client-side: tracks page view of team member profile (contains PII) |
src/routes/api/invoices.ts |
invoice_created |
Server-side: tracks invoice creation via API (broken correlation) |
src/routes/api/invoices..pay.ts |
invoice_payment_processed |
Server-side: tracks payment processing via API (broken correlation) |
Issues
- PII in event properties:
team_member_viewedcapturesuser_name(a person's name) directly in event properties. Per PostHog best practices, names are PII and should be set viaposthog.identify()orposthog.setPersonProperties(), not incapture()event properties. [MEDIUM]
Other completed criteria
- Events represent real user actions (creating invoices, paying invoices, downloading PDFs, viewing profiles)
- Events enable product insights — invoice_created → invoice_paid funnel is actionable
- Events include relevant contextual properties (invoice_id, title, amount, status)
- Event names are descriptive, consistent snake_case convention
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: manual
Trigger ID:
c537a08App:
tanstack-start/tanstack-start-saasApp directory:
apps/tanstack-start/tanstack-start-saasWorkbench branch:
wizard-ci-c537a08-tanstack-start-tanstack-start-saasWizard branch:
mainContext Mill branch:
mainPostHog (MCP) branch:
masterTimestamp: 2026-05-21T00:33:50.104Z
Duration: 378.3s