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

Kan ’n rolprent of TV-program nie vind nie? Teken aan om dit te skep.

Globaal

s fokus op soekbalk
p open profielkieslys
esc sluit ’n oop venster
? open sneltoetsvenster

Op mediablaaie

b gaan terug (na ouer waar van toepassing)
e gaan na wysigblad

Op TV-seisoenblaaie

(regterpyl) gaan na volgende seisoen
(linkerpyl) gaan na vorige seisoen

Op TV-episodeblaaie

(regterpyl) gaan na volgende episode
(linkerpyl) gaan na vorige episode

Op alle beeldblaaie

a open beeldtoevoegvenster

Op alle wysigingsblaaie

t open vertaalkieser
ctrl+ s dien form in

Op besprekingsblaaie

n skep nuwe bespreking
w tokkel kykstatus
p tokkel openbaar/privaat
c tokkel maak oop/toe
a open aktiwiteit
r reageer op bespreking
l gaan na laaste reaksie
ctrl+ enter dien u boodskap in
(regterpyl) volgende blad
(linkerpyl) vorige blad

Instellings

Wil u hierdie item gradeer of tot ’n lys toevoeg?

Teken aan