MCPcopy Create free account
hub / github.com/Vishal-raj-1/Awesome-JavaScript-Projects / _getToken

Function _getToken

assets/js/SpotifyFinder.js:6–17  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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) => {

Callers 1

getTokenFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected