| 4 | |
| 5 | //Function to get Token |
| 6 | const _getToken = async () => { |
| 7 | const result = await fetch('https://accounts.spotify.com/api/token', { |
| 8 | method: 'POST', |
| 9 | headers: { |
| 10 | 'Content-Type': 'application/x-www-form-urlencoded', |
| 11 | Authorization: 'Basic ' + btoa('2a3547845b8b4aac94ec6a200722186e' + ':' + '2c766ffbd67e4b23b0e44e77d289a230'), |
| 12 | }, |
| 13 | body: 'grant_type=client_credentials', |
| 14 | }) |
| 15 | const data = await result.json() |
| 16 | return data.access_token |
| 17 | } |
| 18 | |
| 19 | //Function to get Genres |
| 20 | const _getGenres = async (token) => { |