* chore: consistent package names * chore: init changesets * chore: update contribution doc to include generating a changeset * chore: configure all better auth packages to always have the same version number * chore: update nextjs demo package name * chore(changesets): ignore all private packages * chore(changesets): check for changesets in CI * chore(changesets): install chagesets cli * chore(changesets): use orgin as main * chore(changesets): fix typo * chore(changesets): check for changes since main in ci * chore(changesets): check for changes since main in ci with the correct command * chore(changesets): check against `origin/main` * chore(changesets): checking for changesets should be the last action * chore(changesets): run changelog check after stoping the docker containers * chore(changesets): run changelog check after building * chore(changesets): run changelog check after starting docker compose * chore(changesets): run changelog check after linting * chore(changesets): run changelog check after testing * Revert "chore(changesets): run changelog check after testing" This reverts commit 6dc000f78d30fa3622e37fc0d8699cc99ed868b6. * chore: export siwe in better-auth/plugins (#3596) The docs were using this import path, yet `siwe` wasn't exported there. This PR fixes this. * chore: fix cookies test * docs: make client-side vs. server-side explicit (#3603) * docs: fix broken link to ERC-4361 in siwe docs (#3604) * fix(jwt): ensure alg is added to the jwks when generating via /token endpoint (#3601) * fix: Ensure alg is added to the jwks when generating via /token endpoint * chore: resolve linting issues * chore(example): fix SvelteKit example (#1742) * refactor: upgrade Svelte, Vite and related packages * refactor: replace no longer supported `body.callbackURL` with `onSuccess` * fix: add missing `svelte-kit sync` on `prepare` * fix: add missing `import`s * chore(svelte-kit-example): show message & redirect to index after sign up * chore: add npm script to migrate database * doc: add more commands to set up * chore: explicitly disable verification email on sign up The example does not work if you set `sendOnSignUp: true` without setting up the email server. * refactor(svelte-kit-example): add type for hooks * chore(svelte-kit-example): redirect to sign in page if users open dashboard without log in * chore: diable some rules for svelte-kit-example due to Biome's limited Svelte support * style: fix format * chore: update pnpm-lock.yaml * chore: fix lock file --------- Co-authored-by: Bereket Engida <Bekacru@gmail.com> * fix: make sveltekit plugin ALS-agnostic (#3533) * svelte cookie * udpate * update * update * update * chore(cli): update zod to v4 (#3618) * fix: correct typo in freeTrial variable name in Stripe integration * chore: fix lock file * chore: add changeset for typo fix in freeTrial --------- Co-authored-by: Maxwell <145994855+ping-maxwell@users.noreply.github.com> Co-authored-by: Bereket Engida <Bekacru@gmail.com> Co-authored-by: Justin <127172022+jl33-ai@users.noreply.github.com> Co-authored-by: Elliott Minns <elliott.minns@pm.me> Co-authored-by: Jumpei Ogawa <git@phanective.org> Co-authored-by: KinfeMichael Tariku <65047246+Kinfe123@users.noreply.github.com>
Better Auth Demo App
Welcome to the Better Auth demo app! This project is built with Next.js using create-next-app.
Getting Started
Here’s how you can get the app running locally:
Prerequisites
-
Clone the repo:
git clone https://github.com/better-auth/better-auth cd better-auth/demo/nextjs -
Install the dependencies:
npm install # or yarn install # or pnpm install -
Set up your environment variables:
-
Rename the
.env.examplefile to.env:mv .env.example .env -
Open
.envand fill in the required details. These will include things like API URLs, client IDs, and secrets needed to connect to the Better Auth service.
-
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 you’re 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
Here’s what this app supports out of the box:
- Email & Password: Simple and secure authentication.
- Organization / Teams: Manage users within organizations or teams.
- Passkeys: Passwordless login using modern authentication standards.
- Multi-Factor Authentication (MFA): Add an extra layer of security.
- Password Reset: Let users reset their passwords if they forget them.
- Email Verification: Ensure users verify their email addresses.
- Roles & Permissions: Define and manage who can do what.
- Rate Limiting: Protect your app from abuse with smart limits.
- Session Management: Handle user sessions seamlessly.
- Stripe Plugin: Integrate Stripe for customer management, subscriptions, and webhooks.
Learn More
Here are some helpful links if you want to dive deeper:
- Better Auth Documentation - Everything you need to know to integrate Better Auth.
- Next.js Documentation - Learn about the framework we used to build this app.
- Learn Next.js - A hands-on tutorial for Next.js.
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!