I am working on react project where I need to use the LinkedIn apis. I basically want to do the same as done here: https://www.c-sharpcorner.com/blogs/fetch-linkedin-data-using-javascript
However, in my project, I only work with components, I don't have control over the host page, so I can't use tags to reference the linkedin apis. What I did was this:
var script = document.createElement('script');
script.setAttribute('src','https://platform.linkedin.com/in.js');
document.head.appendChild(script);
Which actually renders the JS file for the api, however, how can I do the step mentioned in the article like this:
<script type="text/javascript" src="https://platform.linkedin.com/in.js">
api_key: XXXXXXX //Client ID
onLoad: OnLinkedInFrameworkLoad //Method that will be called on page load
authorize: true
</script>
I am not sure how to translate this to React without having to change the actual host page. Can we do this on the components level?