NextAuth v5
export const { auth, handlers } = NextAuth({ providers: [GitHub] }) // proxy.ts export { auth as proxy } from "@/auth" //…
Official Documentation ↗v5.0. Check the official docs for the latest API surface.Installation
npm install next-authpnpm add next-authyarn add next-authMethods
No methods match this filter.
Overview
NextAuth v5 is the Next.js integration of Auth.js. It wires OAuth providers, session strategies and middleware into a Next.js application through the NextAuth() export shown in the official documentation excerpt. The official README provides no verifiable API example beyond that snippet, so method signatures and return values remain unverified.
API reference status
The official README provides no verifiable API example, so this page does not list method signatures (unverified).
Security notes
Quoted verbatim from the official documentation; this is not a complete threat model. 来源:https://authjs.dev/ · 取证方式:HTTP GET 官方 README/文档页(HTML 去标签) · 抓取时间:2026-11-07T13:51:07.572Z.
- About Auth.js Introduction Security Discord Community Download GitHub NPM Acknowledgements Contributors Auth.js © Better Auth Inc. (https://authjs.dev/)
Verification notes
- Official source: https://authjs.dev/
- Evidence: https://authjs.dev/
- Checked on 2026-11-04 by
scripts/phase11/build-api-profiles.mjs
Errors
The official API reference declares the following error types:
AuthError(class(Base error class for all Auth.js errors,Extends Error)) — official text: “Base error class for all Auth.js errors. It’s optimized to be printed in the server logs in a nicely formatted way via thelogger.erroroption.” (source: https://authjs.dev/reference/nextjs#autherror, fetched 2026-11-08T17:41:29+08:00)MissingSecretError(生产环境缺少 AUTH_SECRET 时抛出(详见 core/errors#missingsecret)) — official text: “In production,AUTH_SECRETis a required environment variable - if not set, NextAuth.js will throw an error.” (source: https://authjs.dev/reference/nextjs, fetched 2026-11-08T17:41:29+08:00)
API reference evidence
Fetched from official sources on 2026-11-08T17:41:29+08:00 via PowerShell Invoke-WebRequest 下载 npm 官方包 next-auth@beta 的 index.d.ts(cdn.jsdelivr.net/npm/next-auth@beta);WebFetch https://authjs.dev/reference/nextjs 与 https://authjs.dev/getting-started/installation.
nextAuth (unverified)→ signature from https://cdn.jsdelivr.net/npm/next-auth@beta/index.d.ts; official text: “export default function NextAuth(config: NextAuthConfig | ((request: NextRequest | undefined) => Awaitable)): NextAuthResult;”
FAQ
- What does next-auth do?
- export const { auth, handlers } = NextAuth({ providers: [GitHub] }) // proxy.ts export { auth as proxy } from "@/auth" // app/api/auth/[...nextauth]/route.ts export const { GET, POST } = han
- How do I install next-auth?
- Run `npm install next-auth`.
- Where can I verify the API details?
- Official repository/documentation: https://authjs.dev/. Checked on 2026-11-04; signatures and return values not stated in the official README are marked unverified.
Report a problem with this API docOpens a pre-filled issue on GitHub.