0

API KEY

If we use API key directly in our js script, then anyone can access or misuse the api key. Is there any way to avoid such situations?

27th Jun 2025, 12:35 PM
You
You - avatar
2 Respuestas
+ 1
The easiest way is to use the online JavaScript Obfurcator Tool to encrypt your file. That way your key will be impossible or at least way harder to get.
27th Jun 2025, 12:55 PM
🍇 Alex Tușinean 💜
🍇 Alex Tușinean 💜 - avatar
+ 1
Well you could use back-end server, either your own or other popular services. I think you could also use a worker, like Cloudflare worker so it acts as a secure layer between your website/webpage and the API key. They have a free plan(which allows 100,000 requests per month).
27th Jun 2025, 3:38 PM
Afnan Irtesum Chowdhury
Afnan Irtesum Chowdhury - avatar