https://github.com/weehongkoh/nextjs-app-router-authjs
NextJs 15 Boilerplate with Auth.js (NextAuth) Library
https://github.com/weehongkoh/nextjs-app-router-authjs
authjs nextauth nextjs-app-router nextjs-boilerplate nextjs14 nextjs15 nextjs15-typescript
Last synced: 3 months ago
JSON representation
NextJs 15 Boilerplate with Auth.js (NextAuth) Library
- Host: GitHub
- URL: https://github.com/weehongkoh/nextjs-app-router-authjs
- Owner: weehongkoh
- Created: 2023-05-26T14:36:05.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-03-14T05:30:43.000Z (4 months ago)
- Last Synced: 2025-03-30T01:12:13.021Z (3 months ago)
- Topics: authjs, nextauth, nextjs-app-router, nextjs-boilerplate, nextjs14, nextjs15, nextjs15-typescript
- Language: TypeScript
- Homepage: https://nextjs-app-router-nextauth.vercel.app
- Size: 333 KB
- Stars: 103
- Watchers: 1
- Forks: 18
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# NextJs 15 App Router and Auth.js (Next Auth) Boilerplate
![]()
This is a NextJs 15 App Router boilerplate that uses the Auth.js (Next Auth) library.
The current repository includes a database adapter, which increases the complexity of the code.
If you just want to implement the OAuth provider only, this [OAuth branch](https://github.com/weehongayden/nextjs-app-router-nextauth/tree/oauth-provider) is for you.
## Latest Implementation
- 14-03-2025 - Upgrade package ESLint 9, TailwindCSS 4, etc
- 18-01-2025 - Upgrade to NextJs 15 and Auth.js (Next Auth)
- 29-08-2024 - Add Auth0 Provider
- 08-06-2024 - Add login credential on Custom Login
- 04-05-2024 - Add database adapter on Custom Login
- 06-03-2024 - Update the Landing Page and Custom Login Page
- 06-03-2024 - Upgrade NPM Package to Latest Version## Features
- Providers
- [x] Google
- [x] Discord
- [x] Auth0
- [x] Protected Page
- [x] NextJs Middleware
- [x] Database Adapter (PostgreSQL and Hasura)## How to Use?
Clone this repository.
Copy the `.env.example` and rename it as `.env` .
Insert the value to respective fieldRun the following command to generate `NEXTAUTH_SECRET`, `openssl rand -base64 32`.
```
NEXTAUTH_URL=
NEXTAUTH_SECRET=AUTH_GOOGLE_ID=
AUTH_GOOGLE_SECRET=AUTH_DISCORD_ID=
AUTH_DISCORD_SECRET=AUTH_AUTH0_ID=
AUTH_AUTH0_SECRET=
AUTH_AUTH0_ISSUER=AUTH_HASURA_GRAPHQL=
AUTH_HASURA_SECRET=
```### Reference
- [Auth.js](https://authjs.dev/getting-started/installation?framework=Next.js)
- [YouTube | How To Set Up Next Auth 5 in Next.js 15 [ project code included ] ](https://www.youtube.com/watch?v=xHQQ5I7E_H8&t=322s)