{"schemaVersion":"1.0","record":{"label":"Better Auth","description":"Open-source TypeScript authentication framework with database adapters, session management and optional authentication plugins.","aliases":[],"kind":"software","website":"https://better-auth.com/","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.","license":"MIT; hosting, databases, email delivery and external identity providers are separate.","lifecycle":"active","example":false,"features":[{"name":"Application-owned authentication","status":"supported","detail":"Can run inside the application or as a standalone server with supported database adapters.","useCase":"Application-controlled authentication in TypeScript web services","platforms":["TypeScript server applications","Web clients"],"region":"Version, build and integration requirements apply","evidence":[{"url":"https://better-auth.com/docs/comparison","locator":"Embedded or standalone self-hosted operation and data ownership model; vendor positioning","retrievedAt":"2026-10-07T22:39:04Z","kind":"vendor"},{"url":"https://better-auth.com/docs/installation","locator":"Secret, base URL, database adapters, migrations, route handler and clients","retrievedAt":"2026-10-07T22:38:27Z","kind":"vendor"}]},{"name":"Password recovery","status":"limited","detail":"Application supplies the email-sending callback; existing sessions are not revoked on password reset by default.","useCase":"Application-controlled authentication in TypeScript web services","platforms":["TypeScript server applications","Web clients"],"region":"Version, build and integration requirements apply","evidence":[{"url":"https://better-auth.com/docs/authentication/email-password","locator":"Explicit enablement, email-delivery callbacks and password-reset session revocation","retrievedAt":"2026-10-07T22:39:04Z","kind":"vendor"}]},{"name":"Immediate cached-session revocation","status":"limited","detail":"When cookie caching is enabled, other-device sessions can remain valid until cache expiry unless fresh verification bypasses the cache.","useCase":"Application-controlled authentication in TypeScript web services","platforms":["TypeScript server applications","Web clients"],"region":"Version, build and integration requirements apply","evidence":[{"url":"https://better-auth.com/docs/concepts/session-management","locator":"Cookie-cache revocation lag and distinction from JWT plugin tokens","retrievedAt":"2026-10-07T22:38:40Z","kind":"vendor"}]},{"name":"Built-in rate limiting","status":"limited","detail":"Enabled in production and disabled in development by default; direct server auth.api calls are outside its client-request limiter.","useCase":"Application-controlled authentication in TypeScript web services","platforms":["TypeScript server applications","Web clients"],"region":"Version, build and integration requirements apply","evidence":[{"url":"https://better-auth.com/docs/concepts/rate-limit","locator":"Production/development defaults and auth.api exclusion","retrievedAt":"2026-10-07T22:39:04Z","kind":"vendor"}]},{"name":"Firebase-wide replacement","status":"unsupported","detail":"The supported comparison is authentication; the inspected scope does not provide Firebase's database, storage and broader application services.","useCase":"Application-controlled authentication in TypeScript web services","platforms":["TypeScript server applications","Web clients"],"region":"Version, build and integration requirements apply","evidence":[{"url":"https://better-auth.com/docs/introduction","locator":"TypeScript framework, authentication features and plugin scope","retrievedAt":"2026-10-07T22:38:27Z","kind":"vendor"},{"url":"https://firebase.google.com/docs/auth","locator":"Managed authentication backend and integration with other Firebase services","retrievedAt":"2026-10-07T22:38:55Z","kind":"vendor"}]}],"alternatives":[],"slug":"better-auth","draftAlternatives":[{"targetSlug":"firebase","status":"limited","detail":"Candidate 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.","useCase":"Application-controlled authentication in TypeScript web services","platforms":["TypeScript server applications","Web clients"],"region":"Version, build and integration requirements apply","evidence":[{"url":"https://better-auth.com/docs/introduction","locator":"TypeScript framework, authentication features and plugin scope","retrievedAt":"2026-10-07T22:38:27Z","kind":"vendor"},{"url":"https://better-auth.com/docs/installation","locator":"Secret, base URL, database adapters, migrations, route handler and clients","retrievedAt":"2026-10-07T22:38:27Z","kind":"vendor"},{"url":"https://firebase.google.com/docs/auth","locator":"Managed authentication backend and integration with other Firebase services","retrievedAt":"2026-10-07T22:38:55Z","kind":"vendor"}]}],"evidence":[{"url":"https://better-auth.com/docs/introduction","locator":"TypeScript framework, authentication features and plugin scope","retrievedAt":"2026-10-07T22:38:27Z","kind":"vendor"},{"url":"https://github.com/better-auth/better-auth/blob/main/LICENSE.md","locator":"MIT license","retrievedAt":"2026-10-07T22:39:04Z","kind":"vendor"},{"url":"https://better-auth.com/docs/installation","locator":"Secret, base URL, database adapters, migrations, route handler and clients","retrievedAt":"2026-10-07T22:38:27Z","kind":"vendor"},{"url":"https://better-auth.com/docs/comparison","locator":"Embedded or standalone self-hosted operation and data ownership model; vendor positioning","retrievedAt":"2026-10-07T22:39:04Z","kind":"vendor"},{"url":"https://better-auth.com/docs/authentication/email-password","locator":"Explicit enablement, email-delivery callbacks and password-reset session revocation","retrievedAt":"2026-10-07T22:39:04Z","kind":"vendor"},{"url":"https://better-auth.com/docs/concepts/session-management","locator":"Cookie-cache revocation lag and distinction from JWT plugin tokens","retrievedAt":"2026-10-07T22:38:40Z","kind":"vendor"},{"url":"https://better-auth.com/docs/reference/security","locator":"Trusted origins/proxy headers and risks of disabling checks","retrievedAt":"2026-10-07T22:38:40Z","kind":"vendor"},{"url":"https://better-auth.com/docs/concepts/rate-limit","locator":"Production/development defaults and auth.api exclusion","retrievedAt":"2026-10-07T22:39:04Z","kind":"vendor"},{"url":"https://better-auth.com/docs/reference/telemetry","locator":"Optional disabled-by-default telemetry and reported metadata","retrievedAt":"2026-10-07T22:39:04Z","kind":"vendor"},{"url":"https://firebase.google.com/docs/auth","locator":"Managed authentication backend and integration with other Firebase services","retrievedAt":"2026-10-07T22:38:55Z","kind":"vendor"}],"document":{"version":1,"references":[{"url":"https://better-auth.com/docs/introduction","locator":"TypeScript framework, authentication features and plugin scope","retrievedAt":"2026-10-07T22:38:27Z","id":"intro","title":"Better Auth introduction","kind":"vendor"},{"url":"https://github.com/better-auth/better-auth/blob/main/LICENSE.md","locator":"MIT license","retrievedAt":"2026-10-07T22:39:04Z","id":"license","title":"Better Auth source license","kind":"vendor"},{"url":"https://better-auth.com/docs/installation","locator":"Secret, base URL, database adapters, migrations, route handler and clients","retrievedAt":"2026-10-07T22:38:27Z","id":"install","title":"Better Auth installation","kind":"vendor"},{"url":"https://better-auth.com/docs/comparison","locator":"Embedded or standalone self-hosted operation and data ownership model; vendor positioning","retrievedAt":"2026-10-07T22:39:04Z","id":"comparison","title":"Better Auth comparison","kind":"vendor"},{"url":"https://better-auth.com/docs/authentication/email-password","locator":"Explicit enablement, email-delivery callbacks and password-reset session revocation","retrievedAt":"2026-10-07T22:39:04Z","id":"email","title":"Better Auth email and password","kind":"vendor"},{"url":"https://better-auth.com/docs/concepts/session-management","locator":"Cookie-cache revocation lag and distinction from JWT plugin tokens","retrievedAt":"2026-10-07T22:38:40Z","id":"session","title":"Better Auth session management","kind":"vendor"},{"url":"https://better-auth.com/docs/reference/security","locator":"Trusted origins/proxy headers and risks of disabling checks","retrievedAt":"2026-10-07T22:38:40Z","id":"security","title":"Better Auth security reference","kind":"vendor"},{"url":"https://better-auth.com/docs/concepts/rate-limit","locator":"Production/development defaults and auth.api exclusion","retrievedAt":"2026-10-07T22:39:04Z","id":"rate","title":"Better Auth rate limiting","kind":"vendor"},{"url":"https://better-auth.com/docs/reference/telemetry","locator":"Optional disabled-by-default telemetry and reported metadata","retrievedAt":"2026-10-07T22:39:04Z","id":"telemetry","title":"Better Auth telemetry","kind":"vendor"},{"url":"https://firebase.google.com/docs/auth","locator":"Managed authentication backend and integration with other Firebase services","retrievedAt":"2026-10-07T22:38:55Z","id":"firebase","title":"Firebase Authentication","kind":"vendor"}],"overviewCitations":["intro","comparison"],"licenseCitations":["license","install","email"],"sections":[{"id":"integration","heading":"Integration is more than a sign-in component","paragraphs":[{"id":"integration-detail","content":[{"text":"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."}],"citations":["install"]}]},{"id":"email-workflow","heading":"Email verification and account recovery","paragraphs":[{"id":"email-workflow-detail","content":[{"text":"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."}],"citations":["email"]}]},{"id":"cache","heading":"Session caching changes revocation behavior","paragraphs":[{"id":"cache-detail","content":[{"text":"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."}],"citations":["session"]}]},{"id":"security-boundaries","heading":"Origins and reverse proxies","paragraphs":[{"id":"security-boundaries-detail","content":[{"text":"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."}],"citations":["security"]}]},{"id":"limits","heading":"Rate limits and development behavior","paragraphs":[{"id":"limits-detail","content":[{"text":"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."}],"citations":["rate"]}]},{"id":"rights","heading":"License, data and operating costs","paragraphs":[{"id":"rights-detail","content":[{"text":"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."}],"citations":["license","comparison","install","email","telemetry"]}]},{"id":"substitution","heading":"Substitution and migration scope","paragraphs":[{"id":"substitution-detail","content":[{"text":"Better Auth can be considered instead of the authentication portion of "},{"text":"Firebase","targetSlug":"firebase"},{"text":" 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."}],"citations":["intro","install","firebase"]}]}]},"id":"Q1335","revision":1383,"updatedAt":"2026-10-14T08:41:10Z","sourceUrl":"https://substitutefor.net/entities/Q1335?revision=1383"}}