Connexion OAuth depuis site + Comptage rewards SQL

This commit is contained in:
Zachary Guénot
2023-05-09 00:32:43 +02:00
parent be73cd765d
commit 172f811e91
19 changed files with 712 additions and 123 deletions

View File

@@ -0,0 +1,21 @@
const axios = require('axios')
module.exports = async function (access_token, session_id, client_id, type, version, condition) {
return await axios.post('https://api.twitch.tv/helix/eventsub/subscriptions', {
type,
version,
condition,
transport: {
method: 'websocket',
session_id
}
}, {
headers: {
'Authorization': `Bearer ${access_token}`,
'Client-Id': client_id,
'Content-Type': 'application/json'
}
}).then(response => {
return response.data.data[0].status
}).catch(error => { return error.response.data })
}