How do you add headers in a tag? Any HELP please?

1 points by alegeaa ↗ HN
Hello hackers,

I am stuck on this and I have tried all possible channels available to me. I thought maybe I can find some help here.

So, there is an API endpoint requires a token (API key). However, the full link of the API is meant to be added in the third party app and be opened in the client`s browser while also passing the header information.

For example, the API link is x.com/do_this

the client (of the API) adds the link in their application. When the client`s user clicks the link, it should open x.com/do_this but the client`s API key is needed to show some information when that link is opened.

How do I go about this? I dont mind using AJAX, JS, or any other tech out there that can provide this solution. Thanks

1 comment

[ 2.7 ms ] story [ 15.1 ms ] thread
You can’t do that. If you could, it would expose the API key to anyone who used it. The API key is like a password; it needs to be kept secret from all parties except the one it was given to.

This is entirely the wrong place to ask these type of questions though. You’ll have better luck stackoverflow.com, as long as you ask good questions.