software · Q1335
Better Auth
Open-source TypeScript authentication framework with database adapters, session management and optional authentication plugins.
Overview
Better Auth is an open-source TypeScript authentication framework that can run within an application or as a separately hosted authentication server. It provides account and session management, email/password and social sign-in, with additional functionality through plugins. For a vibecoder, it offers reusable authentication machinery while keeping integration and operational responsibility in the application's own stack.[1][4]
Integration is more than a sign-in component
Setup includes a high-entropy secret, a base URL, an authentication instance, persistence and a server route that handles authentication requests. Client helpers then call that server. The installation guide supports several database choices and adapters; its direct migration command is restricted to the built-in Kysely adapter, while other setups use generated schemas or migration files. Most plugins require a database even though a stateless configuration is also documented. These choices need to agree with the generated application's actual runtime.[3]
Email verification and account recovery
Email/password sign-in must be enabled explicitly. Verification and password-reset emails use callbacks supplied by the application, so having the library installed does not establish successful mail delivery. The documented email-verification requirement for password sign-in does not automatically impose the same policy on social sign-in. Password reset also leaves other active sessions in place by default unless its revocation option is enabled. Those are decision-relevant configuration details for a complete account lifecycle, not merely visual login-form choices.[5]
Session caching changes revocation behavior
Better Auth distinguishes the primary session identifier cookie from optional cached session data and from the JWT plugin's token output. Cookie caching can avoid repeated database checks, but the detailed session guide warns that a revoked session may still work on another device until the cache expires. Sensitive operations can request fresh verification rather than relying on cached state. This qualification is more precise than describing every revocation as immediately logging out every device under every configuration.[6]
Origins and reverse proxies
The security reference documents origin validation, cookie settings and other request protections. It warns that disabling CSRF checks exposes state-changing requests and that disabling origin checks also disables CSRF protection for backward compatibility. Reverse-proxy headers must come from infrastructure the operator actually trusts; otherwise forged headers can affect client-IP detection or callback construction. A generated workaround that simply turns off these checks is therefore a material security change, not evidence that an integration has been fixed.[7]
Rate limits and development behavior
The built-in limiter has production defaults and route-specific rules, but it is disabled in development unless enabled. Direct server-side auth.api calls are not subject to the client-initiated-request limiter. This means local testing or a custom server endpoint may exercise a different protection boundary than the normal browser route. Applications must assess the paths they expose rather than infer complete abuse protection from the presence of a rate-limit feature.[8]
License, data and operating costs
The core repository uses the MIT license. Running authentication within the application's infrastructure changes where account data is maintained, but does not eliminate database, hosting or mail-delivery work and associated costs. The telemetry documentation says usage reporting is optional and disabled by default; if enabled, it can include runtime, framework, database and system metadata and a redacted configuration snapshot. That documented default is not a claim that every external provider or application integration has the same data policy.[2][3][4][5][9]
Substitution and migration scope
Better Auth can be considered instead of the authentication portion of Firebase for email/password or social sign-in in a suitable TypeScript application. Firebase supplies a managed authentication backend tightly integrated with its other services, whereas this framework requires the application's chosen server and persistence configuration. Matching sign-in methods does not establish compatible account identifiers, password hashes, active sessions or data-access rules. No verified Firebase-specific conversion procedure was established here, so migration should be treated as implementation work rather than a drop-in replacement of the broader platform. No security audit or hands-on deployment was performed.[1][3][10]
Capabilities & limitations
Application-owned authentication
supportedCan run inside the application or as a standalone server with supported database adapters.[3][4]
Application-controlled authentication in TypeScript web services · TypeScript server applications, Web clients · Version, build and integration requirements apply
2 sources · check evidence
Embedded or standalone self-hosted operation and data ownership model; vendor positioning
vendor · checked 2026-10-07Secret, base URL, database adapters, migrations, route handler and clients
vendor · checked 2026-10-07Password recovery
limitedApplication supplies the email-sending callback; existing sessions are not revoked on password reset by default.[5]
Application-controlled authentication in TypeScript web services · TypeScript server applications, Web clients · Version, build and integration requirements apply
1 source · check evidence
Explicit enablement, email-delivery callbacks and password-reset session revocation
vendor · checked 2026-10-07Immediate cached-session revocation
limitedWhen cookie caching is enabled, other-device sessions can remain valid until cache expiry unless fresh verification bypasses the cache.[6]
Application-controlled authentication in TypeScript web services · TypeScript server applications, Web clients · Version, build and integration requirements apply
1 source · check evidence
Cookie-cache revocation lag and distinction from JWT plugin tokens
vendor · checked 2026-10-07Built-in rate limiting
limitedEnabled in production and disabled in development by default; direct server auth.api calls are outside its client-request limiter.[8]
Application-controlled authentication in TypeScript web services · TypeScript server applications, Web clients · Version, build and integration requirements apply
1 source · check evidence
Production/development defaults and auth.api exclusion
vendor · checked 2026-10-07Firebase-wide replacement
unsupportedThe supported comparison is authentication; the inspected scope does not provide Firebase's database, storage and broader application services.[1][10]
Application-controlled authentication in TypeScript web services · TypeScript server applications, Web clients · Version, build and integration requirements apply
2 sources · check evidence
TypeScript framework, authentication features and plugin scope
vendor · checked 2026-10-07Managed authentication backend and integration with other Firebase services
vendor · checked 2026-10-07Can substitute for
These are products or services this entry can replace. Check the task and limitations for each comparison.
Firebase for Application-controlled authentication in TypeScript web services
limitedCandidate for replacing email/password and social-login responsibilities currently handled by Firebase Authentication in a TypeScript application. Does not replace the whole Firebase platform or establish drop-in account/session migration.[1][3][10]
TypeScript server applications, Web clients · Version, build and integration requirements apply
References
- Better Auth introduction
TypeScript framework, authentication features and plugin scope
vendor · retrieved 2026-10-07 - Better Auth source license
MIT license
vendor · retrieved 2026-10-07 - Better Auth installation
Secret, base URL, database adapters, migrations, route handler and clients
vendor · retrieved 2026-10-07 - Better Auth comparison
Embedded or standalone self-hosted operation and data ownership model; vendor positioning
vendor · retrieved 2026-10-07 - Better Auth email and password
Explicit enablement, email-delivery callbacks and password-reset session revocation
vendor · retrieved 2026-10-07 - Better Auth session management
Cookie-cache revocation lag and distinction from JWT plugin tokens
vendor · retrieved 2026-10-07 - Better Auth security reference
Trusted origins/proxy headers and risks of disabling checks
vendor · retrieved 2026-10-07 - Better Auth rate limiting
Production/development defaults and auth.api exclusion
vendor · retrieved 2026-10-07 - Better Auth telemetry
Optional disabled-by-default telemetry and reported metadata
vendor · retrieved 2026-10-07 - Firebase Authentication
Managed authentication backend and integration with other Firebase services
vendor · retrieved 2026-10-07
Discussion & disputes
Ask about unclear claims or explain a concern with supporting sources. If you have a specific fix, suggest a correction.
No discussion yet.
Revision history
Open a revision to read an earlier version of this article.
| Revision | Timestamp | Edit summary |
|---|---|---|
| 1383 | 2026-10-14 08:41:10 | /* wbeditentity-create-item:0| */ sf:39d32854-382c-4ad5-a14e-434a181e6580:v1 | Add Better Auth as a narrow substitute for Firebase's authentication layer, with operational setup, email delivery, rate-limit boundaries and delayed cached-ses | attribution: /proposals/39d32854-382c-4ad5-a14e-434a181e6580 |