Skip to main content

Multi-choice

Launch multi-choice experiences programmatically via the Kompassify Player API.

Waiting for Kompassify API to be ready

It is highly recommended to wait for the Kompassify API Script to be fully loaded before calling any of the API functions.

The event KOMPASSIFY_BOOT_LOADER_IS_READY is dispatched when the Kompassify API is ready to be used.

window.addEventListener('message', function (event) {
if (event.data.TYPE === "KOMPASSIFY_BOOT_LOADER_IS_READY") {
// Do your stuff here
}
});

Launching a multi-choice programmatically

You can launch a multi-choice with a JavaScript snippet by calling:

window.kompassifyMultiChoice.startMultiChoice(multiChoiceUuid);

Parameters

PropertyTypeDescription
multiChoiceUuidStringThe UUID of the multi-choice you want to start. You can find it in the URL of the dashboard after selecting a multi-choice.