I load kongregate_api script in the head of the html document like this
<script src='https://cdn1.kongregate.com/javascripts/kongregate_api.js'></script>
Then loading my main.js script that contains these lines
console.log(window.kongregateAPI)
window.kongregateAPI.loadAPI(function () {});
The error message;
SyntaxError: An invalid or illegal string was specified in kongregate_api.js:36
console.log returns and object so i think it loads the script successfully.
Loading the API
In order to load the Kongregate API object, you need to include a script tag which loads our JavaScript source file. The script tag should be placed inside the head section of your document.
HTML
Initializing the API
The JavaScript API automatically creates a global variable named kongregateAPI. You can use this object to initialize the Kongregate API services with the loadAPI and the getAPI functions:
Example: Load the API, and set up a global reference to the API object named kongregate function once initialized.
JAVASCRIPT
Note The API should only be loaded/initialized once per Kongregate game page load. If your application spans multiple pages/documents, please see the documentation on the Kongregate Shell for information on setting up and accessing a persistent API connection