How to Register with Only Username, Email, and Password?

Hey guys, how’s it going?

I need some help. I’m working on a registration form and I just want to use a username, email, and password—but I can’t get it to work properly.

The "name" field is always required, so I was thinking of just using it to store the username. It’s kinda weird, but it could work.

The problem is, I’m not sure how to tweak the registration logic to check if the username (which would be stored in the "name" field) is unique.

I also want to add another field on the backend to store a normalized version of the username, but I have no idea how to modify BetterAuth’s registration logic to make that happen.

Right now, I’m only doing frontend validation with Zod and some basic checks in
auth.ts
, like setting minPasswordLength and maxPasswordLength.

Any tips on how to make this work?
Appreciate it!
Solution
The name field is for Display names, I think plans are to make it optional in the future but not currently possible.

Use the username plugin check docs here https://www.better-auth.com/docs/plugins/username#signup-with-username

Also if you dont need the name just set to ''
Username plugin
Was this page helpful?