mirror of
https://github.com/better-auth/better-auth.git
synced 2026-06-02 04:16:38 -05:00
* 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>
789 B
789 B
SvelteKit Better Auth Example
This is an example of how to use Better Auth with SvelteKit.
Implements the following features: Email & Password . Social Sign-in with Google . Passkeys . Email Verification . Password Reset . Two Factor Authentication . Profile Update . Session Management
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
cd /path/to/better-auth/ # Project root of this better-auth repo, not the root of this example pnpm install pnpm build cd ./examples/svelte-kit-example/ # The root of this example project pnpm migrate pnpm dev - Open the browser and navigate to
http://localhost:3000