Skip to main content

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.

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, 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

1

Create a free TMDB account

Visit https://www.themoviedb.org and register. No credit card is required.
2

Open the API settings page

After logging in, go to Settings › API.
3

Request a Developer API key

Click Request an API Key and select the Developer option. Approval is instant for personal projects.
4

Copy the v3 key

Under API Key (v3 auth), copy the 32-character hex string. This is the value you will paste into your .env file.

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
TMDB_API_KEY=your_key_here
Never commit your .env file to version control. It is already listed in .gitignore — verify that entry is present before your first git push.

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:
RequestEndpoint
Movie discovery (list of films)https://api.themoviedb.org/3/discover/movie
Movie detail with casthttps://api.themoviedb.org/3/movie/{id}?append_to_response=credits
Both calls are made server-to-server, keeping your key invisible to players.

Production Deployment

When deploying to Vercel, environment variables must be added through the dashboard — .env files are not uploaded.
1

Open your project settings

In the Vercel dashboard select your project, then navigate to Settings › Environment Variables.
2

Add the variable

Set the Name field to exactly TMDB_API_KEY (case-sensitive) and paste your v3 key into the Value field.
3

Select target environments

Enable the variable for Production at minimum. Add it to Preview and Development environments if you want parity across branches.
4

Redeploy

Trigger a new deployment after saving. Vercel only injects environment variables at build/start time, so existing deployments will not pick up the change automatically.

Environment Variables Reference

VariableRequiredDescription
TMDB_API_KEYYesTMDB v3 API key for movie discovery and detail fetching

Build docs developers (and LLMs) love