Search code examples
apiiframe

Can I use an API key with iframe?


Haven't found any content on this, but is it possible to generate an API key and provide it to the partner that would like to incorporate my webapp into theirs? I would like to only allow iframe embedings for authorized partners and not anyone on the internet.

Maybe something like

<iframe src="https://www.wikipedia.org/" API_KEY=12345678></iframe>

Thank you


Solution

  • you could have the partner use the following code to embed your webapp in their page:

    <iframe src="https://yourwebapp.com/?api_key=12345678"></iframe>
    

    or

    <iframe src="https://yourwebapp.com/" headers="API_KEY: 12345678"></iframe>