🔥 100% asyncronous
🔥 Intuitive structure of methods
🔥 Fresh updates
🔥 Typescript support
npm i easy-discord-oauthFirst of all, you need to receive Discord OAuth code. Navigate to Discord docs for more info
To get token use:
const tokenRes = await DiscordOAuth.exchangeCode("code", "redirect uri", "client id", "client secret");
const token = tokenRes.accessToken;For example, let's get info about the current user and log the username. It's requires identify scope.
const user = await DiscordOAuth.User.getCurrentUser("token");
console.log(user.username);