JavaScript access

How would I go about calling 3rd party JavaScript functions from C++ when I’ve built a HTML5 project?

For example, I have a JavaScript API script, in which I can call the functions to access the api. Is there a way to still use this script, since everything gets compiled into JavaScript anyway, or should I just rewrite the API in C++?

I couldn’t really find any info on the matter, any help would be much appreciated!