Is a Stripe publishable key safe to expose?
A key is a long password your app uses to prove who it is to another service, here Stripe, which takes payments. Stripe's documentation says a publishable key can identify your account and create tokens or payment methods, but cannot perform sensitive operations such as creating charges or reading account data. (A token is a one-time code.)
Secret keys have unrestricted permissions and must stay on your back end, the part of your app that runs on the service's computers, where visitors cannot look. Stripe recommends restricted keys (rk_) for server code. Do not put keys in source code checked into version control, the saved history of your code.
Quick check: open your live page, view its source, and search for sk_. A pk_ key showing up is normal. An sk_ or rk_ key showing up means you should replace it today (make a new one and turn the old one off) and move that call to the back end.
Sources
- Stripe documentation, API keys, accessed 2026-11-16
See what your live app shows strangers
Paste the link to your app: in under a minute the free scan shows what your live app hands to any visitor, and where to look first. No sign-up, and it never signs in or changes anything.
Want the code itself read? Order the $49 audit or see a sample report. Your card is held and charged only when your report is delivered. It is not a pentest: the audit is done by AI, and a second AI checks each serious finding.