Quick Start Guide
This section provides an overview of how to quickly get started using the TMDB wrapper.
You need a TMDB credential to use this library. The client supports both a Bearer token (JWT Read Access Token, recommended) and a legacy v3 API key. See the Authentication guide for details.
References:
- https://www.themoviedb.org/settings/api - Your API key and Bearer token
- https://developer.themoviedb.org/docs/getting-started - Getting Started Guide
Install
npm install @lorenzopant/tmdbCreate TMDB object
Pass your Bearer token or v3 API key as the first argument:
// With a Bearer token (recommended)
export const tmdb = new TMDB(process.env.TMDB_BEARER_TOKEN!);
// With a v3 API key
export const tmdb = new TMDB(process.env.TMDB_API_KEY!);Use TMDB methods
Once you've initialized the TMDB client, you can start using the API methods. Here's how to search for a movie:
const results = await tmdb.search.movies({ query: "Inception" });
console.log(results.results);You’ll get a paginated response with a list of matching movies, including their titles, poster paths, IDs, and other metadata.
What's Next?
Authentication
Learn about Bearer tokens vs v3 API keys
Features
Deduplication, error handling, logging, and more
API Reference
Discover all available methods
For the full reference, visit the TMDB Developer Documentation and check out each endpoint.