Skip to Content
Documentation Menu
AuthenticationNextAuth Setup

NextAuth Setup

For authentication, we are using NextAuth.

Before integrating Github and Google authentication you have to set up NextAuth.

To set up NextAuth, first, create a .env file in the root of your project.

Then add NextAuth_SECRET and NextAuth_CLIENT to the .env file.

NEXTAUTH_SECRET=SECRET_KEY NEXTAUTH_URL=localhost:3000

NEXTAUTH_SECRET is just a random string. You can generate a random string using this command

openssl rand -base64 32

or you can go to this  URL it’ll give you a unique string too.

The NEXTAUTH_URL for development is localhost:3000 and for deployment it’s the canonical URL of your site.

Last updated on