StackAuth

auth0 and Clerk selfhostable alternative. robust, secured, and customizable

Deploy StackAuth

dashboard

stack-auth/stack-auth

Just deployed

Postgres

railwayapp-templates/postgres-ssl:16

Just deployed

/var/lib/postgresql/data

stackauth/server

stackauth/server

Just deployed

📦 Deployment Notes

  • To create first user & access dashboard for the first time: After deployment finished, go directly to database -> ApiKeySet -> then manually edit the publishableClientKey and secretServerKey to be the same as in environment variable config.
  • To gain admin access and config: Create a user. Go directly to database -> ProjectUser -> manually update serverMetaData field to contain project "internal" with following json: { "managedProjectIds": [ "internal" ] }

Stack Logo

📘 Docs | ☁️ Hosted Version | ✨ Demo | 🎮 Discord

Stack Auth: Open-source Clerk/Auth0 alternative

Stack Auth is a managed user authentication solution. It is developer-friendly and fully open-source (licensed under MIT and AGPL).

Stack Auth gets you started in just five minutes, after which you'll be ready to use all of its features as you grow your project. Our managed service is completely optional and you can export your user data and self-host, for free, at any time.

We support Next.js, React, and JavaScript frontends, along with any backend that can use our REST API. Check out our setup guide to get started.

Stack Auth Setup

Table of contents

How is this different from X?

Ask yourself about X:

  • Is X open-source?
  • Is X developer-friendly, well-documented, and lets you get started in minutes?
  • Besides authentication, does X also do authorization and user management (see feature list below)?

If you answered "no" to any of these questions, then that's how Stack Auth is different from X.

✨ Features

To get notified first when we add new features, please subscribe to our newsletter.

and

Authentication components that support OAuth, password credentials, and magic links, with shared development keys to make setup faster. All components support dark/light modes.
Sign-in component

Idiomatic Next.js APIs

We build on server components, React hooks, and route handlers.
Dark/light mode

User dashboard

Dashboard to filter, analyze, and edit users. Replaces the first internal tool you would have to build.
User dashboard

Account settings

Lets users update their profile, verify their e-mail, or change their password. No setup required.
Account settings component

Multi-tenancy & teams

Manage B2B customers with an organization structure that makes sense and scales to millions.
Selected team switcher component

Role-based access control

Define an arbitrary permission graph and assign it to users. Organizations can create org-specific roles.
RBAC

OAuth Connections

Beyond login, Stack Auth can also manage access tokens for third-party APIs, such as Outlook and Google Calendar. It handles refreshing tokens and controlling scope, making access tokens accessible via a single function call.
OAuth tokens

Passkeys

Support for passwordless authentication using passkeys, allowing users to sign in securely with biometrics or security keys across all their devices.
OAuth tokens

Impersonation

Impersonate users for debugging and support, logging into their account as if you were them.
Webhooks

Webhooks

Get notified when users use your product, built on Svix.
Webhooks

Automatic emails

Send customizable emails on triggers such as sign-up, password reset, and email verification, editable with a WYSIWYG editor.
Email templates

User session & JWT handling

Stack Auth manages refresh and access tokens, JWTs, and cookies, resulting in the best performance at no implementation cost.
User button

M2M authentication

Use short-lived access tokens to authenticate your machines to other machines.
M2M authentication

Template Content

More templates in this category

View Template

Keycloak

Keycloak template with keywind theme + apple and discord providers


View Template

bknd

Feature-rich yet lightweight backend


View Template

Authorizer

Open-source authentication and authorization solution for your business.