Widgets

IntelliWidgets.js

IntelliWidgets.js reference

This reference documents the available methods in IntelliProve's browser-side JavaScript library, IntelliWidgets.js.



NOT AUTHENTICATED?

Learn how to create user-authenticated action tokens with the API.



Including IntelliWidgets.js

Include the IntelliWidgets.js script on the page of your site where you want to use the widgets. It should always be loaded directly from https://cdn.intelliprove.com, rather than included in a bundle or hosted yourself.



Including Intelli.js



Errors





IntelliProveWidgets(action_token, locale)

Use IntelliProveWidgets(action_token, locale) to create an instance of the IntelliProveWidgets object. The IntelliProveWidgets object is the entrypoint to the rest of the IntelliWidgets.js SDK.

A valid user-authenticated action token is required when calling this constructor, as it identifies the user to IntelliProve.

Replace the sample action token in the example with a valid user-authenticated action token, created with your API key.

Initialise Intelli.js


NOT AUTHENTICATED?

Learn how to create user-authenticated action tokens with the API.

Property

Description

action_token string

Valid user-authenticated JWT action token

locale nullable string enum

Two-letter language code for preferred user language Values: "en" (default), "fr", "nl"



IntelliProveWidgets.loaded()

Use IntelliProveWidgets.loaded() to verify that IntelliWidgets.js loaded successfully.

If the loading of IntelliWidgets.js failed, this will result in an error when creating widgets.

Intelli.js loaded






intelli.mountWidget(selector, name, config, variation="", themeOverrides={})

The intelli.mountWidget method creates a new widget and attaches it to the DOM.

First you need to create a container DOM element on your platforms website. intelli.mountWidget accepts a CSS sellector (e.g., #biomarker-tile).

Check out the widget overview for a full list of the available widgets.

Adjust the appearance of the widget by overriding the theming variables.

Mount a widget


Property

Description

selector string

The CSS selector where your widget will be mountedl

name string

The name from one of the available widget types.

config object

Configurations for creating the widget.

variation optional string

Widget variation, if applicable.

themeOverrides optional object

Custom styling variables applied to the widget. Refer to Widget Appearance for more information.



intelli.changeLanguage(locale)

The intelli.changeLanguage(locale) method allows you change the locale for all active widgets.

Newly created widgets will have the new locale by default.

JS


Property

Description

locale string enum

Two-letter language code for preferred user language Values: "en", "nl", "fr"