Skip to content

Better Auth

Add account and sign-in behavior with an open-source library that runs in your app. Connect the screens, hosting and services you need.

Visit Better Auth

What does Better Auth do for my app?

Better Auth is an open-source code library that adds account and sign-in behavior to a JavaScript or TypeScript web app. Your app runs the library. You arrange the login screens, the server that runs it and the database for the account setup described here.

Use the library when someone can maintain the app’s code, updates and account storage. The optional managed infrastructure has separate features and pricing.

How do I create one working test account?

Connect Better Auth to your framework and a supported database, create the required account tables, and enable email and password sign-in. Connect a test sign-up form and confirm you can leave and sign in again.

The setup uses a secret your app keeps on its server and a database connection. Apply the table changes with the method for your chosen database connection. Keep the test setup and its customer accounts separate from the live app.

Does a working login protect my app’s saved records?

Your server can use Better Auth to check who is signed in. Your own code must also check whether that person can read or change the requested record.

In a booking app, check ownership using the signed-in account on the server. Try the same request from a second customer account and inspect the stored result. For shared workspaces, check the current membership and the requested action too.

Who sends the recovery email?

For an email-and-password account, connect Better Auth’s password reset function to an email service. The library provides the link and reset behavior. Your app supplies delivery and the screen the customer uses.

Test delivery and expired links with disposable accounts. The default documented reset keeps other sessions active. Better Auth provides a setting to revoke them on password reset. Choose the intended behavior and test it in a second browser.

Can I ask for a second sign-in check?

Better Auth’s two-factor add-on supports an authenticator app and backup codes. Your app needs screens for turning it on, entering the extra code and handling lost access.

For the authenticator-app path, complete enrollment with a code from that app before relying on the extra check. Store backup codes somewhere private. If you offer codes by email or text, connect delivery for the chosen channel.

What costs money when I run it?

The library is available under the MIT license. Budget for your app’s hosting, database and account messages. Better Auth also sells optional infrastructure with its own rates.

The optional service prices below are dollar amounts as listed November 8, 2026. Check checkout currency, taxes and your provider bills.

On optional Infrastructure Pro, Better Auth lists $0.001 per managed email and $0.09 per managed text message. These are delivery charges for that service.

Costs for a Better Auth setup
PartHow it is chargedWhat to check
Open-source libraryNo subscription charge for the libraryBudget for operating the app and keeping the library up to date.
Your app servicesYour host, database and email or text providers set their own ratesCheck recurring service costs and account message volume.
Optional Infrastructure Starter$0 per monthOne person can use the dashboard. Includes 10,000 account activity records and 1,000 security detections per month. The activity records are kept for one day.
Optional Infrastructure Pro$20 per monthIncludes 20,000 activity records and 10,000 security detections per month. Then $0.0001 per additional record and $0.001 per additional detection.

On a small screen, scroll the table sideways to read every column.

What can I take with me if I change services?

In this setup, you control the database that stores the account records. Save a tested backup with the account data and the app configuration needed to restore sign-in.

A different sign-in service may use a different password format or account ID. Better Auth’s default password hashing uses scrypt. Check whether the destination can verify your stored hashes before promising that existing passwords will still work. Plan for a fresh sign-in or password reset where needed. Keep secret values in protected settings.

Can I add invitations for a customer team later?

The organization add-on supplies records and actions for members, invitations and roles. It gives your app a way to describe the team. Your code still checks which records a member may use.

Connect email delivery for invitation links if you want customers to receive them by email. Try an invite, an ordinary member action and access after removing the member.

Where can you learn the next steps?