Add Google OAuth, magic link, and passkey sign-in to a Next.js app using pre-built UI components.
Build a multi-tenant SaaS product with per-organization member lists and role-based permissions without writing auth from scratch.
Self-host the entire authentication server to avoid per-user fees or vendor lock-in from Auth0 or Clerk.
Handle machine-to-machine authentication for background jobs or server-to-server API calls with short-lived tokens.
Self-hosting requires Node 20, pnpm 9, Docker, and 24 GB of RAM recommended for the development environment.
Stack Auth is an open-source authentication platform that handles user sign-in, sign-up, and account management for web applications. It is positioned as a self-hostable alternative to paid services like Auth0 and Clerk. The codebase is licensed under MIT and AGPL, and a hosted version is also available if you do not want to run the infrastructure yourself. The platform works with Next.js, React, and plain JavaScript frontends, and any backend that can call a REST API. It provides pre-built UI components for sign-in and sign-up pages that support email and password login, magic links sent via email, passkeys (biometric login), and social login via OAuth providers like Google. These components adapt to dark and light modes automatically. Account settings pages are also included out of the box, letting users update their profile, verify their email, and change their password without any extra setup. Beyond basic login, Stack Auth covers several features that teams typically have to build separately. It includes a user management dashboard for filtering, viewing, and editing user accounts. It supports multi-tenancy, meaning a single deployment can serve multiple organizations, each with their own member lists and roles. Role-based access control lets developers define permission structures and assign them to users or teams. There is also user impersonation for support and debugging, webhook notifications when user events occur, and customizable email templates for sign-up and password reset flows. For machine-to-machine authentication (server-to-server calls, background jobs, and similar scenarios), Stack Auth issues short-lived access tokens. It also manages OAuth tokens for third-party services like Google Calendar, handling token refresh and scope control behind the scenes. Getting started takes a few steps: run an installation wizard command in your project, create an account on the Stack Auth dashboard to get API keys, add those keys to your environment file, and the sign-in and sign-up pages appear automatically. Self-hosting requires Node 20, pnpm 9, and Docker, with 24GB of RAM recommended for the development environment.
← hexclave on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.