Keys / Clerk

CLERK_SECRET_KEY

The Clerk secret key your server calls Clerk's Backend API with. It starts with sk_test_ in development and sk_live_ in production.

Starts with
sk_
Expires
the docs don't say
API
rotate, with the Platform API (private beta)

Get it

Create one on dashboard.clerk.com/~/api-keys. The steps aren't recorded yet.

Set it

CLERK_SECRET_KEY=sk_...

The Next.js and Express SDKs read it from this variable when you don't pass a key. With @clerk/backend, pass it as secretKey. Or keep it out of .env with keypin: keypin run -- npm run dev

Replace it

  1. On the API keys page, under Secret keys, click Add new key. An instance can have several secret keys at once.
  2. Deploy it everywhere that reads CLERK_SECRET_KEY.
  3. Check the Last used time: the new key shows recent use and the old one doesn't. Then delete the old key.

Set rotate_every on the key in keypin.toml and a rotated date on its vault item, and keypin status shows when it's due.

Sources, checked 2026-11-16