What is the Sidecar?
The Spotlight Sidecar is a lightweight local proxy server that sits between your application and the Spotlight UI. It’s the backbone of Spotlight’s real-time debugging capabilities.
How It Works
Your Application → Sentry SDK → Sidecar Server → Spotlight UI ↓ [Stores & Streams] Errors, Traces, LogsThe sidecar:
- Receives telemetry data from your application via Sentry SDKs
- Stores events in memory for quick access
- Streams events to connected UIs via Server-Sent Events (SSE)
- Provides APIs for querying historical data (used by MCP tools)
Key Features
Real-Time Event Streaming
Uses Server-Sent Events (SSE) to push events to the UI as they happen. No polling, no delays - see errors and traces the moment they occur.
In-Memory Storage
Events are buffered in memory, allowing you to:
- Browse historical events during your session
- Query past errors and traces
- Analyze patterns over time
Multiple Connection Modes
The sidecar supports different ways to run:
- Standalone: Run independently and connect any UI
- Embedded: Automatically started by framework integrations
- CLI-wrapped: Started by
spotlightcommands - Desktop app: Bundled with the Spotlight desktop application
Built-in UI
The sidecar includes a web-based UI accessible at http://localhost:8969 (default port):
- No additional setup required
- View events directly in your browser
- Works alongside desktop app and MCP clients
Configuration
Default Settings
The sidecar comes pre-configured with sensible defaults:
- Port: 8969
- Event endpoint:
http://localhost:8969/stream - UI endpoint:
http://localhost:8969
Custom Port
You can configure the port in several ways:
Via CLI:
spotlight -p 3000Via SDK:
import sentry_sdk
sentry_sdk.init( spotlight="http://localhost:3000/stream",)Running the Sidecar
Choose the method that fits your workflow:
Quick Start Options
Standalone Server:
# Using CLIspotlight server
# Using npxnpx @spotlightjs/spotlightWith Your Application:
# Run your app with Spotlightspotlight run npm run devFor MCP Integration:
# Start with MCP supportspotlight mcpArchitecture
Communication Flow
- Your Application sends telemetry to the sidecar via HTTP POST
- Sidecar validates, stores, and broadcasts events
- UI Clients receive events via SSE connections
- MCP Clients query events via stdio protocol
Multiple Clients
A single sidecar instance can serve multiple clients simultaneously:
- Browser-based UI - View in any web browser
- Desktop app - Dedicated application window
- MCP clients - AI assistants (Cursor, Claude, etc.)
- Multiple apps - Different services sending to the same sidecar
All clients receive the same events in real-time.
Data Persistence
Events are stored in memory only by design:
Benefits:
- ✅ Fast access and streaming
- ✅ No disk I/O overhead
- ✅ Automatic cleanup on restart
Trade-off:
- ⚠️ Events are lost when sidecar stops
This is intentional - Spotlight is for active development, not long-term storage.
SDK Integration
Your application sends events to the sidecar via Sentry SDKs.
Quick Setup
Most SDKs support automatic detection via environment variable:
export SENTRY_SPOTLIGHT=1# or specify custom URLexport SENTRY_SPOTLIGHT=http://localhost:8969/streamOr configure explicitly:
import * as Sentry from '@sentry/node';
Sentry.init({ spotlight: process.env.NODE_ENV === 'development', // or explicitly: // spotlight: "http://localhost:8969/stream"});import sentry_sdk
sentry_sdk.init( spotlight=True, # Uses SENTRY_SPOTLIGHT env var # or explicitly: # spotlight="http://localhost:8969/stream")import * as Sentry from '@sentry/browser';
Sentry.init({ integrations: [Sentry.spotlightBrowserIntegration()],});Use Cases
Local Development
Run the sidecar alongside your development server to see errors and traces as you code.
Integration Testing
Start the sidecar during tests to capture and analyze test failures with full context.
Mobile Development
Point your mobile app to your machine’s sidecar to debug on real devices:
spotlight: "http://192.168.1.100:8969/stream"Microservices
Run one sidecar and point all your services to it for unified debugging across your stack.
When to Use Each Method
Use CLI When:
- You want simple command-line control
- You need to wrap your application
- You want to stream events to terminal
Use NPX When:
- You want the quickest setup
- You don’t need the CLI features
- You just want the sidecar running
Use Webpack Plugin When:
- You’re using webpack
- You want automatic sidecar lifecycle management
- You want sidecar to start/stop with your build
Use Docker When:
- You’re containerizing your dev environment
- You need isolation from your host system
- You’re deploying to a remote dev server
Use Desktop App When:
- You want a GUI experience
- You prefer desktop applications
- You’re developing mobile or headless apps
Learn more about Desktop App →
Next Steps
- Learn about CLI commands - Control sidecar via terminal
- MCP Integration - Connect to AI assistants