Clerk Basics
What Clerk is and how it handles sign up and log in for you
Pixl presents
Building your own login from scratch? Bold. Clerk handles sign up, verification emails and sessions so you don't have to.Building your own login from scratch? Bold. Clerk handles sign up, verification emails and sessions so you don't have to.

Every app with users needs a way for people to sign up and log in. Clerk is the hosted option from the intro to this module... a service that runs that whole job for you.
A Quick Recap#
Back in the What Is Authentication? lesson, we said authentication proves who someone is and authorization decides what they're allowed to do. Clerk handles the authentication part. Your app still handles authorization.
Enter Clerk#

Clerk handles all of that login work for you. You add Clerk to your app, and right away you get this stuff.
- Good looking login pages you can customize
- Secure password storage
- Social login (Google, Apple, GitHub, etc.)
- Email verification
- Two-factor authentication
- Session management
How Clerk Works#
So what actually happens when someone uses your Clerk-powered app? Let's walk through it.
Signing Up#
Step 1. User Clicks 'Sign Up'#
Your app shows a signup form. Clerk provides that form, so it looks professional and it works right out of the box.
Step 2. User Enters Information#
The user types in their email and picks a password. Clerk checks that the password is strong enough (sorry, "password123").
Step 3. Clerk Sends Verification Email#
To make sure the email is real, Clerk emails a short verification code (or a link, if you switch that on in the dashboard). That's how it keeps fake signups out.
Step 4. User Enters the Code#
Typing in the code (or clicking the link) proves the user owns that email address. Now their account is active.
Step 5. Clerk Creates a Session#
Clerk creates a "session," which is a secure way to remember that this user is logged in. From here your app can trust who they are.
Logging In#
Step 1. User Enters Credentials#
The user types their email and password into the login form.
Step 2. Clerk Verifies Password#
Clerk checks whether the password is correct. And it does that securely, without EVER storing the actual password.
Step 3. Session Created#
If the password checks out, Clerk creates a session. The user is logged in.
Step 4. Your App Knows Who They Are#
Now your app can ask Clerk "who's the current user?" and get their info back. Pretty painless, right?
This lesson ends with a short activity.