1

We are building a web application using React and Spring boot.

We are using google maps for some functionality. To use google maps we require an API key provided by google. We are trying to encrypt this key so anyone cannot misuse it.

Do we need to encrypt and store it in the database and get it via API. In this case is it good to decrypt the key in front-end?

Or dose we need to store it in the front-end only?

What is the recommended way for this?

Kirill Novikov
  • 2,576
  • 4
  • 20
  • 33

1 Answers1

0

Use .env file to store sensitive credentials such as API keys on ReactJs, and you can use it inside your project.

for more information on how to create .env file : https://stackoverflow.com/a/68945430/12287751

Faisal Hani
  • 178
  • 6