title: How to use passport-discord
body: <p>I want to add discord login to my website, and I found this <a href="https://github.com/nicholastay/passport-discord" rel="nofollow noreferrer">passport-discord</a> package that seems to be the most popular way of doing so. However, I do not understand how I am supposed to use it, as I have little-to-no experience in NodeJS.</p>
  <p>My goal is to have a Login button that uses Discord authentication.</p>
  <p>My understanding is that I need to instantiate these variables</p>
  <pre class="lang-js prettyprint-override"><code>var passport = require('passport')
  
  var DiscordStrategy = require('passport-discord').Strategy;
   
  var scopes = ['identify', 'email', 'guilds', 'guilds.join'];
   
  passport.use(new DiscordStrategy({
      clientID: 'id',
      clientSecret: 'secret',
      callbackURL: 'callbackURL',
      scope: scopes
  },
  function(accessToken, refreshToken, profile, cb) {
      User.findOrCreate({ discordId: profile.id }, function(err, user) {
          return cb(err, user);
      });
  }));
  </code></pre>
  <p>And then somehow perform the get request (?) and I should receive a token to then use in the Discord API.</p>
  <pre class="lang-js prettyprint-override"><code>app.get('/auth/discord', passport.authenticate('discord'));
  </code></pre>
  <p>Am I right? How can I embed this into a login button?</p>