I wrote this for Popcornly. I didn't want to hand-write a fetch call and a response type for every TMDB endpoint, so the client is generated: Orval reads TMDB's OpenAPI spec and produces typed fetch functions, and a thin layer of services on top groups them the way an app actually uses them.
import 'server-only';
import { TmdbClient } from '@justwicked/tmdb-client';
const tmdbApi = new TmdbClient({
next: { revalidate: 3600, tags: ['tmdb'] },
cache: 'force-cache',
headers: { Authorization: `Bearer ${process.env.AUTH_TOKEN!}` },
});
const trending = await tmdbApi.trending.getAll();
It's built for my own use, but it's public on npm in case it's useful to someone else.