File size: 389 Bytes
4082425
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
const { config } = require('./config');

function getTmdbApiKey() {
  if (config.tmdbApiKeys && config.tmdbApiKeys.length) {
    const idx = Math.floor(Math.random() * config.tmdbApiKeys.length);
    return config.tmdbApiKeys[idx];
  }
  // Fallback legacy single value (config or env)
  return config.tmdbApiKey || process.env.TMDB_API_KEY || null;
}

module.exports = { getTmdbApiKey };