1.0.0 • Published 2 years ago

@steve12341825/discord-oauth v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

oauth-discord

simple discord oauth tool

example

Access Token

const DiscordOauth = require('@steve12341825/discord-oauth');
const oauth = new DiscordOauth({
    version: "v9",
    client_id: 'your client id',
    client_secret: 'your client secret',
    redirect_uri: 'http://localhost:3000/callback',
});
// Using oauth code to get access token
oauth.getToken({
    grant_type: 'authorization_code',
    code: code
});
// Using refresh token to get access token
oauth.getToken({
    grant_type: 'refresh_token',
    refresh_token: refresh_token
})