79273276

Date: 2024-12-11 21:54:46
Score: 1
Natty:
Report link

No. In order to call the third-party api while keeping the API Key secret a server side request should be made instead (i.e: A request on the backend) and the response of that request should then be sent to your frontend/web client.

Any request sent on the frontend would be logged in the network console on the browser devtools where you can get details about the request including any authorization headers. enter image description here

To keep your secret key SECRET, It is better you set up your API Request on your backend server, such that the request is securely handled on the backend and the response of that request is sent over to the frontend through the existing secure API integration between your frontend and your backend.

Extra tips include:

  1. Storing your SECRET Key in an environment variable on the Backend
  2. Using an API gateway or service to manage and authenticate API requests
Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Harrylever