What is a cheaper alternative to Clerk?
Short answer
Cheaper alternatives to Clerk are open-source libraries like Auth.js and Better Auth, self-hosted servers like Keycloak, Zitadel or Logto, and the sign-in that comes with Supabase, Firebase or Amazon Cognito. Each saves money by giving something up: Clerk’s prebuilt components, its hosted dashboard, or your team’s time. loginos is a hosted OpenID Connect provider with no paid plans today.
Clerk gets you from nothing to a working sign-in quickly, with ready-made components and a dashboard. The questions come later: when more people come back to your app every month, or when you need a feature from a paid plan. Cheaper options exist, but each one trades money for work or for features, so it helps to know which trade you are making.
What does Clerk do well?
Clerk is a hosted service for authentication and user management, and it is good at both. To be fair to it:
- Prebuilt UI components.
<SignIn />,<SignUp />,<UserButton />,<UserProfile />and<OrganizationSwitcher />drop into your pages, and billing components like<PricingTable />sit next to them. - SDKs for many frameworks, including Next.js, React, Expo, Astro, Vue and Nuxt. In Next.js,
@clerk/nextjsgives youclerkMiddleware(),auth()and<ClerkProvider>. - User management. A dashboard for your users, and organizations for B2B apps.
- Fair counting. Clerk bills by monthly retained users (MRU): people who visit your app at least one day after they signed up. Someone who signs up and never comes back doesn’t count.
- A free start. The Hobby plan needs no credit card.
Why do people look for a cheaper alternative to Clerk?
- Cost as retained users grow. The bill follows retained users, and B2B apps also pay per monthly retained organization. A growing app grows its bill, even when the price per user is fair.
- Plan-gated features. The Hobby plan has no passkeys, no MFA and no satellite domains, and the “Secured by Clerk” branding stays on the components. Those come with the Pro and Business plans. Enterprise SSO connections also start on Pro, and custom organization roles need the Enhanced organizations add-on.
- Satellite domains. Satellite domains are Clerk’s way to share one session across different domains, like
example.comandexample-admin.com. Sign-in happens on the primary domain, and each satellite reads the session from it. Satellites are free in development but need a paid plan in production, and each one is billed on top of the plan. Clerk’s docs describe the setup. - Wanting standard protocols. Your app talks to Clerk through its SDKs: middleware, server helpers and components. Leaving means replacing those calls across your code. Clerk can also act as an OAuth 2.0 and OpenID Connect provider for third-party clients, but its quickstarts add Clerk to your own app through the SDKs.
What are the cheaper alternatives to Clerk?
There are four cheaper paths: a library in your app, a server you host, the sign-in that comes with your platform, or another hosted provider. The table shows what each one gives up compared with Clerk.
| Option | Hosting | Open source | Protocols | What you give up |
|---|---|---|---|---|
| Auth.js | Runs in your app | Yes, ISC | Client for OAuth and OIDC providers | Prebuilt components and a dashboard; new projects are pointed to Better Auth |
| Better Auth | Runs in your app | Yes, MIT | OAuth and OIDC client; SSO plugin for OIDC and SAML | Prebuilt components; its hosted dashboard and email sending are a paid add-on |
| Keycloak, Zitadel, Logto | Your servers; Zitadel and Logto also hosted | Yes | OIDC and SAML | Your team’s time for upgrades, backups and uptime |
| Supabase Auth | Hosted, or your servers | Yes, MIT server | JWTs; can act as an OAuth 2.1 and OIDC provider | Suits apps whose data lives in Supabase; free projects pause after a period of inactivity |
| Firebase Authentication | Hosted by Google | No | Firebase SDKs; SAML and OIDC with Identity Platform | Sign-in tied to Firebase; phone sign-in is billed per SMS |
| Amazon Cognito | Hosted by AWS | No | OIDC provider; SAML and OIDC federation | Sign-in tied to AWS; the free tier covers the Lite and Essentials plans only |
| loginos | Hosted | No | OIDC | In-app components, social logins, organizations and MFA codes |
OIDC here is OpenID Connect, the standard layer on top of OAuth 2.0 that tells your app who signed in.
Open-source libraries: Auth.js and Better Auth
Auth.js and Better Auth are free, and they keep your users in your own database, so the running cost is your app and its database. In exchange, you build the sign-in and account pages, send the emails for verification and password resets, and own the security of all of it. Better Auth plugins cover passkeys, two-factor authentication and organizations. Auth.js connects to more than 80 preconfigured providers, and the Better Auth team, which now maintains it, recommends Better Auth for new projects. For the Next.js view, see the best authentication for Next.js.
Self-hosted identity servers
Keycloak, Zitadel, Logto, authentik and SuperTokens have no license fee for their open-source editions. Zitadel and Logto include organizations, and Logto and SuperTokens ship prebuilt sign-in screens. The cost moves from the invoice to your team: servers, a database, upgrades, backups and monitoring. Zitadel Cloud and Logto Cloud run the same software for you, and both have free plans.
Sign-in bundled with your platform
If your app already runs on Supabase, Firebase or AWS, its sign-in service is the shortest path, and each one has a free tier. What you give up is portability: if you leave the platform later, sign-in moves too. For screens, Firebase offers the drop-in FirebaseUI, and Cognito offers managed login pages.
Where loginos fits
loginos is a hosted OpenID Connect provider, and it works differently from Clerk. loginos doesn’t put components in your pages: people sign in on loginos.io and come back to your app with a one-time code, as with any OIDC provider. In Chrome and Edge, an optional “Continue as” prompt signs people in without leaving your page.
Sign in to your-app.example with loginos.io
Jane Doe
jane@example.com
loginos fits when:
- You run several domains. A platform has no limit on domains, and all of them share one pool of people. There is no primary domain and no satellite setup: every domain runs the same sign-in, and people already signed in to loginos come straight back. See Domains.
- You want passkeys from day one. Passkeys live on loginos.io and work on all your domains, and passwords still work.
- You want standard OIDC. Auth.js, openid-client, Passport and other OIDC libraries work with the discovery URL, so you can leave without rewriting your app.
- You need roles in tokens. Roles and permissions come in every token, and account linking connects the users you already have.
- Cost matters. loginos has no paid plans today, and you can start without a card.
loginos doesn’t fit when you need components like <UserButton /> and <UserProfile /> inside your pages, social logins, organizations with their own roles, SMS or authenticator codes, SAML, self-hosting, or a login page on your own domain. Email verification isn’t there yet either: email_verified is false, and loginos sends no email.
With Auth.js, loginos is one provider entry. Auth.js keeps your app’s session, and loginos keeps the accounts and passkeys:
import NextAuth from "next-auth";
export const { handlers, auth, signIn, signOut } = NextAuth({
providers: [
{
id: "loginos",
name: "loginos",
type: "oidc",
issuer: "https://loginos.io",
clientId: process.env.LOGINOS_APP_KEY,
clientSecret: process.env.LOGINOS_APP_SECRET,
checks: ["pkce", "state"],
},
],
});Auth.js sends people back to /api/auth/callback/loginos, so set that as the Callback path in the console’s Domains tab. The path is the same on every domain. If one deployment serves several domains, also read NextAuth on multiple domains. The quickstart covers creating the platform and its keys.
Frequently asked questions
Is Clerk free?
Clerk’s Hobby plan is free, needs no credit card, and covers a set number of monthly retained users per app. Passkeys, MFA, satellite domains and removing the Clerk branding need a paid plan. Clerk’s pricing page has the current limits.
Does Clerk work across multiple domains?
Subdomains of one domain share a Clerk session by default. Different domains need satellite domains: the primary domain handles sign-in, and the satellites read the session from it. Satellite domains need a paid plan in production and are billed per domain. Sharing a login session across domains explains the general approach.
Is Better Auth a good replacement for Clerk?
It is if you want to own your auth code. Better Auth is an MIT-licensed TypeScript library that keeps users and sessions in your database, with plugins for passkeys, two-factor authentication, organizations and SSO. In exchange, you build the screens, send the emails and run the database.
What is a monthly retained user in Clerk?
A monthly retained user is someone who visits your app in a given month at least one day after signing up. People who sign up and never return don’t count, so one-day visitors stay off the bill. Clerk counts organizations separately, as monthly retained organizations.
One account for every domain you run
loginos is an OpenID Connect provider with passkeys, a user pool shared by all of your domains, roles in every token, and account linking for the users you already have. Add your platform and its domains in a few minutes.
Keep reading
- Choosing a providerWhat is a good alternative to Auth0?Good Auth0 alternatives include hosted services like Clerk, WorkOS AuthKit, Stytch, Descope and Kinde, and open-source servers you run yourself, like Keycloak, Zitadel, authentik, Ory and Logto. Firebase, Supabase and Amazon Cognito bundle sign-in with their platforms, and Auth.js or Better Auth keep it in your code. Choose by who runs it and how you would leave. loginos fits products on many domains.7 min read
- Choosing a providerWhat is the best authentication solution for Next.js?There is no single best authentication solution for Next.js; the right one depends on your situation. Clerk and Supabase Auth get a prototype or a social-login app running quickly. WorkOS, Auth0 and Clerk suit B2B apps that need organizations and SAML. Better Auth and Auth.js keep users in your own database, and loginos is a hosted OpenID Connect option for many domains that share one user pool.8 min read
- Choosing a providerIs there a free OpenID Connect provider I can use for my app?Yes. Open-source servers like Keycloak, Zitadel, authentik, Ory Hydra, Dex and Authelia cost nothing to license, but you pay for the server and the upkeep. Hosted services such as Auth0, Zitadel Cloud, Logto Cloud, Kinde and Amazon Cognito have free tiers with limits, and mock servers cover local tests. loginos is a hosted OpenID Connect provider with no paid plans today.7 min read
- Customer domainsHow do I make NextAuth work with multiple domains?Leave AUTH_URL and NEXTAUTH_URL unset and turn on trustHost, so Auth.js builds its URLs from the host of each request instead of one fixed domain. Each domain then keeps its own session cookie, and your identity provider must accept the Auth.js callback URL on every domain. With loginos, someone signed in on one domain comes back on the others without a form.7 min read