A
A
Alexander2021-10-06 15:24:44
JavaScript
Alexander, 2021-10-06 15:24:44

How to make a variable in .ENV not visible when requested?

Hello! I am learning react and when creating a simple todo (more precisely, having already completed the process), I ran into an unpleasant situation - my API KEY, which I so diligently hid ...

615d945429048222439563.png

it turns out to be visible in the Network tab:

615d94c530b71921086335.png

I tried to google, but somehow it doesn’t work out. I find only the process itself, how to use environment variables, which I already did ... Tell me what to do, thanks in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Ukolov, 2021-10-06
@Gykan4ik

The only way is not to give this key to the client. Make a method on the server that the client will access, and the server will make a request where necessary, passing the key.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question