Creator Blog

Creator blog

自動生成ヒーロー(OGスタイル): Checking out BetterAuth

Checking out BetterAuth

AuthTypeScript

Hello! I’m Sakata from the IT/DEV Department.

At my job, I handle everything from UI/UX design to engineering. Recently, while building the authentication system for our in-house service, I evaluated several authentication libraries and managed services. I’ve compiled my notes here for future reference.

What is BetterAuth?

BetterAuthis a TypeScript-first authentication framework that recently hit version 1.0.

While there are similar services likeAuth.js (NextAuth.js),Firebase Auth,Auth0, andSupabase, BetterAuth stands out because it is a library-based solution. This means user data is stored directly in your own database. In the Next.js ecosystem, it feels like a strong emerging competitor to Auth.js.

It covers all the essential authentication foundations:

Email/Password, Social Login, Passkeys, and 2FA / Email OTP.

An extensive range of SSO integrations.

Framework Agnostic

Since BetterAuth is built with TypeScript, it can be implemented regardless of your framework. It’s highly attractive because it works anywhere—Nuxt, Vue, React on the frontend, andHonoor Express on the backend.

ORM Support

It supports major ORMs likeDrizzle ORMandPrisma, allowing you to handle auth on the same technical foundation as your backend. Our team uses Hono, Drizzle, and PostgreSQL, so the synergy here is perfect.


Comparison with Other Platforms

When evaluating our options, I looked at other major players, specifically focusing on how they handle complex account structures and their long-term running costs.

BetterAuth: The Library Choice

Cost: Completely free (as it’s an OSS library). You only pay for your infrastructure.

Customization: It is a library, not a full-managed SaaS, so you provide the database and UI yourself.

Clerk: The Managed SaaS

Clerk is a popular IDaaS (Identity as a Service) for React and Next.js apps.

Pros: Extremely fast to set up with pre-built UI components.

Cons: Vendor lock-in. User data is stored on Clerk's side.

Pricing: Free up to 10,000 MAU. Beyond that, it follows a pay-as-you-go model.

Auth0: The Industry Standard

Pros: Advanced security features and extensive enterprise support.

Cons: Very expensive. Pricing varies significantly between B2C and B2B models.

Amazon Cognito: AWS Synergy & Low Cost

Pros: Seamless integration with AWS services (Lambda, etc.) and very budget-friendly (50,000 MAU free).

Cons: Often cited for poor Developer Experience (DX) and complex AWS-specific configurations.


Why We Chose BetterAuth

To summarize:

BetterAuth: No extra licensing fees, highly customizable, perfect for TS environments.

Clerk: The fastest way to deploy a robust auth foundation.

Cognito: Great for AWS-centric environments and large user bases on a budget.

In the end, we narrowed it down to Clerk vs. BetterAuth.

While Clerk's affinity with Next.js is great, we wanted our authentication logic to reside primarily on the backend. Because our specific technical stack required more flexibility and ownership of data, we decided that BetterAuth was the better fit.

Final Thoughts

Building auth from scratch is a security nightmare. While we chose BetterAuth this time, I still think Clerk is an excellent choice for personal projects or rapid prototyping.

I’ll share my hands-on impressions of BetterAuth once I’ve spent more time working with it in production!

From marketing and distribution across Asia to design and IT development, 5SENSE is your strategic partner. Feel free to reach out.

Contact Us