Keys / Stripe

STRIPE_SECRET_KEY

The secret API key your server calls the Stripe API with. Stripe recommends a restricted key (rk_) with only the permissions you need.

Starts with
sk_
Expires
never, until you expire or rotate it
API
none; Dashboard only

Get it

Create one on dashboard.stripe.com/apikeys. The steps aren't recorded yet.

Set it

STRIPE_SECRET_KEY=sk_...

No official Stripe SDK reads it; your app passes the key in, as Stripe's Node.js examples do with STRIPE_SECRET_KEY. Or keep it out of .env with keypin: keypin run -- npm run dev

Replace it

  1. On the API keys page, open the key's menu and click Rotate key. Choose when the old key expires, up to 7 days later. Both keys work until then.
  2. Deploy the new key everywhere that reads STRIPE_SECRET_KEY.
  3. Check the old key's request logs. Expire it once they show no requests.

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