The Movie Database-ondersteuning

Hi, im building a web app with your api and am using render.com for deploying my site. Im using their environment settings and it is properly using the key. However all api requests are still denied access with the error that the key is invalid. I tried everything locally with the same key and it seems to work fine. (the issue may not be with the api directly but im still asking here to make sure)

const BASE_URL = 'https://api.themoviedb.org/3';
const IMAGE_BASE_URL = 'https://image.tmdb.org/t/p/w500';

console.log('API key:', import.meta.env.VITE_API_KEY);

const HEADERS = {
  accept: 'application/json',
  Authorization: `import.meta.env.VITE_API_KEY`,
};

export const fetchMovies = async () => {
  const url = `${BASE_URL}/discover/movie?include_adult=false&include_video=false&language=en-US&page=1&sort_by=popularity.desc`;

this is how im logging and requesting the data. again, it works fine locally ive also tried using the bearer key but same problem

Film of tv-serie niet gevonden? Meld je aan om deze toe te voegen.

Wereldwijd

s focus op zoekbalk
p open profielmenu
esc sluit een open venster
? open sneltoetsen venster

Op media pagina's

b ga terug (of ga naar bovenliggend item)
e ga naar beweken

Op tv-seizoenspagina's

(rechter pijl) ga naar volgende seizoen
(linker pijl) ga naar vorig seizoen

Op pagina's met tv-series

(rechter pijl) ga naar volgende aflevering
(linker pijl) ga naar vorige aflevering

Op alle afbeeldingspagina's

a open venster afbeelding toevoegen

Op alle bewerkte pagina's

t open vertaalmenu
ctrl+ s verstuur formulier

Op discussiepagina's

n start nieuwe discussie
w Verander kijk status
p privé of openbaar
c schakelen sluiten/openen
a open activiteit
r beantwoord discussie
l ga naar laatste antwoord
ctrl+ enter verstuur uw bericht
(rechter pijl) volgende pagina
(linker pijl) vorige pagina

Instellingen

Want to rate or add this item to a list?

Inloggen