P
P
Python Newbie2022-03-08 12:32:06
JavaScript
Python Newbie, 2022-03-08 12:32:06

How to transfer the API key on the site so that it would not be seen?

I have an api token. secret token. I need to connect api on the site with this code:

<script src="https://api-maps.yandex.ru/2.1/?apikey=token&lang=ru_RU" type="text/javascript">
</script>

How can I pass the token so that it is not visible when viewing the page?

I also need to use js to make a fetch request to the api, again passing the oauth token from my own account, while I don’t want anyone to see this token. How to do it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Radiks Alijevs, 2022-03-08
@dedalik

If requests are made from the frontend, then no way. It can simply be hidden from the eyes of a non-professional. But in fact, a more or less knowledgeable person will find it.
If from a backend it is possible.
Your account will be tied to a domain, so you don't have to worry about the key.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question