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 configures a PostHog reverse proxy to bypass ad blockers by routing analytics requests through the application's own domain instead of directly to PostHog servers. The configuration adds URL rewrite rules in next.config.ts to proxy requests from /ingest to PostHog's servers, and updates the PostHog client initialization to use the local /ingest endpoint instead of the external PostHog host. This approach helps prevent ad blockers from interfering with analytics collection while maintaining full PostHog functionality.

⏱️ Estimated Review Time: 5-15 minutes

💡 Review Order Suggestion
Order File Path
1 surfsense_web/next.config.ts
2 surfsense_web/instrumentation-client.ts

Need help? Join our Discord

Analyze latest changes

- Updated PostHog initialization to use a reverse proxy for API requests.
- Added rewrites in Next.js configuration to route requests through the domain.
- Set ui_host for proper toolbar functionality and ensured correct pageview tracking.
@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 Building Building Preview, Comment Dec 25, 2025 10:23pm

@MODSetter MODSetter merged commit c3678e4 into main Dec 25, 2025
4 of 6 checks passed
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 0501463..ad5f0a6

✨ No bugs found, your code is sparkling clean

✅ Files analyzed, no issues (2)

surfsense_web/instrumentation-client.ts
surfsense_web/next.config.ts

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