init - Methods - Events API

Events API Methods

init()

Initialize and create a new instance of Events API to load and interact with.

You must use this method in order to initialize Events API and access an instance with its methods and events.

The init method is called from the LearnosityEvents factory, and should only be called once per instantiation of the Events API. From there, you can use the returned application instance, referred to as eventsApp throughout the documentation, to access all Events API methods.

Examples

var initializationOptions = {
    // See the Initialization options section for guidance on the initialization object.
};

var callbacks = {
    readyListener: function () {
        console.log('Learnosity Events API is ready');
    },
    errorListener: function (e) {
        console.log('Events API error', e);
    }
};

var eventsApp = LearnosityEvents.init(initializationOptions, callbacks);

Arguments

Return value

Type object

Returns an instance of the Events API. See eventsApp methods for more information.

Was this article helpful?

Did you arrive here by accident? If so, learn more about Learnosity.