Skip to main content

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:

  1. server.js: Express server that handles HTTP requests and manages Playwright browser instances

    • Class VividSeatsLoginServer encapsulates all server logic
    • Manages browser lifecycle and token extraction
    • Provides multiple endpoints for different extraction needs
  2. 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
  3. API Endpoints:

    • GET /health - Basic health check
    • POST /get-auth-token - Returns only the auth token
    • POST /login-and-extract - Returns full response with token and metadata
    • POST /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-browsers after dependency updates
  • The service connects to external network listings-dev when running in Docker
  • No formal testing framework - use client.js for manual testing
  • Environment variables VIVIDSEATS_EMAIL and VIVIDSEATS_PASSWORD can be set for default credentials