NNextron Docs
Modules

Authentication

Understand provider-specific routes, clients, sessions, and environment variables.

Provider comparison

ProviderModelDatabase requirementGenerated sign-in experience
Better AuthSelf-hostedRequiredEmail and password pages under /login and /register
ClerkHostedOptionalClerk catch-all routes under /sign-in and /sign-up
NextAuthSelf-hostedRequired by the generated adapterProvider flow through Auth.js routes

Better Auth

Set BETTER_AUTH_SECRET to at least 32 characters and set BETTER_AUTH_URL to the application origin. The generated client is available under src/modules/auth/client, while server configuration stays under src/modules/auth/server.

After changing the auth schema, run:

npx better-auth generate

Clerk

Set CLERK_SECRET_KEY and NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY. Nextron wraps the root layout with ClerkProvider and generates provider-native account UI.

NextAuth

Set AUTH_SECRET, then configure OAuth credentials for the providers enabled in src/modules/auth/server/auth.ts. Nextron adds SessionProvider to the root layout for client session access.

Route protection

When Dashboard is selected, Nextron generates middleware matched to the chosen provider. The middleware protects /dashboard and /settings without mixing APIs from another auth implementation.

On this page