How to Add User Login to Your App
Your app needs user accounts — letting people sign up, log in, and have their own data. This guide covers two options: Clerk (easier) and Better Auth (free forever).
This guide was written as of April 2026. If anything looks different, let us know.
Before you start
What you'll have at the end
Authentication keys in your .env file
Free tier
Clerk: 10K MAU free, then $25/mo. Better Auth: free forever (open source).
What is authentication?
Authentication means letting people create accounts, log in, and have their own data in your app. Without it, everyone sees the same thing.
Option 1: Clerk (easier)
Clerk gives you a login system with checkboxes — pick your login methods (Google, email, etc.) without writing code. Free up to 10,000 monthly active users.
Create an account at clerk.com. Create a new application. Get your Publishable Key and Secret Key. Add both to your .env file.
Option 2: Better Auth (free forever)
Better Auth is open source — free forever, no user limits. Setup is more complex, but your AI tool handles it. You just need the database from our database guide.
Tell your AI tool: "Add Better Auth with Turso for email and Google login." It handles the code.
Which one should I pick?
Clerk: Pick this if you want to get started fast and don't mind paying $25/month if you grow past 10K users.
Better Auth: Pick this if you want free forever with no user limits. The setup is more complex but your AI tool handles it.
Verify it works
Try signing up for your own app. If you can create an account and log in, you're done.
Tell Your AI Tool
Copy this prompt and paste it into your AI coding tool. It tells your AI exactly what credentials you just set up.
I've set up [Clerk / Better Auth] for authentication. My keys are in my .env file. Add a login page and protect the dashboard so only logged-in users can access it.
Paste the prompt into the chat panel (Cmd+L or Ctrl+L). Cursor can also read your .env file directly — if your credentials are there, it already knows.
YepAPI Tip
Now your app has users. Give each one a personalized dashboard powered by YepAPI data.
Was this guide helpful?
User Login — FAQ
Authentication lets people create accounts, log in, and have their own data in your app. It's what makes the difference between a public page and a personal dashboard.
Clerk is easier to set up (dashboard with checkboxes) but costs $25/month after 10K users. Better Auth is free forever (open source) but requires more setup — though your AI tool handles most of it.
Yes, up to 10,000 monthly active users. After that, it's $25/month. For most side projects, you'll never hit the limit.
Only if your app needs user accounts — personal dashboards, saved data, or different views per user. If it's a public tool with no user data, you can skip auth.
Start vibe coding with one API key.
One API key. 100+ endpoints. Yep, that's it.