---
title: NextAuth.js
description: Usage of NextAuth.js
layout: ../../../layouts/docs.astro
lang: en
isMdx: true
---

import Tabs from "../../../components/docs/tabs.astro";
import AppRouter from "./next-auth-app-router.mdx";
import Pages from "./next-auth-pages.mdx";

When you want an authentication system in your Next.js application, NextAuth.js is an excellent solution to bring in the complexity of security without the hassle of having to build it yourself. It comes with an extensive list of providers to quickly add OAuth authentication and provides adapters for many databases and ORMs.

<Tabs slotOne="Pages Router" slotTwo="App Router" tabName="app-router">
  <Pages slot="1" />
  <AppRouter slot="2" />
</Tabs>


