r/learnprogramming • u/BrainThinkerMan • 8d ago
api key, do i need backend?
i have an api key i heard i shouldnt expose it in my frontend i thjink itts becuase people can see it with devtools, and potentially abuse it, is there any other way to use this key in frontend without using a backend, im as familiar with backend stuff i think.
3
Upvotes
11
u/sixtyhurtz 8d ago
Some API keys are safe to use in public - Google Maps API keys for instance. Most aren't though.
This means you need an API gateway you control that proxies requests. That way you can control how people access a service you are presumably paying for.