Answer the question
In order to leave comments, you need to log in
How to hide API in JS from users?
Good afternoon. Now I'm learning React and ran into the problem of implementing API requests that should not fall on the side of users. Usually this is done through the backend. I know that it cannot be implemented through JS, as users will have access to the API token. Tell me, is it possible to access the API with a token through React without providing data to the user and pass the result to the frontend? Need to learn NodeJS? In general, in a nutshell. I need to work with API tokens that should not fall into the hands of the user, but it will take a lot of time to learn the backend, PHP, NodeJS, etc. to implement. Therefore, I want to know if there is a not so long learning path to implement the transfer of an API token and display only the necessary (not anonymous) information in the frontend
Answer the question
In order to leave comments, you need to log in
You can raise a free Worker on CloudFlare if you use it for a domain. The worker code is not visible to users. See answer for details .
Here only SSR will help or some kind of proxy api. That is, the server part will be needed in any case.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question