# Better Auth

Open\-source TypeScript authentication framework with database adapters, session management and optional authentication plugins\.

ID: Q1335 · Revision: 1383

Type: software · License: MIT; hosting, databases, email delivery and external identity providers are separate\.[^license][^install][^email] · Status: active

Website: https://better-auth.com/



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\.[^intro][^comparison]

## 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\.[^install]

## 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\.[^email]

## 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\.[^session]

## 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\.[^security]

## 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\.[^rate]

## 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\.[^license][^comparison][^install][^email][^telemetry]

## Substitution and migration scope

Better Auth can be considered instead of the authentication portion of [Firebase](/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\.[^intro][^install][^firebase]

## Capabilities and substitutions

### Application\-owned authentication — supported

Can run inside the application or as a standalone server with supported database adapters\.[^install][^comparison]

Use case: Application\-controlled authentication in TypeScript web services · Platforms: TypeScript server applications, Web clients · Region: Version, build and integration requirements apply

### Password recovery — limited

Application supplies the email\-sending callback; existing sessions are not revoked on password reset by default\.[^email]

Use case: Application\-controlled authentication in TypeScript web services · Platforms: TypeScript server applications, Web clients · Region: Version, build and integration requirements apply

### Immediate cached\-session revocation — limited

When cookie caching is enabled, other\-device sessions can remain valid until cache expiry unless fresh verification bypasses the cache\.[^session]

Use case: Application\-controlled authentication in TypeScript web services · Platforms: TypeScript server applications, Web clients · Region: Version, build and integration requirements apply

### Built\-in rate limiting — limited

Enabled in production and disabled in development by default; direct server auth\.api calls are outside its client\-request limiter\.[^rate]

Use case: Application\-controlled authentication in TypeScript web services · Platforms: TypeScript server applications, Web clients · Region: Version, build and integration requirements apply

### Firebase\-wide replacement — unsupported

The supported comparison is authentication; the inspected scope does not provide Firebase's database, storage and broader application services\.[^intro][^firebase]

Use case: Application\-controlled authentication in TypeScript web services · Platforms: TypeScript server applications, Web clients · Region: Version, build and integration requirements apply

### [Substitute for Firebase](/firebase) — limited

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\.[^intro][^install][^firebase]

Use case: Application\-controlled authentication in TypeScript web services · Platforms: TypeScript server applications, Web clients · Region: Version, build and integration requirements apply

## References

[^intro]: [Better Auth introduction](<https://better-auth.com/docs/introduction>) — TypeScript framework, authentication features and plugin scope (vendor; retrieved 2026-10-07T22:38:27Z)

[^license]: [Better Auth source license](<https://github.com/better-auth/better-auth/blob/main/LICENSE.md>) — MIT license (vendor; retrieved 2026-10-07T22:39:04Z)

[^install]: [Better Auth installation](<https://better-auth.com/docs/installation>) — Secret, base URL, database adapters, migrations, route handler and clients (vendor; retrieved 2026-10-07T22:38:27Z)

[^comparison]: [Better Auth comparison](<https://better-auth.com/docs/comparison>) — Embedded or standalone self\-hosted operation and data ownership model; vendor positioning (vendor; retrieved 2026-10-07T22:39:04Z)

[^email]: [Better Auth email and password](<https://better-auth.com/docs/authentication/email-password>) — Explicit enablement, email\-delivery callbacks and password\-reset session revocation (vendor; retrieved 2026-10-07T22:39:04Z)

[^session]: [Better Auth session management](<https://better-auth.com/docs/concepts/session-management>) — Cookie\-cache revocation lag and distinction from JWT plugin tokens (vendor; retrieved 2026-10-07T22:38:40Z)

[^security]: [Better Auth security reference](<https://better-auth.com/docs/reference/security>) — Trusted origins/proxy headers and risks of disabling checks (vendor; retrieved 2026-10-07T22:38:40Z)

[^rate]: [Better Auth rate limiting](<https://better-auth.com/docs/concepts/rate-limit>) — Production/development defaults and auth\.api exclusion (vendor; retrieved 2026-10-07T22:39:04Z)

[^telemetry]: [Better Auth telemetry](<https://better-auth.com/docs/reference/telemetry>) — Optional disabled\-by\-default telemetry and reported metadata (vendor; retrieved 2026-10-07T22:39:04Z)

[^firebase]: [Firebase Authentication](<https://firebase.google.com/docs/auth>) — Managed authentication backend and integration with other Firebase services (vendor; retrieved 2026-10-07T22:38:55Z)

Source revision: https://substitutefor.net/entities/Q1335?revision=1383
