[CI] (3f39e0e) tanstack-start/tanstack-start-saas - #4180
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
PR Evaluation ReportSummaryThis PR integrates PostHog into a TanStack Start SaaS invoice app. It adds client-side analytics via
Confidence score: 4/5 👍
File changes
App sanity check
|
| Criteria | Result | Description |
|---|---|---|
| App builds and runs | Yes | Syntax is valid, dependencies resolve, no type errors visible |
| Preserves existing env vars & configs | Yes | Existing code and configs preserved; only additions made |
| No syntax or type errors | Yes | All changed files have valid TypeScript/TSX syntax |
| Correct imports/exports | Yes | @posthog/react imports are correct for client-side; OTel imports are valid |
| Minimal, focused changes | No | posthog-node is added as a dependency but never imported or used — only OTel logging is used server-side. 5 extra dependencies for OTel logging is heavyweight |
| Pre-existing issues | None | No pre-existing issues identified in the base app |
Issues
- Unused
posthog-nodedependency:posthog-nodeis added topackage.jsonbut never imported anywhere in the codebase. The server-side integration uses OpenTelemetry logging directly, notposthog-nodefor event capture. This adds an unnecessary dependency. [LOW]
Other completed criteria
- Environment variables documented in
.env.example - Build configuration (package.json) is valid with correct dependency declarations
PostHog implementation ⚠️
| Criteria | Result | Description |
|---|---|---|
| PostHog SDKs installed | Yes | @posthog/react (^1.11.1) for client-side; OTel packages for server-side logging |
| PostHog client initialized | Yes | PostHogProvider in __root.tsx with apiKey, api_host, defaults, capture_exceptions, and tracing_headers |
| capture() | Yes | invoice_created and invoice_marked_paid events in route handlers |
| identify() | No | No identify() or reset() calls anywhere in the app. All events are anonymous |
| Error tracking | Yes | captureException in DefaultCatchBoundary plus capture_exceptions: true in init config for unhandled errors |
| Reverse proxy | No | No reverse proxy configured. Client-side SDK sends directly to PostHog host |
Issues
- Missing user identification: No
posthog.identify()calls exist anywhere. The TanStack Start docs explicitly show callingposthog.identify(userId, { email })on login andposthog.reset()on logout. Without this, all captured events, session replays, and error tracking remain anonymous — the primary purpose of a SaaS app's analytics (understanding per-user behavior) is lost. [CRITICAL] - No reverse proxy: The client-side SDK (
@posthog/reactwrappingposthog-js) sends requests directly to the PostHog host. This makes event capture vulnerable to ad blockers. A Vite/Nitro rewrite or managed proxy should be configured. [MEDIUM] - Outdated
defaultsdate: The init usesdefaults: '2025-05-24'while current docs recommend'2026-05-30'. This means the SDK uses an older configuration snapshot. [LOW]
Other completed criteria
- API key loaded from
VITE_PUBLIC_POSTHOG_PROJECT_TOKENenvironment variable (not hardcoded) - API host loaded from
VITE_PUBLIC_POSTHOG_HOSTenvironment variable tracing_headersconfigured for client-server session linking- Graceful fallback when env vars are missing (renders without PostHog in production, throws in dev)
PostHog insights and events ⚠️
| Filename | PostHog events | Description |
|---|---|---|
posts..tsx |
invoice_marked_paid |
Captured when user marks an invoice as paid — no properties attached |
posts.index.tsx |
invoice_created |
Captured when user creates a new invoice — no properties attached |
DefaultCatchBoundary.tsx |
captureException |
Route-level errors captured as exceptions |
__root.tsx |
capture_exceptions: true |
Global unhandled exception autocapture enabled |
invoices.ts |
OTel logs: invoice.created, invoice.marked_paid |
Server-side structured logs with invoice_status attribute sent to PostHog logs endpoint |
Issues
- Events lack enriching properties: Both
invoice_createdandinvoice_marked_paidare bareposthog.capture('event_name')calls with no properties. Invoice data (amount, title, status, ID) is available in the surrounding code but not passed. This severely limits the ability to segment, filter, or build meaningful funnels. [MEDIUM]
Other completed criteria
- Events represent real user actions (creating and paying invoices are core SaaS flows)
- Events could enable basic funnel analysis (create → pay flow)
- No PII in event properties
- Event names are descriptive and use 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: wizard-pr
Trigger ID:
3f39e0eApp:
tanstack-start/tanstack-start-saasApp directory:
apps/tanstack-start/tanstack-start-saasWorkbench branch:
wizard-ci-3f39e0e-tanstack-start-tanstack-start-saasWizard branch:
release-please--branches--main--components--wizardContext Mill branch:
mainPostHog (MCP) branch:
masterTimestamp: 2026-09-23T22:24:03.519Z
Duration: 439.4s
YARA Scanner