🍿 @lorenzopant/tmdb
Getting started

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:

Install

npm install @lorenzopant/tmdb

Create 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?

For the full reference, visit the TMDB Developer Documentation and check out each endpoint.

On this page