The calls are asynchronous so that they do not block UI updates and the page stays responsive to the user.
What you should do instead of disabling async is use the callback function to fire the additional request, along the lines of:
// -snip-
success: function(token) {
console.log(token);
// token will be something along the lines of
// "{\"access_token\":\"sometoken\",\"refresh_token\":\"\",\"expires_in":3600,\"scope\":[]}"
// parse the json string in token, see JSON.parse()
// call getStream with the parsedData.access_token
}
})
function getStream(token) {
$.ajax({
type: "GET",
url: "https://api.twitch.tv/helix/streams?user_id=freecodecamp",
// -snip-
})
}
This way your second ajax will be called after the first one has successfully returned without negative user experience from blocking synchronous requests.