Skip to main content

skybox_token_extractor

Playwright-based service for extracting X-Auth-Tokens from VividSeats Skybox platform.

Overview

The skybox_token_extractor provides:

  • Automated login to VividSeats Skybox
  • X-Auth-Token extraction from request headers
  • RESTful API endpoints
  • Docker support for easy deployment

Technology Stack

  • Runtime: Node.js
  • Framework: Express 5.x
  • Automation: Playwright
  • Language: JavaScript
  • Containerization: Docker

Getting Started

Prerequisites

  • Node.js 18+
  • Docker (optional, for containerized deployment)
  • Playwright browsers

Setup

  1. Install dependencies:

    bun install
  2. Install Playwright browsers:

    bun run install-browsers
  3. Start development server:

    bun run dev
  4. Or use Docker:

    docker-compose up -d

Key Commands

Development

  • bun run dev - Start development server (nodemon)
  • bun start - Start production server
  • bun run install-browsers - Install Playwright browsers

Testing

  • node diagnostic.js - Run diagnostics
  • node client.js - Test the service

Docker

  • docker-compose up -d - Start with Docker
  • docker-compose logs -f - View logs
  • docker-compose down - Stop services

API Endpoints

Health Check

GET /health

Returns service health status.

Extract Auth Token

POST /get-auth-token
Content-Type: application/json

{
"email": "your-email@example.com",
"password": "your-password",
"headless": true
}

Returns:

{
"success": true,
"authToken": "extracted-x-auth-token",
"message": "X-Auth-Token extracted successfully"
}

Login and Extract

POST /login-and-extract
POST /vividseats-login

Similar to /get-auth-token but returns full response with metadata.

Architecture

The service follows a simple architecture:

  1. server.js: Express server managing 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

Environment Variables

Configured via environment variables or .env file:

  • VIVIDSEATS_EMAIL - VividSeats account email
  • VIVIDSEATS_PASSWORD - VividSeats account password
  • PORT - Server port (default: 3000, mapped to 3005 in Docker)
  • NODE_ENV - Environment (development/production)

Docker Setup

Using Docker Compose

# Build and start
docker-compose up -d

# View logs
docker-compose logs -f

# Stop
docker-compose down

The service runs on port 3000 internally, mapped to 3005 in Docker.

Development Notes

  • The service runs on port 3000 internally, mapped to 3005 in Docker
  • Playwright requires browser binaries - run bun run install-browsers after dependency updates
  • The service connects to external network listings-dev when running in Docker

Documentation