# Clerk

> Add ready-made signup, sign-in, and account screens so people can return to your app under their own names.

Web page: https://buildladder.com/tools/clerk

For a course website, the first visit and the tenth visit should feel different. A new learner needs an account. A returning learner needs a quick way back in. Clerk handles these sign-in screens and tells your app which learner has signed in.

Try the flow with a test account. Sign up, sign out, and sign back in. Your app can use the same learner ID each time to find the lessons that person has saved.

- Made by: Clerk
- Official site: https://clerk.com
- Cost: Free Hobby plan for up to 50,000 monthly retained users per app. Pro is $25 a month, or $20 a month billed yearly.
- What you need first: A Clerk account.
- Who it helps: When people need their own accounts in your website or app.
- When to skip it: If you already use Supabase or Firebase for your data, each has its own sign-in feature. One service may be simpler than two.
- Updated: 2026-11-10

## Add sign-in with Clerk

Add ready-made sign-up and sign-in screens with email and Google. Clerk keeps the accounts, and Google works in development without any Google setup.

What you’ll end up with: People can sign up, sign in with email or Google, and sign out on Clerk’s screens. One page in your product is only for signed-in people.

### You’ll need

- A website or app with PLAN.md in its folder.
- Your AI tool, set up and working in that folder.
- A domain you own, when you put your product online. Clerk’s production setup needs one.
- Clerk account (https://dashboard.clerk.com): Free Hobby plan for up to 50,000 monthly retained users per app. Pro is $25 a month, or $20 a month billed yearly
- Google Cloud account (https://console.cloud.google.com): It uses your Google account, and you need it only to put your product online

### Your part

- Create the Clerk application and paste its keys into your .env file.
- Turn on email and Google in the Clerk dashboard.
- Sign up and sign in to check that it all works.
- Make your own Google keys before you put your product online.

### Step 1 of 9: Create a Clerk application

This step is mine to do. Walk me through it, one action at a time:
- Go to dashboard.clerk.com and create a free account.
- On the dashboard home, start creating an application and enter your product’s name.
- In the sign-in options, turn on email and Google if they’re offered.
- Finish creating the application. Keep its Development instance selected while you build and test.

It worked when: Your new Clerk application shows a Development banner in the dashboard.

If something goes wrong:
- You can’t find the sign-in options. Open User & authentication in the left menu. You can turn options on there at any time.

### Step 2 of 9: Turn on email sign-in

This step is mine to do. Walk me through it, one action at a time:
- In the Clerk dashboard, open User & authentication.
- Under email, turn on signing up and signing in with an email address.
- Choose verification by an emailed code. You can type the code in while testing.
- If you also want passwords, turn on the password option on the same page.
- Save your changes if the page asks you to.

It worked when: Email sign-in is on in User & authentication, using a code sent by email.

If something goes wrong:
- You’re not sure whether to use passwords. Email codes alone are fine to start. People type a code instead of remembering a password.

### Step 3 of 9: Phone app only: turn on the Native API

This step is mine to do. Walk me through it, one action at a time:
- In the Clerk dashboard, open the Native applications page.
- Turn on the Native API. Clerk notes this opens a way in that skips the CAPTCHA checks browsers get. That’s expected for phone apps.
- In Expo Go, use Clerk’s hosted sign-in screens, which open in a browser inside your app. Clerk’s native screens and a native Google button need a development build.
- A phone app gets only the publishable key, in .env as EXPO_PUBLIC_CLERK_PUBLISHABLE_KEY. Never put the secret key, which starts with sk_, in a phone app.
- Before building for a phone store, return to Native applications and add the identifiers for each phone platform you support. Your AI tool can find them in app.json.

It worked when: The Native applications page shows the Native API as on.

If something goes wrong:
- You can’t find Native applications. Make sure you’re in the right application and in its Development instance. Search Clerk’s docs for “Native applications”.

### Step 4 of 9: Add sign-up and sign-in pages

Read PLAN.md in this folder. It has my plan and the tools I chose.

I want people to sign up, sign in and sign out with Clerk. I already created a Clerk application in the Clerk dashboard, with email and Google turned on. Use that application. Don’t create a new one.

Before you start:
- Look at my product and tell me how it’s built, in plain words.
- Check Clerk’s current official docs for this kind of product. Don’t rely on memory.
- Tell me what you’ll install and change, and wait for my yes.

Then:
1. Create the env file with empty values for the keys my SDK needs. For Expo, use only EXPO_PUBLIC_CLERK_PUBLISHABLE_KEY. A secret key belongs only on a separate server when its SDK needs it, never in a phone product. Make Git ignore the file. Tell me where to find the keys. I’ll type them in myself.
2. Read the keys only from environment variables. Never put the secret key in code that runs in a browser or on a phone.
3. Add Clerk’s ready-made sign-up and sign-in screens, and a button that shows who is signed in and lets them sign out.
4. Show sign-in and sign-up buttons to people who aren’t signed in.

Keep everything that already works. When you’re done, explain what changed and give me a short list of things to try.

It worked when: Clicking Sign in in your product opens Clerk’s sign-in screen, with email and a Google button.

Before we move on, check with me:
- Does your env file hold the keys your SDK needs, and for Expo only the publishable key?
- Does your AI tool confirm that Git ignores .env?

If something goes wrong:
- You lost the secret key. If you need a new server secret, open Clerk’s API keys page and create a replacement. Keep it out of phone code.
- The AI tool wants to run a Clerk setup tool that makes a new app. Say: “Use the Clerk application I already made. Don’t create a new one.”

### Step 5 of 9: Turn on Google sign-in for testing

This step is mine to do. Walk me through it, one action at a time:
- In the Clerk dashboard, open SSO connections.
- If Google isn’t listed, select Add connection, then For all users, then Google.
- Leave Use custom credentials off for now. Clerk’s shared keys work in your Development instance.
- Open your product and click Sign in. Click the Google button and pick your account.

It worked when: You can sign in to your product with Google while it runs on your computer.

If something goes wrong:
- Google’s screen shows an address ending in accounts.dev. That’s normal in development. Your own domain shows once you set up production.
- Google sign-in fails inside another app’s browser. If Google sign-in is blocked inside an embedded browser, open your site in Chrome or Safari and test again.
- A native Google button doesn’t work in your phone app. It needs a development build, a Web OAuth client and a client for each phone platform you support. Clerk’s Expo Google guide lists the fields.

### Step 6 of 9: Make a page for signed-in people only

Read PLAN.md again. I want one page that only signed-in people can see. If you don’t know which page, ask me first.

Check Clerk’s current docs for protecting pages in this kind of product. Then:
- If someone who isn’t signed in opens that page, send them to the sign-in page.
- After they sign in, take them back to the page they wanted.
- Hiding a link isn’t enough. The page itself must check who is signed in, the way Clerk recommends.

Keep everything that already works. Tell me what you changed, and how to test it while signed in and signed out.

It worked when: The page opens when you’re signed in, and sends you to sign in when you’re not.

If something goes wrong:
- The page opens even when you’re signed out. Say: “I’m signed out and the protected page still opens. Please find out why and fix it.”

### Step 7 of 9: Test sign-up, sign-out and Google

This step is mine to do. Walk me through it, one action at a time:
- Sign up with your own email. Type the six-digit code Clerk sends you.
- For an extra test account, use an address with +clerk_test, such as jane+clerk_test@example.com, and the code 424242. Clerk sends no real email to it.
- Sign out. Then open your page for signed-in people. It should send you to sign in.
- Sign in again with your email. That page should open.
- Sign out again, then sign in with Google.
- Open Users in Clerk’s dashboard. Check that your test accounts are listed.

It worked when: Email sign-up, sign-out, sign-in and Google sign-in all work, and your test accounts appear in Clerk.

If something goes wrong:
- The code email doesn’t arrive. Check your spam folder. Development sends up to 100 emails a month, so use a +clerk_test address to keep testing.
- It says you’ve reached a user limit. Development instances allow up to 100 users. Delete old test users on the Users page.

### Step 8 of 9: Make your own Google keys for launch

This step is mine to do. Walk me through it, one action at a time:
- Use the instance selector at the top of Clerk’s dashboard to set up the production instance. It needs a domain you own. Follow its domain and security checks.
- In the production instance, open SSO connections and select Google. Turn on Enable for sign-up and sign-in and Use custom credentials.
- Copy the Authorized Redirect URI that Clerk shows. Keep Clerk’s Google settings open.
- In Google Cloud, open the Cloud project for your product. In its OAuth client settings, start creating a client.
- Choose Web application. Under Authorized JavaScript origins, add your domain, like https://yourname.com.
- Under Authorized redirect URIs, paste Clerk’s Authorized Redirect URI exactly. Click Create.
- Copy the client ID and secret when Google shows them. Enter them in Clerk’s Google settings and save.
- In Google’s authentication setup, find the app’s publishing status and publish it for real sign-ins. Google may review its name, logo or requested permissions.
- For a website, put the pk_live_ and sk_live_ keys in your host’s settings, then put your site online again.
- For Expo, replace EXPO_PUBLIC_CLERK_PUBLISHABLE_KEY with the pk_live_ value in your build settings and make a new build. Keep sk_live_ only on a separate server, if you have one.
- For a native Google button in a phone app, also create a client for each phone platform you support. Add the phone app on Clerk’s Native applications page too.

It worked when: Google sign-in works on your live site or release build, with your own Google keys.

Before we move on, check with me:
- Does Google’s sign-in screen show your own domain?

If something goes wrong:
- Google shows a redirect_uri_mismatch error. The redirect URI in Google must match the one Clerk gave you exactly. Copy it again, with no extra spaces or slashes.
- Some people can’t sign in with Google. Google’s Testing status limits access to listed test accounts unless the app only asks for name, email and profile. Other test authorizations expire after seven days. In Google’s authentication setup, check the audience and publishing status before you put your product online.

### Step 9 of 9: Connect Clerk to Supabase

This step is mine to do. Walk me through it, one action at a time:
- In the Clerk dashboard, open the Supabase integration setup at dashboard.clerk.com/setup/supabase.
- Choose your options, then select Activate Supabase integration. Copy the Clerk domain it shows.
- In Supabase, open Authentication, then Sign In / Providers. Select Add provider, choose Clerk, and paste the Clerk domain. Save.
- Tell your AI tool: “I use Clerk for sign-in and Supabase for data, connected with Supabase’s Clerk provider. Follow Clerk’s current Supabase guide. Send Clerk’s session token to Supabase, and write access rules that match each row’s user_id to auth.jwt()->>'sub'.”

It worked when: Supabase’s Sign In / Providers page lists Clerk.

If something goes wrong:
- Your AI tool wants to make a Clerk JWT template for Supabase. Supabase calls that older way deprecated. Say: “Use the Clerk provider in Supabase instead.”
- Saving data fails with a permission error. Say: “Saving fails with Clerk and Supabase. Check that the Supabase client sends Clerk’s session token, and that my access rules use auth.jwt()->>'sub'.”

Compare Clerk with the other options: https://buildladder.com/concepts/sign-in.md
