init - Methods - Reports API

Reports API Methods

init()

Initializes and creates a new instance of Reports API to load and interact with the various report types.

You must use this method in order to initialize Reports API and access its methods and events.

This method returns an instance of the Reports API application object. You can use the returned application instance, referred to as reportsApp throughout the documentation, to access all Reports API methods.

Examples

<!-- On the page, add <div> containers with a unique ID where the reports will be rendered -->
<div class="learnosity-report" id="report-1"></div>
<div class="learnosity-report" id="report-2"></div>

<script>
    var initializationOptions = { ... };
    var callbacks = { ... };

    // When init() is called, the reports will be rendered
    // into the 'report-1' and 'report-2' containers on the page
    var reportsApp = window.LearnosityReports.init(
        initializationOptions,
        callbacks
    );
</script>

Arguments

Return value

Type reportsApp

Was this article helpful?

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