0

I want to use the EmailJS service to send info from a contact form. However, I have several issues

  1. In the head section should add the following script

     <script type="text/javascript">
         (function() {
             emailjs.init('my-token');
         })();
     </script>
    

How can I hide that token? I have tried storing it in the .env file and accessing it with

emailjs.init(`${process.env.REACT_APP_INIT_KEY}`);

But that didn't work.

Ben
  • 81
  • 1
  • 1
  • 9
  • the only way to store API key is in backend language like nodejs ,php, etc. – Robin Hood May 27 '22 at 09:34
  • 1
    relevant answer for this https://stackoverflow.com/questions/48699820/how-do-i-hide-api-key-in-create-react-app#answer-57103663 – Robin Hood May 27 '22 at 09:35
  • Hi @RobinHood thanks for sharing the relevant answer, which makes sense. I will look into that. – Ben May 27 '22 at 09:39

0 Answers0