Skip to content
Migrating from NextAuth.js v4? Read our migration guide.

Authentication for the Modern Web.

Simple, open-source authentication for Next.js, SvelteKit, and beyond. Own your data and get started in minutes.

// auth.ts
import NextAuth from "next-auth"
import GitHub from "next-auth/providers/github"
export const { auth, handlers } = NextAuth({ providers: [GitHub] })

// middleware.ts
export { auth as middleware } from "@/auth"

// app/api/auth/[...nextauth]/route.ts
import { handlers } from "@/auth"
export const { GET, POST } = handlers
// src/auth.ts
import { SvelteKitAuth } from "@auth/sveltekit"
import GitHub from '@auth/sveltekit/providers/github'

export const { handle } = SvelteKitAuth({
  providers: [GitHub],
})

// src/hooks.server.ts
export { handle } from "./auth"
// server.ts
import { express } from "express"
import { ExpressAuth } from "@auth/express"
import GitHub from "@auth/express/providers/github"

const app = express()

app.use("/auth/*", ExpressAuth({ providers: [GitHub] }))
// src/routes/plugin@auth.ts
import { QwikAuth } from "@auth/qwik"
import GitHub from "@auth/qwik/providers/github"
export const { onRequest, useSession } = QwikAuth$(() => ({ providers: [GitHub] }))

Trusted by the best in the business

ChatGPT

The category-defining generative AI platform from OpenAI, enabling developers to build intelligent applications.

Cal.com

Open-source scheduling infrastructure for everyone, from individuals to enterprise scale.

Vercel

Vercel

The platform for frontend developers, providing the speed and reliability innovators need to create at the moment of inspiration.

Dub.co

An open-source link management tool for modern marketing teams to create, share, and track short links.

The T3 Stack

An opinionated, modular stack focused on simplicity, and type safety, recommending Auth.js as its primary auth solution.

Artlist

A creative powerhouse providing creators with royalty-free music, SFX, stock footage, and video editing software.

Everything you need, nothing you don’t

Auth.js is a complete, open-source authentication solution, designed to be flexible and secure, giving you full control over your user data.

Use Any Framework

Built for the edge with first-class support for Next.js, SvelteKit, SolidStart, and more.

Own Your Data

Connect to your own database with our adapter system. Never get locked into a vendor’s user table again.

Fully Extensible

Choose from 50+ pre-configured providers or add your own. Customize everything from UI to session handling with callbacks.

import NextAuth from "next-auth"
 
export const { handlers, signIn, signOut, auth } = NextAuth({
  providers: [],
})

Sign in with * anything *

With over 100 popular providers, you can let your users sign in with the services they already use and trust.

42-school
apple
asgardeo
atlassian
auth0
authentik
azure-ad-b2c
azure-ad
azure-devops
azure
bankid-no
battlenet
beyondidentity
bitbucket
box
boxyhq-saml
bungie
click-up
cognito
coinbase
concept2
descope
discord
dribbble
dropbox
duende-identityserver-6
42-school
apple
asgardeo
atlassian
auth0
authentik
azure-ad-b2c
azure-ad
azure-devops
azure
bankid-no
battlenet
beyondidentity
bitbucket
box
boxyhq-saml
bungie
click-up
cognito
coinbase
concept2
descope
discord
dribbble
dropbox
duende-identityserver-6
eventbrite
eveonline
facebook
faceit
figma
forwardemail
foursquare
freshbooks
frontegg
fusionauth
github
gitlab
google
hubspot
huggingface
identity-server4
instagram
kakao
keycloak
kinde
line
linkedin
logto
loops
mailchimp
mailgun
eventbrite
eveonline
facebook
faceit
figma
forwardemail
foursquare
freshbooks
frontegg
fusionauth
github
gitlab
google
hubspot
huggingface
identity-server4
instagram
kakao
keycloak
kinde
line
linkedin
logto
loops
mailchimp
mailgun
mailru
mastodon
mattermost
medium
microsoft-entra-id
naver
netlify
netsuite
nextcloud
nodemailer
notion
okta
onelogin
osso
osu
passage
passkey
patreon
ping-id
pinterest
pipedrive
postmark
reddit
resend
roblox
sailpoint
mailru
mastodon
mattermost
medium
microsoft-entra-id
naver
netlify
netsuite
nextcloud
nodemailer
notion
okta
onelogin
osso
osu
passage
passkey
patreon
ping-id
pinterest
pipedrive
postmark
reddit
resend
roblox
sailpoint
salesforce
sendgrid
simplelogin
slack
spotify
strava
threads
tiktok
todoist
trakt
twitch
twitter
united-effects
vercel
vipps-mobilepay
vipps
vk
webex
wechat
wikimedia
wordpress
workos
yandex
zitadel
zoho
zoom
salesforce
sendgrid
simplelogin
slack
spotify
strava
threads
tiktok
todoist
trakt
twitch
twitter
united-effects
vercel
vipps-mobilepay
vipps
vk
webex
wechat
wikimedia
wordpress
workos
yandex
zitadel
zoho
zoom

Built by developers, for developers

Auth.js is a community-driven project, backed by a transparent, open-source philosophy. Your data is yours, and the code is open to everyone.

30k+

GitHub Stars

A testament to the community’s trust and love for the project.

5M+

NPM Downloads

Powering millions of applications every month, from side projects to enterprise.

700+

Contributors

A massive thank you to everyone who has contributed to the project.

Ready to secure your app?

Get started in minutes with our quickstart guide or dive into the documentation to see everything Auth.js has to offer.