JB Better Auth UI
shadcn/ui Registry

Beautiful Auth Components
for Better Auth

A complete set of authentication UI components for Next.js. Built with shadcn/ui, React Hook Form, and Zod. Ready to use with Better Auth.

npx shadcn@latest add https://better-auth-ui.desishub.com/r/auth-components.json

Why JB Better Auth UI?

One Command Install

Install all auth components with a single shadcn CLI command

Better Auth Integration

Pre-configured for Better Auth with email OTP and social providers

Fully Customizable

Built with shadcn/ui - easily customize to match your brand

Type Safe

Written in TypeScript with Zod validation schemas

Installation

1

Prerequisites

Make sure you have a Next.js project with shadcn/ui initialized:

npx shadcn@latest init
2

Install Components

Run the following command to install all auth components:

npx shadcn@latest add https://better-auth-ui.desishub.com/r/auth-components.json
3

Configure Environment Variables

Copy the generated .env.example to .env.local and fill in your values:

cp .env.example .env.local
View full environment variables guide
4

Initialize Prisma

Generate the Prisma client and run migrations:

pnpm prisma generate
pnpm prisma migrate dev --name init
5

Configure Better Auth

Create your Better Auth server configuration:

// lib/auth.ts
import { betterAuth } from "better-auth";
import { emailOTP } from "better-auth/plugins";

export const auth = betterAuth({
  database: prismaAdapter(prisma, { provider: "postgresql" }),
  emailAndPassword: {
    enabled: true,
    requireEmailVerification: true,
  },
  plugins: [
    emailOTP({
      sendVerificationOTP: async ({ email, otp }) => {
        // Send email with OTP
      },
    }),
  ],
});
6

Start Using Components

Auth pages are automatically created in app/(auth)/auth/. You can also import components directly:

import { SignIn, SignUp, Profile, LogoutButton } from "@/components/auth";

// Use in your pages
<SignIn />
<SignUp />
<Profile />
<LogoutButton />

What You Get

Components

  • SignIn with social OAuth
  • SignUp with email verification
  • VerifyEmail with OTP input
  • Password reset flow
  • Profile management
  • LogoutButton component

Utilities

  • Auth client configuration
  • Zod validation schemas
  • TypeScript types
  • Icon components
  • Toast notifications
  • Loading states

Dependencies

The following packages will be installed automatically:

better-authzodreact-hook-form@hookform/resolverssonnerlucide-reactinput-otp

Ready to Get Started?

Add production-ready auth components to your Next.js app in seconds.