Skip to Content
DocumentationAuthenticationBetter Auth

Better Auth

Our templates use Better Auth for authentication and session management. Before setting up any other authentication method, make sure to configure Better Auth first.

Follow these steps to set it up:

  1. Add environment variables to your .env file:
BETTER_AUTH_SECRET= BETTER_AUTH_URL=http://localhost:3000 #Base URL of your app

Make sure to generate a secure BETTER_AUTH_SECRET before using it in production.
You can do this with OpenSSL by running: openssl rand -base64 32

  1. Start your app
pnpm dev
  1. Better Auth is ready
  • Authentication routes are already set up.
  • You can now sign up, log in, and manage sessions.
Last updated on