A detailed guide documenting the setup process of Next.js + Discord OAuth & TypeScript
next-discord-oauth
git
, yarn
, npm
& node
installedyarn global add vercel
(or, if using npm
, you can run npm i -g vercel
).vercel login
and finish that process.git clone <github url of fork>
.env
. In here we will securely store our sensitive information in a manner that won't be commited (meaning pushed to Git for all eyes to see).CLIENT_ID=999999999999999999
CLIENT_SECRET=yDzjb6CEC7mfhCCGQmr8fKtxw_as9CG4
JWT_SECRET
(which can be anything in development – this does matter in production, however) & APP_URI
(which in most occasions should be http://localhost:3000
unless you know what you are doing).http://localhost:3000/api/oauth
as a redirect URI..env
file, but on the production vercel deployment side.CLIENT_ID
, CLIENT_SECRET
, etc...JWT_SECRET
& APP_URI
as these are the variables that the Discord OAuth will use to sign your jwt token and handle the Discord redirectionAPP_URI
will look like https://my-app.vercel.app
(including the protocol)JWT_SECRET
should be a long string of cryptographically generated characters. The more the merrier. passwordsgenerator.net is a great start.APP_URI
with /api/oauth
added to the end.