Skip to content

[CI] (f51b3be) react-native/react-native-saas - #2644

Closed
wizard-ci-bot[bot] wants to merge 1 commit into
mainfrom
wizard-ci-f51b3be-react-native-react-native-saas
Closed

wizard-ci-bot[bot] wants to merge 1 commit into
mainfrom
wizard-ci-f51b3be-react-native-react-native-saas

Conversation

@wizard-ci-bot

@wizard-ci-bot wizard-ci-bot Bot commented Jul 9, 2026

Copy link
Copy Markdown

Automated wizard CI run

Source: wizard-pr
Trigger ID: f51b3be
App: react-native/react-native-saas
App directory: apps/react-native/react-native-saas
Workbench branch: wizard-ci-f51b3be-react-native-react-native-saas
Wizard branch: release-please--branches--main--components--wizard
Context Mill branch: main
PostHog (MCP) branch: master
Timestamp: 2026-07-09T22:40:56.568Z
Duration: 422.7s

YARA Scanner

✓ 55 tool calls scanned, 0 violations detected

No violations: ✓ 55 clean scans

@wizard-ci-bot

wizard-ci-bot Bot commented Jul 9, 2026

Copy link
Copy Markdown
Author

Now I have all the context needed. Here's my evaluation:


PR Evaluation Report

Summary

This PR integrates PostHog into a React Native SaaS app using the posthog-react-native SDK. It adds a PostHog client singleton configured via react-native-config environment variables, wraps the navigation stack with PostHogProvider, implements manual screen tracking, user identification on sign-in, and captures business events across auth, team, project, and member management flows.

Files changed Lines added Lines removed
9 +125 -13

Confidence score: 4/5 👍

  • Email used as distinct_id: posthog.identify(email, ...) uses the raw email address as the distinct ID instead of a stable user ID (e.g., from the API response). This causes fragmented analytics data if users change their email. Should use a database user ID from the sign-in response. [CRITICAL]
  • Incorrect identify properties format: The call posthog.identify(email, { : { email } }) double-nests the key. The React Native SDK's `identify` method already wraps the second argument as internally, so this results in : { : { email } }. Should be posthog.identify(userId, { email }). [MEDIUM]
  • No error tracking configured: No captureException calls or error boundary setup. Caught errors in sagas are only tracked as custom events (user_sign_in_failed, etc.) rather than using PostHog's error tracking system. [MEDIUM]
  • No .env.example file: Environment variables POSTHOG_PROJECT_TOKEN and POSTHOG_HOST are not documented anywhere for collaborators. The wizard's own report acknowledges this as a TODO. [MEDIUM]

File changes

Filename Score Description
src/config/posthog.js 3/5 New PostHog singleton config with env vars, sensible defaults, and a disabled guard for unconfigured keys
src/routes.js 5/5 Wraps navigation with PostHogProvider, adds manual screen tracking via onStateChange
src/store/modules/auth/sagas.js 2/5 Adds identify (with incorrect distinct_id and double-nested ``), capture on sign-in/out, and reset on logout
src/store/modules/members/sagas.js 4/5 Captures member invite and role update events with relevant properties
src/store/modules/projects/sagas.js 4/5 Captures project creation events with title property
src/store/modules/teams/sagas.js 4/5 Captures team creation and selection events with properties
package.json 5/5 Adds posthog-react-native and required peer dependencies
.gitignore 5/5 Adds .env to gitignore
posthog-setup-report.md 5/5 Comprehensive setup report with event table and next steps

App sanity check ⚠️

Criteria Result Description
App builds and runs Yes No syntax errors; correct peer dependencies added
Preserves existing env vars & configs Yes Existing code untouched except for PostHog additions
No syntax or type errors Yes All JS syntax is valid
Correct imports/exports Yes posthog-react-native and react-native-config imports are correct
Minimal, focused changes Yes All changes relate to PostHog integration
Pre-existing issues None —

Issues

  • No .env.example documentation: The required environment variables POSTHOG_PROJECT_TOKEN and POSTHOG_HOST are not documented in any example file or README. Collaborators won't know what env vars to set. [MEDIUM]

Other completed criteria

  • Build configuration is valid — peer dependencies for posthog-react-native correctly added
  • .env properly gitignored to prevent secret leakage
  • Existing navigation, saga, and store patterns preserved

PostHog implementation ⚠️

Criteria Result Description
PostHog SDKs installed Yes posthog-react-native v4.55.0 added with peer deps (react-native-device-info, react-native-localize, react-native-config, react-native-svg)
PostHog client initialized Yes Singleton via new PostHog(token, { host, ... }) in src/config/posthog.js with disabled guard
capture() Yes 12 meaningful capture calls across auth, team, project, and member sagas
identify() No Uses raw email as distinct_id and double-nests `` properties
Error tracking No No captureException or error tracking setup; errors only tracked as custom events
Reverse proxy N/A React Native mobile app — reverse proxy is not applicable

Issues

  • Email used as distinct_id: posthog.identify(email, ...) uses the user's email as the distinct ID. This is fragile — if a user changes their email, they become a new person in PostHog. The sign-in API response likely contains a user ID or the token could be decoded to extract one. Use a stable user ID instead. [CRITICAL]
  • **Double-nested in identify**: The React Native SDK's `identify(distinctId, userProperties)` method internally wraps the second argument as. Passing { : { email } } results in the properties being sent as : { : { email } }, meaning the email will not be set correctly on the person profile. Fix: posthog.identify(userId, { email }). [MEDIUM]
  • No error tracking: No captureException calls anywhere. Saga catch blocks capture custom failure events but don't leverage PostHog's error tracking for stack traces and exception grouping. [MEDIUM]
  • No returning-user identify: The init saga restores tokens from AsyncStorage on app restart but never calls posthog.identify, leaving returning sessions on anonymous distinct IDs. The wizard's own report flags this. [MEDIUM]

Other completed criteria

  • API key correctly loaded from react-native-config environment variable
  • Host configured with sensible default (https://us.i.posthog.com)
  • posthog.reset() correctly called on sign-out
  • PostHogProvider correctly wraps the navigation stack inside NavigationContainer
  • Manual screen tracking via onStateChange with previous screen tracking
  • captureAppLifecycleEvents: true enables lifecycle event tracking
  • Touch autocapture enabled via captureTouches: true

PostHog insights and events ⚠️

Filename PostHog events Description
src/routes.js screen (via posthog.screen()) Tracks screen navigation changes with previous screen context
src/store/modules/auth/sagas.js user_signed_in, user_sign_in_failed, user_signed_out Auth lifecycle events with demo_mode flag; identify on sign-in
src/store/modules/teams/sagas.js team_selected, team_created, team_create_failed Team management events with name/slug properties
src/store/modules/projects/sagas.js project_created, project_create_failed Project creation events with title property
src/store/modules/members/sagas.js member_invited, member_invite_failed, member_role_updated, member_role_update_failed Member management events with member_id property

Issues

  • No error tracking events: Failure events like user_sign_in_failed are custom captures, not captureException calls. They lose stack traces and error context. Consider using posthog.captureException(err) in catch blocks alongside the custom events. [MEDIUM]

Other completed criteria

  • Events represent real user actions (sign-in, team creation, member invites, etc.)
  • Events enable product insights — funnels from sign-in → team selection → project creation are possible
  • Events include contextual properties (demo_mode, team_name, project_title, member_id)
  • No PII in capture event properties — email is only in identify, not in capture properties
  • Event names follow consistent snake_case convention and are descriptive

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