skip to Main Content

I am using a react app for frontend and salesforce for backend. I want to hide an API key from the users.

I got some solution like .env variables but if I commit the changes then how code will work as the key is in my machine only. I want a method to hide in such a way that user do not have to do something extra just download the package. Is there any method in salesforce or react hide an API key?

2

Answers


  1. In Salesforce, use Named Credentials to securely store API keys and other sensitive information. Named Credentials in Salesforce provide a secure and centralized way to store authentication information.

    Login or Signup to reply.
  2. You can simply put the env file on server or deployment environment and put the file in gitignore and use it locally
    on prod server it will pick from deployment environment

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search