Next.js Example
This is an example of how to use Better Auth with Next.
Implements the following features: Email & Password . Social Sign-in . Passkeys . Email Verification . Password Reset . Two Factor Authentication . Profile Update . Session Management . Organization, Members and Roles
See Demo
How to run
- Clone the code sandbox (or the repo) and open it in your code editor
- Move .env.example to .env and provide necessary variables
- Run the following commands
pnpm install pnpm dev - Open the browser and navigate to
http://localhost:3000
SSO Login Example
For this example, we utilize DummyIDP. Initiate the login from the DummyIDP login, click "Proceed", and from here it will direct you to user's dashboard.
SCIM Sync Example
For this example, we utilize DummyIDP. Head out to the IDP dashboard and try to add, update or remove users, then go to the admin page or directly to your database and watch the synchronization work.