Nonstop Javascript SDK

Initialization

Initialize the Nonstop SDK on any pages of the website where you want to use it.

Initialization

The initialize method takes an object with several configuration properties:

  • environment - The SDK needs to know which Nonstop API Environment to use - this should be passed as the first parameter
  • platform - The SDK needs to know which platform it is being run on - both for reporting to Nonstop and also for reporting to Amplitude. Valid values are web, tizen and chromecast.
  • cdnUrl - The path to the directory where the Nonstop SDK JS files are hosted (see Installation)

Example

    ready(function() {
        Nonstop.default.initialize({
            environment: 'prod',
            platform: 'web',
            cdnUrl: 'https://nonstop.azureedge.net/js-sdk/1.5.0/dist/'
        });
    });

    function ready(fn) {
        if (document.attachEvent ? document.readyState === "complete" : document.readyState !== "loading") {
            fn();
        } else {
            document.addEventListener('DOMContentLoaded', fn);
        }
    }

Environments

The Environments parameter controls which APIs the SDK will hit, and thus which Nonstop Admin and ShowMS Environment is tied to them. Developers should be conscious of this and match their Nonstop Environment to their ShowMS environment for the given build.

Reward Animations

Note: The Nonstop SDK will asynchronously preload reward animations on initialize for improved performance when they are required so you will see this network call on calling the initialize method. These are loaded once per tab instance and stored in Session Storage.

In this document