This article is written by the team that builds Casdoor, so we are not neutral, and we say where we think Casdoor fits and where it doesn't. Facts about other products come from their own websites as of November 2, 2026 (listed under Sources) and may have changed. Spotted something out of date? Tell us.
Clerk is popular with React and Next.js developers for a good reason: drop in <SignIn /> and <UserButton /> and you have a polished login, profiles and organizations in an afternoon. Teams look for alternatives when:
- The bill grows with users. Clerk is free for 50,000 monthly retained users per app, then Pro is $25 per month ($20 billed yearly) plus $0.02 per retained user, and each enterprise SSO connection is $75 per month.
- They want to own the data or must keep it in their own region or servers.
- The rest of the stack isn't React. A Go API, a Python admin tool, a mobile app or a third-party tool all need to share the same users.
The five below are open source. They split into two models, and choosing the model first makes the decision easier:
- Libraries in your app (Better Auth, SuperTokens, Supabase Auth to a degree): auth code runs in or next to your backend, users live in your database. Closest to Clerk's developer experience.
- A central identity provider (Casdoor, Logto): a separate service with hosted login pages that every app signs in through over OIDC. Better when you have several apps, or need SAML, enterprise SSO for customers, or an admin console.
Short answer: if you want Clerk's developer experience but your own database, start with Better Auth or Supabase Auth. If several apps in different languages need one identity provider, or customers ask for enterprise SSO, start with Casdoor. If you want an open-source hosted service billed per MAU, look at Logto.
Does Clerk have a self-hosted version?
No. Clerk is a proprietary cloud service, and there is no self-hosted edition to run in your own VPC. If keeping identity data on your own infrastructure is a hard requirement, Clerk is out and the five projects below are the realistic options. Casdoor and Logto are the two central identity providers in the list; Better Auth, Supabase Auth and SuperTokens run auth code next to your own database.
Enterprise SSO and what it costs
Clerk charges $75 per month for each enterprise SSO connection, and directory sync is priced the same way. That is fine for a handful of enterprise customers, but it adds up for a B2B product with many tenants.
- Casdoor includes SAML and OIDC connections on every plan, with no per-connection fee.
- Better Auth's SSO plugin handles OIDC and SAML inside your app at no per-connection cost.
- Supabase SAML is available on Pro and above: 50 SSO MAU are included, then $0.015 each.
- Logto treats enterprise SSO as a paid add-on in Logto Cloud.
- SuperTokens supports SAML login; multi-tenancy is a paid add-on.
If "each customer brings their own IdP" is a core requirement, compare the per-connection pricing before choosing. See SSO for SaaS and multi-tenant authentication.
At a glance
| Casdoor | Better Auth | Supabase Auth | Logto | SuperTokens | |
|---|---|---|---|---|---|
| License | Apache-2.0 | MIT | MIT | MPL-2.0 | Apache-2.0, enterprise features separate |
| Model | Central identity provider | TypeScript library in your app | Auth server in a Supabase project | Central identity provider | SDKs plus an auth core service |
| Languages | Any, over OIDC, SAML or CAS | TypeScript | Any, through Supabase client libraries | Any, over OIDC | SDKs for Node.js, Python and Go backends |
| Managed cloud | Casdoor Cloud, flat price per instance | No | Supabase Cloud, per MAU | Logto Cloud, per MAU | SuperTokens managed, per MAU |
| Enterprise SSO for your customers | Included | SSO plugin (OIDC and SAML) | SAML on Pro and up: 50 SSO MAU included, then $0.015 each | Paid add-on in Logto Cloud | SAML login; multi-tenancy is a paid add-on |
1. Casdoor
Casdoor is an open-source identity provider: hosted sign-in and sign-up pages you brand per application (logo, theme, custom CSS and your own domain), an admin console for users, organizations and roles, and SDKs for React, Next.js, Vue and most backend languages. Because apps sign in over standard OIDC, SAML or CAS, a Next.js frontend, a Go API, a mobile app and an off-the-shelf tool like Grafana can share the same accounts.
Social login, passkeys, MFA, organizations, Casbin RBAC and enterprise SAML or OIDC connections for your customers are included, with no per-connection fee. Self-host it for free, or use Casdoor Cloud: a dedicated instance from $6.67/month billed yearly ($9 month to month), with no per-user fees.
Trade-offs: sign-in happens on Casdoor's pages (by redirect or popup) rather than in components rendered inside your own React tree. See Casdoor vs Clerk.
2. Better Auth
Better Auth is an MIT-licensed, framework-agnostic auth framework for TypeScript. It runs inside your app, stores users in your own database, and adds features through plugins, including organizations, two-factor and an SSO plugin that connects your app to customers' OIDC or SAML identity providers.
Trade-offs: it's TypeScript-only, there's no hosted service or admin console, and you own the security of your auth code paths and upgrades.
3. Supabase Auth
Supabase Auth is the obvious choice if you're on Supabase already: users are rows in your Postgres, and row-level security policies use the signed-in user directly. The free plan includes 50,000 MAU; Pro is $25 per month with 100,000 MAU, then $0.00325 per MAU.
Trade-offs: it's designed around a Supabase project, so it's less natural as a standalone IdP for other apps. See Casdoor vs Supabase Auth.
4. Logto
Logto is an open-source identity provider (MPL-2.0) with a modern sign-in experience, organizations for B2B apps, and SDKs for popular frameworks. Logto Cloud has a free tier with 50,000 MAU; Pro starts at $24 per month plus add-ons.
Trade-offs: some features, such as enterprise SSO, are paid add-ons in Logto Cloud. See Casdoor vs Logto.
5. SuperTokens
SuperTokens embeds auth in your app through frontend and backend SDKs, backed by a core service you self-host or let them manage, with prebuilt UI for React. The core is Apache-2.0; managed hosting is free up to 5,000 MAU, then $0.02 per MAU.
Trade-offs: MFA, account linking and multi-tenancy are paid add-ons (MFA is $0.01 per MAU with a $100 monthly minimum), and backend SDKs cover Node.js, Python and Go. See Casdoor vs SuperTokens.
Which one should you choose?
- One React or Next.js app, TypeScript end to end, and you want auth in your own code and database: Better Auth.
- Already on Supabase: Supabase Auth.
- Several apps in different languages, B2B customers who need SSO, or you want an admin console and a flat price: Casdoor.
- You want a hosted, per-MAU service that's open source: Logto.
- You like embedded SDKs with a self-hostable core: SuperTokens.
If you're coming from Clerk, Casdoor can import users with bcrypt password hashes, so they keep their passwords. Talk to us if you'd like help with a migration.
FAQ
Is Clerk open source? No. Clerk is proprietary. The five projects on this page are open source under OSI-approved licenses.
Can I self-host Clerk? No. Clerk only runs as a hosted service. If you need self-hosting, use one of the alternatives above.
What is the best open-source Clerk alternative? It depends on the model: Better Auth for a TypeScript app that wants auth in its own code and database, Supabase Auth if you are already on Supabase, and Casdoor or Logto if several apps in different languages need one identity provider. Casdoor adds enterprise SSO without per-connection fees.
How much does Clerk charge for enterprise SSO? $75 per month for each SSO connection, with directory sync priced separately at the same rate.
Related
- Auth0 alternatives for a broader CIAM comparison.
- Self-hosted identity provider if owning the data is the main requirement.
- Casdoor vs Clerk and Casdoor pricing.
Sources
- Clerk pricing
- Better Auth on GitHub
- Better Auth SSO plugin
- Supabase pricing
- Supabase Auth on GitHub
- Logto on GitHub
- Logto pricing
- SuperTokens core license
- SuperTokens pricing
Product names are trademarks of their respective owners.