CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Project Overview
Skybox Token Extractor is a Playwright-based service that extracts X-Auth-Tokens from VividSeats Skybox platform through automated login. It provides RESTful API endpoints for authentication token extraction.
Essential Commands
Development
# Install dependencies
npm install
# Install Playwright browsers (required for first-time setup)
npm run install-browsers
# Start development server with auto-reload
npm run dev
# Start production server
npm start
# Run diagnostics to check system requirements
node diagnostic.js
# Test the service
node client.js
Docker Operations
# Build and run with Docker Compose
docker-compose up --build
# Run in detached mode
docker-compose up -d
# Check logs
docker-compose logs -f
# Stop services
docker-compose down
Architecture
The service follows a simple architecture:
-
server.js: Express server that handles HTTP requests and manages Playwright browser instances
- Class
VividSeatsLoginServerencapsulates all server logic - Manages browser lifecycle and token extraction
- Provides multiple endpoints for different extraction needs
- Class
-
Authentication Flow:
- Browser automation navigates to VividSeats login page
- Fills credentials and submits form
- Intercepts network requests to capture X-Auth-Token from response headers
- Returns token or full response data based on endpoint used
-
API Endpoints:
GET /health- Basic health checkPOST /get-auth-token- Returns only the auth tokenPOST /login-and-extract- Returns full response with token and metadataPOST /vividseats-login- VividSeats-specific endpoint (same as login-and-extract)
Key Development Notes
- The service runs on port 3000 internally, mapped to 3005 in Docker
- Playwright requires browser binaries - run
npm run install-browsersafter dependency updates - The service connects to external network
listings-devwhen running in Docker - No formal testing framework - use
client.jsfor manual testing - Environment variables
VIVIDSEATS_EMAILandVIVIDSEATS_PASSWORDcan be set for default credentials