Terms & acceptable use
🔐 Free Clerk key check

Using Clerk for login? Make sure your sk_live_ Secret Key is not sitting in your public JavaScript. Paste your link and check your live app in about 10 seconds. Free.

FreeJust your email to see results10 seconds

The free scan shows your problems. The $9 fix report gives you a copy‑paste fix prompt for each one.

Guide · Clerk keys · Updated

Is My Clerk Secret Key Safe? pk_live vs sk_live Clerk Keys in Lovable, Bolt, v0 and Cursor Apps

Clerk gives you two keys: a Publishable Key for the browser and a Secret Key for your server. The first one is fine to share. The second one in your frontend lets a stranger manage your users. Here is which key is which (from Clerk's own docs), how vibe-coded apps leak the wrong one, two login traps that bite even when your keys are fine, and how to check your live app.

1. Which Clerk keys are safe in the browser

Clerk's docs say: use the Publishable Key in the frontend and the Secret Key in the backend. Here is the short version.

KeyStarts withSafe in the browser?Where it belongs
Publishable Keypk_live_... / pk_test_...YesBrowser. Tells Clerk which app the login is for
Secret Keysk_live_... / sk_test_...NoServer only. Calls Clerk's Backend API (your users)
Webhook signing secretwhsec_...NoServer only. Proves a webhook really came from Clerk
  • Publishable Key (pk_): Clerk says it is safe to expose, and you do not need to rotate it if it is made public. Seeing it in DevTools is normal.
  • Secret Key (sk_): Clerk says it must be kept private. Your server uses it to call Clerk's Backend API, the part that can create, update and delete users.
  • Webhook signing secret (whsec_): Clerk says anyone with it can make "verified" requests to your webhook. Keep it on the server too.

Keys with _test_ belong to your development instance and keys with _live_ to production. A leaked sk_test_ key still opens your test users, so treat it the same way.

Sources: Clerk: Environment variables · Clerk: Rotate your API keys

2. How vibe-coded apps leak the Secret Key

Nobody plans to ship a secret key. It usually happens one of these ways:

  1. You paste both keys into the chat to "make login work", and the AI writes them into a file the browser loads.
  2. The key goes in a public env var like VITE_CLERK_SECRET_KEY or NEXT_PUBLIC_CLERK_SECRET_KEY. Clerk says the Secret Key must never be exposed with a public environment variable, and only the Publishable Key gets the VITE_ or NEXT_PUBLIC_ name. See which env vars end up in the browser.
  3. The AI calls Clerk's Backend API from a React page, for example to list users on an admin screen or change someone's role. That only works with the Secret Key, so the key ends up in the browser.

Login still works, so nothing looks wrong. But the key now ships to every visitor.

Sources: Clerk: Publishable and Secret Keys

3. Where the Secret Key should live (Lovable, Bolt, v0, Cursor)

  • Lovable: put CLERK_SECRET_KEY in the project's Secrets, not in the chat and not in .env. Lovable says secrets are injected into Edge Functions and never reach the browser, while anything starting with VITE_ is built into the browser code. The Publishable Key can go in VITE_CLERK_PUBLISHABLE_KEY.
  • Bolt and other Supabase apps: store the Secret Key as a Supabase Edge Function secret and call Clerk only from that function. Supabase says to keep the .env file with your secrets in .gitignore.
  • v0, Cursor and other Next.js apps: use CLERK_SECRET_KEY (no NEXT_PUBLIC_) and call Clerk only from Route Handlers, Server Actions or middleware. Put the production keys in your host's environment variables, like Vercel's.

Leaks often come from code added later, like a quick admin page, or from an old build. That is why you check the live app, not just the settings page.

Sources: Lovable: Secrets · Supabase: Edge Function secrets · Clerk: Environment variables

4. Two login traps: screen-only login and test keys at launch

Trap 1: the login only protects the screen

Clerk's components can hide a page from people who are not signed in. But hiding a page is not the same as protecting the data behind it. If your API route or edge function returns private data without checking the session, anyone can call it directly. Clerk's authenticateRequest() checks the session token on the server, and Clerk recommends setting authorizedParties to your own domains.

Using Supabase for data? Supabase supports Clerk as a third-party login. Your RLS policies then use the Clerk session token to allow or block rows. Supabase calls the older JWT-template setup deprecated, partly because it meant sharing your Supabase JWT secret with another service. See the Supabase RLS check.

Trap 2: going live on development keys

Clerk says a common launch mistake is forgetting to switch to the production keys. If your live site loads a pk_test_ key, it is still on your development instance. Clerk also says the shared social login credentials used in development are not secure in production. Create a production instance, add its pk_live_ and sk_live_ keys to your host, and redeploy.

VibeCheck does not test your login, your API routes or which Clerk instance you use. Check these two by hand, or use the prompts below.

Sources: Clerk: authenticateRequest() · Clerk: Deploy to production · Supabase: Clerk third-party auth

5. Check your live app in 60 seconds

Only check apps you own or have permission to test.

  1. Fastest: paste your live link at the top of this page. VibeCheck reads your homepage and the JavaScript files it loads and flags any key that starts with sk_live_ or sk_test_. Clerk and Stripe secret keys start the same way, so the report may call it a Stripe key. Either way it is a secret key in public code. It masks any key it finds.
  2. By hand in Chrome: open your live site, right-click → Inspect, then press Ctrl+Shift+F (Cmd+Option+F on Mac) to search all loaded files. Search for sk_live_, sk_test_, CLERK_SECRET and whsec_.
  3. Check your sign-in and admin pages too. Some code only loads after login. Run the same search there.
  4. Search for pk_test_. If your live site has it, you launched on development keys (see trap 2).
  5. Seeing pk_live_ is fine. That is the Publishable Key and it is meant to be public.

6. Found sk_live_ in your app? Do this now

Clerk lets you have more than one Secret Key at a time, so you can swap keys without breaking login:

  1. Add a new key. In the Clerk Dashboard, pick the right app and instance (Production or Development), open API keys, and under Secret keys choose + Add new key.
  2. Put the new key in a server-side secret named CLERK_SECRET_KEY everywhere it is used: your host, your edge function secrets and your local .env. Move any Clerk calls out of the browser (section 3).
  3. Redeploy and test any flow that talks to Clerk from the server.
  4. Delete the old key. Clerk shows when each key was last used. Once the new key shows recent use, delete the leaked one.
  5. Leaked a whsec_ secret? Clerk says to make a new webhook endpoint with the same URL, switch to its signing secret, then delete the old endpoint.
  6. Search your live site again to make sure the key is gone.

More detail for OpenAI, Stripe, Supabase and Google keys: I leaked my API key. What do I do now?

Sources: Clerk: Rotate your Secret Key and webhook signing secret

7. Copy-paste fix prompts

Paste the matching prompt into Lovable, Bolt, v0, Replit or Cursor. After you deploy, rotate any Clerk Secret Key that was ever in client code.

Any builder: move the Clerk secret key out of the frontend
Search this whole project for sk_live_, sk_test_, CLERK_SECRET_KEY, VITE_CLERK_SECRET_KEY, NEXT_PUBLIC_CLERK_SECRET_KEY, CLERK_WEBHOOK_SIGNING_SECRET and whsec_. Remove every Clerk Secret Key and webhook secret from client-side code and from any VITE_, NEXT_PUBLIC_ or EXPO_PUBLIC_ variable. Only the Publishable Key (pk_live_ or pk_test_) may be used in the browser. Move every call to Clerk's Backend API (clerkClient, createClerkClient, user lists, role changes, deleting users) into a server function (Supabase Edge Function, Lovable server function, Next.js Route Handler or Server Action) that reads CLERK_SECRET_KEY from a server-side secret. List every key you removed so I can rotate it in the Clerk Dashboard.
Protect private data on the server, not just the screen
Find every server route, Route Handler, Server Action and edge function that returns or changes private data. In each one, verify the Clerk session token on the server (for example with clerkMiddleware and auth.protect() in Next.js, or authenticateRequest() from @clerk/backend in an edge function) with authorizedParties set to my live domain, and return 401 if the user is not signed in. Use the user ID from the verified token, never a user ID sent from the browser. Show me the list of routes you changed.
Supabase + Clerk: lock tables to the signed-in user
This app uses Clerk for login and Supabase for data. Make sure it uses Supabase Third-Party Auth with Clerk (not the old JWT template that shares the Supabase JWT secret). Turn on RLS for every table and storage bucket that holds user data and add policies that only allow rows where the owner column matches the Clerk user ID from the token (auth.jwt()->>'sub'). Then tell me how to test, while logged out and as a second user, that I cannot read someone else's rows.

8. Check it for me

Paste your link into VibeCheck. In about 10 seconds it checks the JavaScript your live site sends to visitors for leaked keys (secret keys that start with sk_live_ or sk_test_, plus OpenAI, Anthropic, AWS, Supabase service_role and more), checks if your public Supabase key can read open tables, and checks security headers, SEO basics and broken links.

It is a public, read-only check. It never asks for your code, your login or your Clerk account.

Pricing: the problems list is free (just add your email). The $9 fix report gives you a copy-paste fix prompt for every problem found, or get the $29 10-pack (10 fix reports to use any time). No subscription.

No tool can promise your app is 100% secure. VibeCheck catches common, costly mistakes before a stranger does.

9. FAQ

Is it safe to put my Clerk publishable key in my frontend?

Yes. Clerk says the Publishable Key (pk_live_ or pk_test_) is safe to expose on the frontend, and you do not need to rotate it if it ends up public. It only tells Clerk which app the login form belongs to.

What happens if my Clerk secret key is in my frontend code?

Anyone who opens your site can copy it from your JavaScript files. Clerk says the Secret Key (sk_live_ or sk_test_) must be kept private. It is used to call Clerk's Backend API, which can create, update and delete your users. Add a new key in the Clerk Dashboard, put it in a server-side secret, redeploy, then delete the old key.

Is VITE_CLERK_SECRET_KEY or NEXT_PUBLIC_CLERK_SECRET_KEY safe?

No. The VITE_ and NEXT_PUBLIC_ prefixes tell your build to copy the value into the code every visitor downloads. Clerk says not to expose the Secret Key with a public environment variable. Only the Publishable Key should have one of those prefixes. Name the secret CLERK_SECRET_KEY and read it only in server code.

My app has a Clerk login. Is my data safe now?

Not by itself. Hiding a page in React only hides it on the screen. Every server route or edge function that returns private data must check the Clerk session token itself, for example with authenticateRequest(). If you use Supabase with Clerk, your tables still need RLS policies that check the Clerk user ID.

Why does my live app still use a pk_test_ Clerk key?

Because it is still on your Clerk development instance. Clerk says a common mistake at launch is forgetting to switch to the production keys (pk_live_ and sk_live_). Development also uses shared social login credentials that Clerk says are not secure in production. Create a production instance and put its keys in your host's environment variables.

How do I check if my live app leaks a Clerk secret key?

Paste your live link into VibeCheck for a free scan. It reads your homepage and the JavaScript files it loads and flags any key that starts with sk_live_ or sk_test_. Clerk and Stripe secret keys start the same way, so the report may call it a Stripe key; check which dashboard it belongs to. You can also search your loaded files in DevTools for sk_live_ and CLERK_SECRET.

More questions? See the VibeCheck FAQ. Related guides: How to check if your API key is exposed · I leaked my API key. What do I do now? · Is NEXT_PUBLIC_ safe for API keys? · Is my Stripe key safe? · Supabase RLS check · Is my Lovable app safe? · Is my v0 app secure? · Is my Cursor app secure? · Vibe coding security checklist.