Files
better-auth/demo/nextjs
Gustavo Valverde eb3cd10d50 chore: resolve main-to-next sync conflicts
- keep next package versions at 1.7.0-beta.1
- keep both changelog streams by inserting the stable 1.6.5, 1.6.6, and 1.6.7 sections below the 1.7.0-beta entries
- keep the cimd and dash deps on demo/nextjs (next-only); regenerate pnpm-lock.yaml
- resolve TODO(sync-from-main-9226) in oauth-provider authorize.ts: findRegisteredRedirectUri now uses isLoopbackIP from @better-auth/core/utils/host to cover the full 127.0.0.0/8 range per RFC 8252 §7.3
- drop the unused saml import that main's #9262 added to sso/src/routes/sso.ts; next already migrated to saml-pipeline
2026-04-22 14:54:27 +01:00
..
2024-10-11 21:16:21 +03:00
2024-10-14 20:06:29 +03:00
2026-01-27 23:12:31 +00:00

Better Auth Demo App

Welcome to the Better Auth demo app! This project is built with Next.js using create-next-app.

Getting Started

Heres how you can get the app running locally:

Prerequisites

  1. Clone the repo:

    git clone https://github.com/better-auth/better-auth
    cd better-auth/demo/nextjs
    
  2. Install the dependencies:

    npm install
    # or
    yarn install
    # or
    pnpm install
    
  3. Set up your environment variables:

    • Rename the .env.example file to .env:

      mv .env.example .env
      
    • Open .env and fill in the required details. These will include things like API URLs, client IDs, and secrets needed to connect to the Better Auth service.

Make sure TURSO_DATABASE_URL=your_turso_url and TURSO_AUTH_TOKEN=your_turso_token is set or USE_MYSQL=true and MYSQL_DATABASE_URL=your_mysql_url is set.

Start the Development Server

Once everything is set up, start the development server with:

npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev

The app will be live at http://localhost:3000. Open it in your browser, and youre good to go!

Feel free to jump in and edit the app by modifying app/page.tsx. Any changes you make will update automatically in the browser.

Features

Heres what this app supports out of the box:

Learn More

Here are some helpful links if you want to dive deeper:


If you run into issues or have suggestions, feel free to open an issue or submit a pull request on the GitHub repo.

Happy coding!