Repository navigation
[CI] (0ae2102) react-router/saas-template - #1240
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 information needed to produce the full evaluation. PR Evaluation ReportSummaryThis PR integrates PostHog into a React Router v7 (framework mode) SaaS template application. It adds both client-side (
Confidence score: 4/5 👍
File changes
App sanity check
|
| Criteria | Result | Description |
|---|---|---|
| App builds and runs | Yes | All imports resolve correctly, TypeScript types are consistent, dependencies added |
| Preserves existing env vars & configs | Yes | Existing env vars, configs, and middleware untouched; PostHog additions are additive |
| No syntax or type errors | Yes | All files use valid TypeScript syntax, types are properly cast |
| Correct imports/exports | Yes | posthog-js imported client-side, posthog-node imported server-side with .server.ts suffix |
| Minimal, focused changes | Yes | All changes are PostHog-related; minor formatting change in _sidebar-layout.tsx is inconsequential |
| Pre-existing issues | None | .env.example doesn't have PostHog vars but this is a new addition issue, not pre-existing |
Issues
.env.examplenot updated with PostHog vars: The.env.examplefile was not updated with placeholder entries forVITE_PUBLIC_POSTHOG_PROJECT_TOKENandVITE_PUBLIC_POSTHOG_HOST. Developers cloning the repo won't know these are needed until the Zod schema validation fails at startup. Add placeholder entries to.env.example. [LOW]
Other completed criteria
- All PostHog SDK packages correctly added to
package.jsonwith appropriate versions vite.config.tscorrectly updated withssr.noExternalfor SSR compatibility.envadded to.gitignoreto prevent secret leakagewindow.ENVpattern correctly used to pass server env vars to client (matching existing app pattern)- Build configuration remains valid
PostHog implementation ⚠️
| Criteria | Result | Description |
|---|---|---|
| PostHog SDKs installed | Yes | posthog-js ^1.369.0, @posthog/react ^1.9.0, and posthog-node ^5.29.2 added to dependencies |
| PostHog client initialized | Yes | Client-side: posthog.init() in entry.client.tsx with window.ENV vars and defaults: '2026-01-30'; Server-side: per-request PostHog Node client in middleware with withContext() |
| capture() | Yes | 12 meaningful capture calls across client and server |
| identify() | Yes | posthog.identify(userId, { email, name }) called in sidebar layout via useEffect on authenticated pages; uses real database user IDs |
| Error tracking | Yes | posthog.captureException(error) in root ErrorBoundary for non-404 errors |
| Reverse proxy | No | No reverse proxy configured; __add_tracing_headers is set but no Next.js rewrites or equivalent proxy configuration |
Issues
- Missing
posthog.reset()on logout: The logout route captures a server-sideuser_logged_outevent but does not callposthog.reset()on the client side. Per PostHog docs,reset()should be called on logout to unlink future events from the current user. Since logout is a server-side action that redirects, a client-side mechanism (e.g., checking auth state change) should triggerposthog.reset(). [MEDIUM] contact_sales_submitteduses email asdistinctId: Incontact-sales-action.server.ts,submissionData.workEmailis used as thedistinctId. This is a raw email address, not a real user/session ID, which will create fragmented person profiles and is a PII concern. Should use a session or anonymous ID if user is not authenticated. [MEDIUM]- No reverse proxy configured: No reverse proxy is set up to route PostHog requests through the app's domain. The
__add_tracing_headersoption is correctly configured for session correlation, but browser requests tous.i.posthog.commay be blocked by ad blockers. Consider adding React Router rewrites. [LOW]
Other completed criteria
- API key loaded from environment variable via
window.ENV(client) andprocess.env(server) — not hardcoded - API host correctly configured to
https://us.i.posthog.com - Server middleware properly uses
posthog.withContext()for session correlation posthog.shutdown()called after each server request- Stripe webhook handler creates standalone PostHog client with proper lifecycle
ssr.noExternalcorrectly configured for SSR compatibilitydefaults: '2026-01-30'correctly set per docs
PostHog insights and events ⚠️
| Filename | PostHog events | Description |
|---|---|---|
auth.callback.ts |
user_signed_up, user_logged_in |
Tracks new user registration and returning user authentication with user ID and email person properties |
logout.ts |
user_logged_out |
Tracks user logout server-side with proper user resolution from Supabase |
_sidebar-layout.tsx |
identify() |
Identifies authenticated users with email and name as person properties |
root.tsx |
captureException |
Captures non-404 errors in the root error boundary |
billing-action.server.ts |
subscription_cancelled, subscription_checkout_started, subscription_resumed, subscription_plan_switched |
Full billing lifecycle tracking with org ID, subscription ID, price ID properties |
stripe-event-handlers.server.ts |
subscription_checkout_completed |
Webhook-driven event for completed checkouts with amount, currency, Stripe customer ID |
contact-sales-action.server.ts |
contact_sales_submitted |
Enterprise contact form submission tracking |
onboarding-organization-action.server.ts |
onboarding_organization_completed |
Onboarding funnel step completion |
create-organization-action.server.ts |
organization_created |
New organization creation tracking |
team-members-action.server.tsx |
member_invited_by_email |
Team growth tracking with invited role and org ID |
Issues
- PII in event properties: Multiple events include email addresses directly in event
properties:user_logged_inanduser_signed_uphaveemailas a top-level property (outside), `contact_sales_submitted` includes `work_email`, and `member_invited_by_email` includes `invited_email`. Emails should only appear in person properties (viaoridentify()), not in event properties. The: { email }usage is correct for setting person properties, but the bareemailfield alongside it leaks PII into event data. [MEDIUM]
Other completed criteria
- Events represent real user actions mapping to actual SaaS product flows (signup, login, billing, team management)
- Events enable product insights: can build signup-to-subscription funnel, track churn via cancellation events, measure team growth
- Events include enriched contextual properties (org IDs, price IDs, subscription IDs, lookup keys)
- Event names are descriptive and use consistent
snake_casenaming convention - 12 distinct events covering the full user journey from signup through billing
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:
0ae2102App:
react-router/saas-templateApp directory:
apps/react-router/saas-templateWorkbench branch:
wizard-ci-0ae2102-react-router-saas-templateWizard branch:
release-please--branches--main--components--wizardContext Mill branch:
mainPostHog (MCP) branch:
masterTimestamp: 2026-04-15T19:37:50.189Z
Duration: 639.3s