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
- Pre-warm - Create session without URL (fast, session ready)
- Navigate - Send URL to existing session (navigation happens in background)
Internal Services
| Service | Purpose |
|---|---|
| _create_browserbase_session | Creates session via Browserbase API |
| _navigate_in_background | Playwright navigation + scroll animation |
| _client_key | IP-based client identification |
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:- Wait 2 seconds
- Smooth scroll down 1.5 viewport heights
- Wait 5 seconds
- Scroll down another viewport height
Rate Limiting
| Endpoint | Limit |
|---|---|
| Create session | 60/minute |
| End session | 10/minute |