This is an example of javascript that can be used to run SCORM 2004 courses from popular off-the-shelf authoring tools (Storyline, Articulate, Lectora, etc.). The code was extracted from another project and has not been tested independently. Advanced SCORM features (Sequencing/Navigation) are not supported.
Take a look at the sample.html to see how courses can be launched, and how the callbacks work. This example uses an IFRAME so you will need to run it through a server or upload to a public S3 bucket.