Prerequisites
Before you begin, make sure you have:- Node.js 18+ installed on your machine
- npm, yarn, pnpm, or bun package manager
- A Riot Games developer account (free to create)
Development API keys expire every 24 hours. You’ll need to regenerate them daily or apply for a production key.
# Riot Games API key (development keys expire every 24h)
# Get yours at: https://developer.riotgames.com/
API_KEY=RGAPI-your-api-key-here
# Summoner Riot ID used for get-puuid and UI display
GAME_NAME=YourGameName
TAG_LINE=1234
# Auth (required for auth.js session cookie encryption)
# Generate with: npx auth secret
AUTH_SECRET=
The
GAME_NAME and TAG_LINE are your default summoner credentials used for initial setup. Users can sign in with their own Riot IDs through the login page.# Optional: OpenAI key for match context agent
OPENAI_KEY=sk-your-openai-key
ENABLE_MATCH_AGENT=true
# Timeline compare: value in milliseconds for AI comparison
TIMELINE_COMPARE=180000
NEXT_PUBLIC_TIMELINE_COMPARE=180000
The application will be available at http://localhost:3000.
- Game Name: Your Riot ID without the tag (e.g.,
Faker) - Tag Line: Your tag without the
#symbol (e.g.,KR1) - API Key: Paste the Riot API key you generated in step 1
What’s Next?
Now that you’re up and running:Authentication
Learn how NextAuth secures your Riot credentials
API Reference
Explore the Riot API integration
Troubleshooting
”Invalid API key or Riot account”
This error occurs when:- Your API key has expired (development keys last 24 hours)
- The API key is incorrectly formatted
- Your Game Name or Tag Line is incorrect
”Riot ID not found”
Double-check that your Game Name and Tag Line are correct. You can verify them in the League of Legends client.”Too many requests”
Development API keys have rate limits (20 requests per second, 100 per 2 minutes). Wait a moment and try again.Session Cookie Errors
If you see authentication errors, ensure yourAUTH_SECRET is properly set:
.env.local file.