Skip to content

Conversation

@MODSetter
Copy link
Owner

@MODSetter MODSetter commented Dec 25, 2025

Description

Motivation and Context

FIX #

Screenshots

API Changes

  • This PR includes API changes

Change Type

  • Bug fix
  • New feature
  • Performance improvement
  • Refactoring
  • Documentation
  • Dependency/Build system
  • Breaking change
  • Other (specify):

Testing Performed

  • Tested locally
  • Manual/QA verification

Checklist

  • Follows project coding standards and conventions
  • Documentation updated as needed
  • Dependencies updated as needed
  • No lint/build errors or new warnings
  • All relevant tests are passing

High-level PR Summary

This PR integrates PostHog analytics into the SurfSense web application to track user behavior and product usage. It adds the posthog-js package, creates a centralized analytics utility with typed tracking functions, and instruments key user actions including authentication (sign up, login), search space operations, document management, connector operations, chat interactions, podcast generation, LLM configuration, and invite management. The implementation includes a PostHogProvider component for initialization and automatic user identification.

⏱️ Estimated Review Time: 15-30 minutes

💡 Review Order Suggestion
Order File Path
1 surfsense_web/.env.example
2 surfsense_web/package.json
3 surfsense_web/pnpm-lock.yaml
4 surfsense_web/lib/analytics.ts
5 surfsense_web/components/providers/PostHogProvider.tsx
6 surfsense_web/app/layout.tsx
7 surfsense_web/app/(home)/register/page.tsx
8 surfsense_web/components/TokenHandler.tsx
9 surfsense_web/atoms/search-spaces/search-space-mutation.atoms.ts
10 surfsense_web/atoms/documents/document-mutation.atoms.ts
11 surfsense_web/hooks/use-search-source-connectors.ts
12 surfsense_web/atoms/new-llm-config/new-llm-config-mutation.atoms.ts
13 surfsense_web/atoms/invites/invites-mutation.atoms.ts
14 surfsense_web/lib/chat/thread-persistence.ts
15 surfsense_web/app/dashboard/[search_space_id]/new-chat/[[...chat_id]]/page.tsx
16 surfsense_web/components/sidebar/AppSidebarProvider.tsx
17 surfsense_web/components/sidebar/all-chats-sidebar.tsx
18 surfsense_web/components/tool-ui/generate-podcast.tsx

Need help? Join our Discord

Analyze latest changes

@vercel
Copy link

vercel bot commented Dec 25, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
surf-sense-frontend Ready Ready Preview, Comment Dec 25, 2025 9:55pm

Copy link

@recurseml recurseml bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review by RecurseML

🔍 Review performed on 80e4f1b..c96be7d

✨ No bugs found, your code is sparkling clean

✅ Files analyzed, no issues (18)

surfsense_web/.env.example
surfsense_web/app/(home)/register/page.tsx
surfsense_web/app/dashboard/[search_space_id]/new-chat/[[...chat_id]]/page.tsx
surfsense_web/app/layout.tsx
surfsense_web/atoms/documents/document-mutation.atoms.ts
surfsense_web/atoms/invites/invites-mutation.atoms.ts
surfsense_web/atoms/new-llm-config/new-llm-config-mutation.atoms.ts
surfsense_web/atoms/search-spaces/search-space-mutation.atoms.ts
surfsense_web/components/TokenHandler.tsx
surfsense_web/components/providers/PostHogProvider.tsx
surfsense_web/components/sidebar/AppSidebarProvider.tsx
surfsense_web/components/sidebar/all-chats-sidebar.tsx
surfsense_web/components/tool-ui/generate-podcast.tsx
surfsense_web/hooks/use-search-source-connectors.ts
surfsense_web/lib/analytics.ts
surfsense_web/lib/chat/thread-persistence.ts
surfsense_web/package.json
surfsense_web/pnpm-lock.yaml

@MODSetter MODSetter merged commit 0501463 into main Dec 25, 2025
5 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants