← All templatesBetter Auth + Next.js + Prisma
Authentication on Next.js with Better Auth, users and sessions stored in Postgres via Prisma.
TypeScriptAuth & AIPostgres
Get the AI promptWhat you can build with it
- Apps for people outside your company domain
- Sign-up flows and member areas
- Multi-user tools with roles
What's inside
- Better Auth setup
- Prisma auth schema
- Postgres via DATABASE_URL
Before you deploy
- Set BETTER_AUTH_SECRET to a long random string and BETTER_AUTH_URL to the app's URL.
- Set
BETTER_AUTH_SECRET, BETTER_AUTH_URL as secrets with elula env secret. - Add a managed Postgres with
elula init --database; the connection string is injected as DATABASE_URL.
Source
github.com/prisma/prisma-examples/tree/latest/orm/betterauth-nextjs