JavaScript API

With the JavaScript Client API you can make temporary modifications to the MarkerKit widget on your website, listen for events and trigger actions. You can add or remove objects and artboards, manually open a tooltip, modify properties, get notified when a user clicks an object and more.

Getting Started

The first step of interacting with the API is obtaining a markerkit object. Whenever a widget loads, a global callback function onMarkerKitLoad is executed and the markerkit object is passed as an argument:

Modifying Objects

One of the functionalities of the JavaScript API is to modify artboards, objects and popups. In this simple example we will get an object by its ID and change its color. First we wait for the onMarkerKitLoad callback (as we did above) to obtain the markerkit object, and then we can call the updateObject method:

For a complete list of all endpoints, please refer to the JavaScript API Methods page.

Listening for Events

Another powerful feature of the JavaScript API is the ability to listen for events, as your users interact with the widget. Let's imagine that we want to change an external DIV element's content, whenever the user hovers over a specified object:

When you subscribe to listen for events, the subscribe method returns a function that you can call if you wish to unsubscribe:

For a complete list of all endpoints, please refer to the JavaScript API Events page.