async function test (domain, client_id, client_secret) {
const resp = await fetch(`https://${domain}/oauth/token`, {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
grant_type: 'client_credentials',
client_id: client_id,
client_secret: client_secret,
audience: `https://${domain}/api/v2/`,
})
});
const tokens = await resp.json();
console.log(tokens);