Skip to main content
AllDevToolsHub
Back to all patterns

Stripe Publishable API Key

Web & Network

Matches a Stripe publishable key (safe to expose in client-side code).

/^pk_(test|live)_[A-Za-z0-9]{24,99}$/

How it works

Publishable keys are designed for use in browser JavaScript; they can only create tokens, not charge them. Still, detecting them helps confirm the right key is in the right environment.

Test Cases

Should Match

  • pk_test_TYooMQauvdEDq54NiTphI7jx
  • pk_live_51Hkjk4LgIcRBVwYr3vBlAcZl

Should NOT Match

  • sk_test_TYooMQauvdEDq54NiTphI7jx

Quick Summary

Matches Stripe publishable keys (pk_test_..., pk_live_...).