Overview
Agent LoL uses environment variables to configure API keys, authentication, and application features. Copy.env.example to .env.local and configure the required variables.
Required Variables
These variables are essential for the application to function.Your Riot Games API key from developer.riotgames.com
Your League of Legends summoner name (without the tag)Used for PUUID retrieval and UI display throughout the application.
Your Riot ID tag line (the numbers after the # in your Riot ID)Do not include the # symbol - only the alphanumeric tag.
Secret key for NextAuth.js session cookie encryptionThis command automatically generates a cryptographically secure secret and adds it to your
.env.local file.Optional Variables
These variables enable additional features and customization.OpenAI Integration
Your OpenAI API key for AI-powered coaching featuresRequired only if you want to enable the match context agent. Get your key from platform.openai.com.
Enable or disable the AI coaching agentSet to
true to activate GPT-4-mini powered analysis of match timelines. Requires OPENAI_KEY to be configured.Timeline Configuration
Timestamp in milliseconds for AI comparison and analysisDetermines which point in the match timeline the AI agent analyzes. Common values:
60000= 1 minute180000= 3 minutes (default)300000= 5 minutes
Client-side timeline start position for the 2.5D replay viewer
The
NEXT_PUBLIC_ prefix makes this variable accessible in client-side code. It should match the value of TIMELINE_COMPARE to ensure the replay starts at the same time analyzed by the AI.Client-Side Variables
Variables prefixed withNEXT_PUBLIC_ are exposed to the browser and can be accessed in client-side React components.
Currently, only NEXT_PUBLIC_TIMELINE_COMPARE uses this prefix to configure the replay viewer’s start position.
Example Configuration
Here’s a complete example with all variables configured:.env.local
Environment-Specific Files
Next.js supports multiple environment files with different priorities:.env.local- Loaded in all environments, gitignored by default.env.development- Loaded duringnpm run dev.env.production- Loaded duringnpm run buildandnpm start
Validation
The application validates required credentials during authentication inauth.js:10-19:
- Game Name: Must be at least 2 characters
- Tag Line: Required (automatically strips the # prefix)
- API Key: Required
