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 game

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

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.