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

Auth. Free. Open Source.

Own your user data. Connect to your own database with a simple adapter, any from 100+ providers, and avoid vendor lock-in forever.
// 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] }))
// 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/routes/plugin@auth.ts
import { QwikAuth } from "@auth/qwik"
import GitHub from "@auth/qwik/providers/github"
export const { onRequest, useSession } = QwikAuth$(() => ({ providers: [GitHub] }))
// 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"

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

Vercel provides the developer tools and cloud infrastructure to build, scale, and secure a faster, more personalized web.

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 100+ 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.
github
GitHub
google
Google
twitter
Twitter
apple
Apple
discord
Discord
auth0
Auth0
facebook
Facebook
keycloak
Keycloak
42-school
42 School
asgardeo
Asgardeo
atlassian
Atlassian
authentik
Authentik
azure-ad-b2c
Azure Active Directory B2C
azure-ad
Azure Active Directory
azure-devops
Azure DevOps
battlenet
Battle.net
beyondidentity
Beyond Identity
bitbucket
Bitbucket
box
Box
boxyhq-saml
BoxyHQ SAML
github
GitHub
google
Google
twitter
Twitter
apple
Apple
discord
Discord
auth0
Auth0
facebook
Facebook
keycloak
Keycloak
42-school
42 School
asgardeo
Asgardeo
atlassian
Atlassian
authentik
Authentik
azure-ad-b2c
Azure Active Directory B2C
azure-ad
Azure Active Directory
azure-devops
Azure DevOps
battlenet
Battle.net
beyondidentity
Beyond Identity
bitbucket
Bitbucket
box
Box
boxyhq-saml
BoxyHQ SAML
bungie
Bungie
click-up
ClickUp
cognito
Cognito
coinbase
Coinbase
descope
Descope
dribbble
Dribbble
dropbox
Dropbox
duende-identityserver-6
DuendeIdentityServer6
eveonline
EVE Online
faceit
FACEIT
figma
Figma
foursquare
Foursquare
freshbooks
Freshbooks
fusionauth
FusionAuth
gitlab
GitLab
hubspot
HubSpot
huggingface
Hugging Face
identity-server4
IdentityServer4
instagram
Instagram
kakao
Kakao
bungie
Bungie
click-up
ClickUp
cognito
Cognito
coinbase
Coinbase
descope
Descope
dribbble
Dribbble
dropbox
Dropbox
duende-identityserver-6
DuendeIdentityServer6
eveonline
EVE Online
faceit
FACEIT
figma
Figma
foursquare
Foursquare
freshbooks
Freshbooks
fusionauth
FusionAuth
gitlab
GitLab
hubspot
HubSpot
huggingface
Hugging Face
identity-server4
IdentityServer4
instagram
Instagram
kakao
Kakao
kinde
Kinde
line
LINE
linkedin
LinkedIn
logto
Logto
mailchimp
Mailchimp
mailru
Mail.ru
mastodon
Mastodon
mattermost
Mattermost
medium
Medium
microsoft-entra-id
Microsoft Entra ID
naver
Naver
netlify
Netlify
notion
Notion
okta
Okta
onelogin
OneLogin
osso
Osso
osu
Osu!
passage
Passage
patreon
Patreon
pinterest
Pinterest
kinde
Kinde
line
LINE
linkedin
LinkedIn
logto
Logto
mailchimp
Mailchimp
mailru
Mail.ru
mastodon
Mastodon
mattermost
Mattermost
medium
Medium
microsoft-entra-id
Microsoft Entra ID
naver
Naver
netlify
Netlify
notion
Notion
okta
Okta
onelogin
OneLogin
osso
Osso
osu
Osu!
passage
Passage
patreon
Patreon
pinterest
Pinterest
pipedrive
Pipedrive
reddit
Reddit
salesforce
Salesforce
slack
Slack
spotify
Spotify
strava
Strava
tiktok
TikTok
todoist
Todoist
trakt
Trakt
twitch
Twitch
united-effects
United Effects
vk
VK
webex
Webex
wikimedia
Wikimedia
wordpress
WordPress.com
workos
WorkOS
yandex
Yandex
zitadel
ZITADEL
zoho
Zoho
zoom
Zoom
pipedrive
Pipedrive
reddit
Reddit
salesforce
Salesforce
slack
Slack
spotify
Spotify
strava
Strava
tiktok
TikTok
todoist
Todoist
trakt
Trakt
twitch
Twitch
united-effects
United Effects
vk
VK
webex
Webex
wikimedia
Wikimedia
wordpress
WordPress.com
workos
WorkOS
yandex
Yandex
zitadel
ZITADEL
zoho
Zoho
zoom
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.

25k+

GitHub Stars
A testament to the community's trust and love for the project.

60M+

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

900+

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.