# AvanzaCast Token Server (dev) Lightweight Express token server used by AvanzaCast for E2E/dev. It returns a random token and livekit URL, and can optionally store sessions in Redis. Note: `STUDIO_URL` is optional — studio UI was migrated into `broadcast-panel`, so the frontend uses the token directly. Running locally: ```bash cd packages/token-server npm install npm run start # server listens on http://localhost:4000 ``` Docker build & run: ```bash docker build -t avanzacast-token-server:dev . # run with host networking so the container can reach host redis (Linux) docker run --network host -e REDIS_URL=redis://127.0.0.1:6379 -e ALLOWED_ORIGINS=https://avanzacast-broadcastpanel.bfzqqk.easypanel.host -e LIVEKIT_WS_URL=wss://livekit-server.bfzqqk.easypanel.host avanzacast-token-server:dev ``` Docker compose (host network): ```bash cd packages/token-server docker-compose up --build -d ``` Environment variables: - ALLOWED_ORIGINS (comma separated) - default: https://avanzacast-broadcastpanel.bfzqqk.easypanel.host - LIVEKIT_WS_URL - livekit websocket url - REDIS_URL - redis url (default redis://127.0.0.1:6379) - PORT - listening port (default 4000) Redis usage - If `REDIS_URL` is provided and accessible, token sessions will be stored under key `session:` with TTL (default 3600s). - If Redis is not available, server still returns tokens but does not store sessions.