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
The category-defining generative AI platform from OpenAI, enabling developers to build intelligent applications.
Open-source scheduling infrastructure for everyone, from individuals to enterprise scale.
The platform for frontend developers, providing the speed and reliability innovators need to create at the moment of inspiration.
An open-source link management tool for modern marketing teams to create, share, and track short links.
An opinionated, modular stack focused on simplicity, and type safety, recommending Auth.js as its primary auth solution.
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.
Built for the edge with first-class support for Next.js, SvelteKit, SolidStart, and more.
Connect to your own database with our adapter system. Never get locked into a vendor’s user table again.
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.
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.
A testament to the community’s trust and love for the project.
Powering millions of applications every month, from side projects to enterprise.
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.