const axios = require('axios') module.exports = getAppAccessToken = (async (client_id, client_secret) => { return await axios.post('https://id.twitch.tv/oauth2/token', { client_id, client_secret, grant_type: 'client_credentials' }).then(response => { if (response.data.token_type === 'bearer') return response.data.access_token }).catch(console.error()) })