Preview & Production – Taking Auth Live

You built and tested auth on your branch's preview. Now you'll ship it: get a real domain, switch Clerk to its production keys, merge to main, and verify everything works for real users.

Where you are

You're on your auth branch, auth works on the Vercel preview, and your data is isolated per user. This lesson is the production cutover.

1. How the environments fit together

  • Preview – the live URL Vercel built for your branch. You tested auth here.
  • Production – your real site on your custom domain, updated when you merge to main.

A couple of things differ between them:

  • Database (Neon): one database across environments – that's fine, because your server scopes every query to the logged-in user.
  • Auth (Clerk): Clerk has a development instance (test keys, allows *.vercel.app and localhost – what you've used so far) and a production instance (live keys, requires a real custom domain). That's why you need a domain before going live.

Outcome: You understand the preview → production flow and why Clerk needs a custom domain.

I understand the preview → production flow

2. Get a custom domain

Clerk production needs a real domain (not *.vercel.app). Buying it through Vercel is simplest – DNS and SSL are handled for you.

  • Go to vercel.com/domains, find an available domain, and purchase it.
  • In your Vercel project: Settings → Domains → Add, enter your domain, set it as Production.
  • Wait a couple of minutes and confirm https://yourdomain.com loads with SSL.

(Already own a domain elsewhere? You can add it and point its DNS to Vercel instead.)

Outcome: You have a custom domain linked to your project.

I linked a custom domain to my project

3. Switch Clerk to production

Now set up Clerk's production instance for your domain, and let Claude store the live keys in the Vercel vault.

Set up Clerk production
Help me move Clerk to production for my custom domain:
1.Walk me through creating/activating Clerk's Production instance and adding my custom domain (and its redirect URLs) to it.
2.Store the production Clerk keys in the Vercel vault for the **Production** environment only (keep the existing test keys for Preview/Development).
3.Confirm my Neon DATABASE_URL is set for all environments.
Explain anything I need to click in the Clerk dashboard.
Keep test and live users separate

Production uses Clerk's live keys (pk_live_…); preview/dev keep the test keys (pk_test_…). That keeps real users separate from your test accounts – and it's why the keys are set per environment in Vercel.

Outcome: Clerk production is configured for your domain, with live keys in Vercel.

I configured Clerk for production

4. Merge to main and deploy

Auth is tested on the preview and production is configured – time to merge your branch to main, which deploys to your live domain.

Merge auth to main and deploy
My auth branch is tested on the preview and Clerk production is ready. Please:
1.Do a final check that no secrets are committed and the build is clean.
2.Merge my auth branch into main (and clean up the branch).
3.Confirm Vercel deploys to my custom domain and reaches Ready.

Outcome: Your auth is merged to main and deployed to your live domain.

I merged auth to main and deployed to production

5. Verify it works in production

Run the real flow on your live domain.

Verify auth in production
Walk me through verifying auth on my live domain:
- sign up a real account → onboarding → app,
- log out and back in,
- create data, then confirm a second account can't see it,
- check sign-in/out works smoothly on mobile too.
If anything's off, help me fix it. Otherwise – we're live!

Outcome: Authentication works for real users on your production domain.

I verified auth works live in production