Technology

How to store API keys safely in a web or mobile app

How to store API keys safely in a web or mobile app
Image: AppInstitute

Posted 6 Dec 2026By Ian NaylorDevelopmentAn API key is a long string that tells a service “this request comes from my account”. Some keys only identify you. Others can spend your money, read every customer’s data or delete things.

The trouble starts when the second kind ends up where the public can reach it. That happens a lot with apps built in an afternoon with AI tools.

This piece is part of our app security guide, which covers the wider picture. Here I’m going deep on one question: where each kind of key should live, and how to check yours today. Every rule below comes from the provider’s own documentation or from OWASP, checked on 6 December 2026.

Only if the provider says that particular key is safe to publish. Everything else in your app’s code should be treated as readable by anyone.A web app sends its JavaScript to every visitor. Lovable’s security guide puts it plainly: anyone can read the code that runs in a visitor’s browser.

Phone apps feel more sealed, but they can be unpacked too. The React Native docs say anything in your code can be read in plain text by anyone inspecting the app bundle.

Google’s Android security guidance says an attacker with reverse engineering tools can retrieve a hard-coded secret “very easily”. And Stripe warns that people unpack applications specifically to search for embedded keys.

The OWASP Mobile Top 10, the standard list of mobile app risks, puts improper credential usage at number 1 and says to avoid hardcoded credentials in code or config files.

So the useful question for each key is simple. Is this one meant to be public?

Each provider labels its own keys, and the labels are usually clear once you know where to look. Here are the keys I see most often in apps that come to us for help, with what each provider’s docs say today.

api keyssecuritymobile appweb app

This summary is from AppInstitute, published Dec 6, 2026. NewsFusion links to the original reporting and groups related coverage.

All Mobile app icon

Find more in the app

Keep reading in All Mobile

Get every All Mobile story as it breaks, follow the topics you care about, and get alerts the moment something big happens. Free on iPhone and Android.

  • Breaking-news alerts
  • Follow topics & teams
  • Related coverage grouped by AI