La Mubi fetches all movie data at runtime through a server-side Next.js API route. That route authenticates with The Movie Database (TMDB) using a single environment variable,Documentation Index
Fetch the complete documentation index at: https://mintlify.com/dlampatricio/lamubi/llms.txt
Use this file to discover all available pages before exploring further.
TMDB_API_KEY. Without it the server will not start movie discovery and the game cannot load any films. TMDB accounts and v3 API keys are free and require no payment information.
Obtaining a TMDB API Key
Create a free TMDB account
Visit https://www.themoviedb.org and register. No credit card is required.
Open the API settings page
After logging in, go to Settings › API.
Request a Developer API key
Click Request an API Key and select the Developer option. Approval is instant for personal projects.
Creating the .env File
Create a file named.env at the root of your La Mubi project (the same directory that contains package.json) and add the following line, replacing your_key_here with the key you copied:
.env
How It’s Used
TMDB_API_KEY is consumed exclusively inside the server-side Next.js route handler at GET /api/movies. The key is read with process.env.TMDB_API_KEY and is never serialised into the client bundle or exposed to the browser.
The route makes two types of TMDB requests:
| Request | Endpoint |
|---|---|
| Movie discovery (list of films) | https://api.themoviedb.org/3/discover/movie |
| Movie detail with cast | https://api.themoviedb.org/3/movie/{id}?append_to_response=credits |
Production Deployment
When deploying to Vercel, environment variables must be added through the dashboard —.env files are not uploaded.
Open your project settings
In the Vercel dashboard select your project, then navigate to Settings › Environment Variables.
Add the variable
Set the Name field to exactly
TMDB_API_KEY (case-sensitive) and paste your v3 key into the Value field.Select target environments
Enable the variable for Production at minimum. Add it to Preview and Development environments if you want parity across branches.
Environment Variables Reference
| Variable | Required | Description |
|---|---|---|
TMDB_API_KEY | Yes | TMDB v3 API key for movie discovery and detail fetching |