{import axios from 'axios';
let API_KEY = "MyClientId";
let accessToken;
axios.post('https://id.twitch.tv/oauth2/token?client_id=MyClientId&client_secret=MyClientSecretId&grant_type=client_credentials')
.then(response => {
accessToken = response.data.access_token;
console.log(accessToken); // shows the token fine here
let twitchApi = axios.create({
headers: {
"Authorization": "Bearer " + accessToken,
"Client-ID": API_KEY
}
});
})
export default twitchApi;}
It’s dumbest fix as I have no idea what else you are doing here