Skip to main content

Purpose

Creates and manages Browserbase browser sessions for live website visualization on the marketing site. Shows visitors a real-time browser view of their website being β€œscanned”.

Architecture

Two-Phase Flow

  1. Pre-warm - Create session without URL (fast, session ready)
  2. Navigate - Send URL to existing session (navigation happens in background)
This allows the frontend to show the browser embed immediately while navigation loads.

Internal Services

Code Location

Session Caching

Sessions are cached per client IP + viewport width for 5 minutes. This prevents creating duplicate sessions for the same visitor.

Scroll Animation

After navigation, the background task performs automated scrolling:
  1. Wait 2 seconds
  2. Smooth scroll down 1.5 viewport heights
  3. Wait 5 seconds
  4. Scroll down another viewport height
This creates a β€œscanning” visual effect.

Rate Limiting