https://github.com/onmax/nuxthub-better-auth-starter
NuxtHub + Better Auth starter template with email/password and GitHub OAuth
https://github.com/onmax/nuxthub-better-auth-starter
Last synced: 5 months ago
JSON representation
NuxtHub + Better Auth starter template with email/password and GitHub OAuth
- Host: GitHub
- URL: https://github.com/onmax/nuxthub-better-auth-starter
- Owner: onmax
- Created: 2026-01-01T20:44:17.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2026-01-02T09:58:54.000Z (6 months ago)
- Last Synced: 2026-01-07T08:06:55.555Z (5 months ago)
- Language: Vue
- Homepage: https://onmax-nuxthub-better-auth-starter.maximogarciamtnez.workers.dev/
- Size: 250 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# NuxtHub Better Auth Starter
Minimal [NuxtHub](https://hub.nuxt.com) + [Better Auth](https://better-auth.com) template. Multi-cloud ready.
## Features
- Email/password + GitHub OAuth
- Session storage with KV
- Protected routes via route rules
- Nuxt UI components
## Setup
```bash
pnpm install
cp .env.example .env
pnpm dev
```
Create GitHub OAuth App at https://github.com/settings/developers with callback `http://localhost:3000/api/auth/callback/github`
## Deploy
NuxtHub auto-detects your hosting provider. Configure bindings per platform:
### Cloudflare Workers
```bash
# Create resources
wrangler d1 create my-db
wrangler kv namespace create KV
wrangler kv namespace create CACHE
# Update wrangler.jsonc with IDs, then:
pnpm build && wrangler deploy
```
### Vercel
Set environment variables in Vercel dashboard:
- `DATABASE_URL` - Neon/Supabase PostgreSQL
- `KV_REST_API_URL` + `KV_REST_API_TOKEN` - Vercel KV or Upstash
### Turso + Upstash (any host)
```env
TURSO_DATABASE_URL=libsql://your-db.turso.io
TURSO_AUTH_TOKEN=your-token
UPSTASH_REDIS_REST_URL=https://your-redis.upstash.io
UPSTASH_REDIS_REST_TOKEN=your-token
```
## Environment Variables
| Variable | Required | Description |
|----------|----------|-------------|
| `NUXT_BETTER_AUTH_SECRET` | Yes | Auth secret (32+ chars) |
| `NUXT_PUBLIC_SITE_URL` | Yes | Site URL for OAuth callbacks |
| `GITHUB_CLIENT_ID` | Yes | GitHub OAuth client ID |
| `GITHUB_CLIENT_SECRET` | Yes | GitHub OAuth secret |
See `.env.example` for database/KV provider options.
## License
MIT