DEV Community

Discussion on: Protecting your API keys with Next JS

Collapse
 
bishnu47 profile image
Bishnu Das

hey I just wanted to ask is NEXT_PUBLIC prefixed secret when used in frontend.. is the secret vulnerable to the Web?

Collapse
 
ivanms1 profile image
Ivan

Yes, it is.

Collapse
 
bishnu47 profile image
Bishnu Das

Then what is the best way to hide the api-key, if I require to use some api at front-end?

Thread Thread
 
ivanms1 profile image
Ivan

Using the api folder, you can read the post for more information.