Skip to content

[CI] (9da603e) react-router/saas-template - #4408

Closed
wizard-ci-bot[bot] wants to merge 3 commits into
mainfrom
wizard-ci-9da603e-react-router-saas-template
Closed

wizard-ci-bot[bot] wants to merge 3 commits into
mainfrom
wizard-ci-9da603e-react-router-saas-template

Conversation

@wizard-ci-bot

@wizard-ci-bot wizard-ci-bot Bot commented Oct 6, 2026

Copy link
Copy Markdown

Automated wizard CI run

Source: wizard-pr
Trigger ID: 9da603e
App: react-router/saas-template
App directory: apps/react-router/saas-template
Workbench branch: wizard-ci-9da603e-react-router-saas-template
Wizard branch: release-please--branches--main--components--wizard
Context Mill branch: main
PostHog (MCP) branch: master
Timestamp: 2026-10-06T16:04:17.793Z
Duration: 586.5s

YARA Scanner

✓ 280 tool calls scanned, 0 violations detected

No violations: ✓ 280 clean scans

@wizard-ci-bot

wizard-ci-bot Bot commented Oct 6, 2026

Copy link
Copy Markdown
Author

Now I have enough context. Let me produce the evaluation.


PR Evaluation Report

Summary

This PR integrates PostHog into a React Router v7 framework mode SaaS template application. It adds client-side initialization in entry.client.tsx with PostHogProvider and PostHogErrorBoundary, user identification in the authenticated layout, posthog.reset() on logout, custom event captures across 9 feature components covering subscription, organization, onboarding, and team management flows, and CSP updates in entry.server.tsx.

Files changed Lines added Lines removed
16 +253 -8

Confidence score: 4/5 👍

  • Missing ssr.noExternal for posthog-js: Multiple components import usePostHog from posthog-js/react which are server-rendered. The React Router v7 framework mode docs require ssr: { noExternal: ['posthog-js'] } in vite.config.ts to avoid SSR errors. Without this, Vite may fail to bundle posthog-js correctly during SSR. [MEDIUM]
  • No reverse proxy configured: No rewrite rules or proxy setup to route PostHog requests through a first-party domain, which means ad blockers can silently drop all events. [MEDIUM]

File changes

Filename Score Description
app/entry.client.tsx 5/5 PostHog initialization with env vars, PostHogProvider and PostHogErrorBoundary wrapping the app
app/entry.server.tsx 4/5 CSP updates for PostHog domains (connect-src, script-src, worker-src) — well done
app/routes/_authenticated-routes+/_authenticated-routes-layout.tsx 4/5 User identification with stable user.id and email as person property, with ref guard
app/features/organizations/layout/nav-user.tsx 5/5 posthog.reset() on logout form submission
app/features/billing/create-subscription-modal-content.tsx 4/5 Subscription checkout event with enriched properties
app/features/organizations/create-organization/create-organization-form-card.tsx 4/5 Organization creation event capture
app/features/organizations/settings/general/general-organization-settings.tsx 4/5 Organization settings saved event
app/features/organizations/settings/team-members/invite-by-email-card.tsx 4/5 Team invite event capture
app/features/organizations/settings/team-members/invite-link-card.tsx 4/5 Invite link copy/create/deactivate events
app/features/user-accounts/settings/account/account-settings.tsx 4/5 Account settings saved event
app/routes/_authenticated-routes+/onboarding+/organization.tsx 4/5 Onboarding organization step event
app/routes/_authenticated-routes+/onboarding+/user-account.tsx 4/5 Onboarding user account step event
app/utils/env.server.ts 5/5 PostHog env vars added to schema (optional) and getEnv()
.env.example 5/5 PostHog env vars documented
package.json 5/5 posthog-js dependency added
.gitignore 5/5 .env added to gitignore

App sanity check ⚠️

Criteria Result Description
App builds and runs ⚠️ Missing ssr.noExternal config for posthog-js in vite.config.ts may cause SSR bundling issues
Preserves existing env vars & configs Yes Existing env vars and configs preserved; PostHog vars added as optional
No syntax or type errors Yes All code is syntactically correct
Correct imports/exports Yes posthog-js and posthog-js/react imports are valid
Minimal, focused changes Yes All changes relate to PostHog integration
Pre-existing issues None No pre-existing issues observed

Issues

  • Missing ssr.noExternal for posthog-js in vite.config.ts: Components like _authenticated-routes-layout.tsx, nav-user.tsx, and others import usePostHog from posthog-js/react and are server-rendered by React Router. Per the framework mode docs, add ssr: { noExternal: ['posthog-js'] } to vite.config.ts to prevent SSR bundling errors. [MEDIUM]

Other completed criteria

  • Environment variables documented in .env.example with VITE_PUBLIC_POSTHOG_PROJECT_TOKEN and VITE_PUBLIC_POSTHOG_HOST
  • Env schema in env.server.ts marks PostHog vars as optional, preventing app crashes without PostHog
  • CSP correctly updated with connect-src, script-src, and worker-src directives
  • Build configuration valid with posthog-js in package.json dependencies
  • .env added to .gitignore to prevent secret leakage

PostHog implementation ⚠️

Criteria Result Description
PostHog SDKs installed Yes posthog-js ^1.438.1 added to package.json
PostHog client initialized Yes posthog.init() in entry.client.tsx with defaults: "2026-05-30", wrapped in PostHogProvider
capture() Yes 10+ meaningful capture calls across subscription, org, onboarding, and team flows
identify() Yes posthog.identify(loaderData.id, { email }) in authenticated layout using stable auth user ID
Error tracking Yes PostHogErrorBoundary wraps entire app in entry.client.tsx
Reverse proxy No No reverse proxy or rewrite rules configured

Issues

  • No reverse proxy configured: PostHog requests go directly to us.i.posthog.com (or configured host), making them susceptible to ad blockers. Configure a reverse proxy via React Router rewrites, Vercel rewrites, or PostHog's managed proxy service. [MEDIUM]

Other completed criteria

  • API key loaded from environment variable (window.ENV.VITE_PUBLIC_POSTHOG_PROJECT_TOKEN)
  • API host correctly configured from environment variable (window.ENV.VITE_PUBLIC_POSTHOG_HOST)
  • posthog.reset() called on logout in nav-user.tsx
  • Identify uses stable user.id from auth system with email as person property — correct pattern
  • Ref guard in identify prevents redundant calls on re-renders
  • Dev-only error thrown when PostHog env vars missing — good DX

PostHog insights and events ✅

Filename PostHog events Description
entry.client.tsx PostHogErrorBoundary (captureException) Captures unhandled React errors across the entire app
_authenticated-routes-layout.tsx identify Identifies authenticated users with stable user ID and email
nav-user.tsx reset() Resets PostHog identity on logout
create-subscription-modal-content.tsx subscription_checkout_started Tracks billing interval and tier selection — enriched with properties
create-organization-form-card.tsx organization_created Tracks organization creation
general-organization-settings.tsx organization_settings_saved Tracks org settings updates
invite-by-email-card.tsx team_invite_submitted Tracks team email invitations
invite-link-card.tsx invite_link_copied, invite_link_created, invite_link_deactivated Tracks invite link lifecycle
account-settings.tsx account_settings_saved Tracks account settings updates
onboarding/organization.tsx onboarding_organization_submitted Tracks onboarding organization step
onboarding/user-account.tsx onboarding_user_account_submitted Tracks onboarding user account step

Issues

  • Most events lack enriched properties: Only subscription_checkout_started includes contextual properties (billing_interval, tier). Other events like organization_created, team_invite_submitted, etc. are bare captures with no properties. Adding properties like organization_id, invite_method, or onboarding_step would enable richer analysis. [LOW]

Other completed criteria

  • Events represent real user actions mapping to actual product flows (subscription, onboarding, team management)
  • Events enable product insights — can build onboarding funnel, subscription conversion funnel, team growth tracking
  • No PII in capture properties — email only passed as person property via identify
  • Event names are descriptive, consistent snake_case convention

Reviewed by wizard workbench PR evaluator

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