Skip to content

Commit

Permalink
docs: mention Route Handler initialization in getting started (#7213)
Browse files Browse the repository at this point in the history
Updated the Getting Started documentation file (section about adding NextAuth API routes) to refer to another documentation section where the NextAuth API routes are handled using the new App Router and Route Handlers
  • Loading branch information
DorijanH committed Apr 12, 2023
1 parent 6edb6dd commit 7a8c006
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/docs/getting-started/example.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ If you are using TypeScript, NextAuth.js comes with its types definitions within

To add NextAuth.js to a project create a file called `[...nextauth].js` in `pages/api/auth`. This contains the dynamic route handler for NextAuth.js which will also contain all of your global NextAuth.js configurations.

If you're using [Next.js 13.2](https://nextjs.org/blog/next-13-2#custom-route-handlers) or above with the new App Router (`app/`), you can initialize the configuration using the new [Route Handlers](https://beta.nextjs.org/docs/routing/route-handlers) by following our [guide](https://next-auth.js.org/configuration/initialization#route-handlers-app).

```javascript title="pages/api/auth/[...nextauth].js" showLineNumbers
import NextAuth from "next-auth"
import GithubProvider from "next-auth/providers/github"
Expand Down

1 comment on commit 7a8c006

@vercel
Copy link

@vercel vercel bot commented on 7a8c006 Apr 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.