Skip to content
The Auth.js project is now part of
Auth.js
Authentication for the Web.
Free and open source.
/ 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/[email protected]
import { QwikAuth } from "@auth/qwik"
import GitHub from "@auth/qwik/providers/github"
export const { onRequest, useSession } = QwikAuth$(() => ({ providers: [GitHub] }))

Supports all these providers and more!

Acknowledgements

Auth.js © Better Auth Inc. - 2025

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant