This guide explains how to configure AIOLists using environment variables for advanced setups.
Create a .env file in the root directory:
# TMDB Configuration
TMDB_REDIRECT_URI=https://aiolists.elfhosted.com/
TMDB_BEARER_TOKEN=eyJhbGciOiJIUzI1NiJ9...- Purpose: Where users are redirected after TMDB authentication
- Default: None (manual process)
- Required: No
- Example:
https://aiolists.elfhosted.com/
- Purpose: Your TMDB Read Access Token
- Default: None (enter it in the UI)
- Required: No
- Example:
eyJhbGciOiJIUzI1NiJ9...
- The TMDB Bearer Token field is hidden in the UI
- Users don't need to provide their own token
- TMDB features work automatically
- "Connect to TMDB" button redirects directly to TMDB
- No manual code copying required
- Fully automated OAuth flow
- Users get redirected back to your app after authentication
- Go to https://www.themoviedb.org/settings/api
- Create an API key if you don't have one
- Copy the "Read Access Token" (starts with
eyJ)
For production deployments, set these environment variables in your hosting platform:
Heroku:
heroku config:set TMDB_BEARER_TOKEN=your_token_here
heroku config:set TMDB_REDIRECT_URI=https://yourapp.herokuapp.com/Docker:
docker run -e TMDB_BEARER_TOKEN=your_token_here -e TMDB_REDIRECT_URI=https://yourapp.com/ aiolistsRailway/Render: Add environment variables in your platform's dashboard.
- Never commit
.envfiles to version control - Use secure HTTPS URLs for redirect URIs in production
- Keep your bearer tokens private
- Rotate tokens periodically for security