Widgets

IntelliWidgets.js SDK

introduction this reference documents the available methods in intelliprove's browser side javascript sdk, intelliwidgets js including intelliwidgets js using our cdn recommended 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 this ensures you and your customers get the latest updates and improvements live without needing an intervention from your end including intelli js using a package install if preferred or required, we also provide support for the installation of our sdk as a package this can be installed using the npm command into your front end project please note that this approach requires you to manually update the version of our sdk every now and then to make sure you have the latest improvements including intelli js npm install "https //cdn intelliprove com/packages/intelli widgets/v1/\<version> tgz" create an sdk instance intelliprovewidgets(action token) use intelliprovewidgets(action token) to create an instance of the intelliprovewidgets object the intelliprovewidgets object is the entrypoint to the rest of the intelliwidgets js sdk a valid rest api is required when calling this constructor, as it identifies the user to intelliprove replace the placeholder action token in the example with a valid user action token, created with your rest api initialise intelli js const intelli = intelliprovewidgets("\<user action token>"); authentication rest api docid\ biupvixvhltbukklr2ati property description action token string valid user authenticated jwt action token verify status intelliprovewidgets loaded() use intelliprovewidgets loaded() to verify that intelliwidgets js loaded successfully if the loading of intelliwidgets js failed, this will result in an intelliwidgets js sdk docid\ dekcuoaphrmczxe caj5v when creating widgets intelli js loaded const loaded = intelliprovewidgets loaded(); mount a widget 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 selector (e g , #biomarker tile ) check out the widgets for a full list of the available widgets adjust the widget appearance of the widget by overriding the theming variables mount a widget intelli mountwidget( "#biomarker tile", "biomarker", { face scan id "3db0ca36ba714354bfc2c2c215aba2a9", biomarker "respiratory rate" }, "default" ); property description selector string the css selector where your widget will be mounted name string the name from one of the widgets 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 docid 2kl5bnrb 6uicqrfaqsig for more information exceptions intelliactiontokenerror , intelliwidgetnotfounderror , intelliinvalidparametererror , intelliunexpectederror , intellisdkloadingerror change locale 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 intelli changelanguage('en'); property description locale string enum two letter language code for preferred user language values "en", "nl", "fr" errors the intelliwidgets js sdk may raise exceptions for a few reasons, such as authentication errors, invalid parameters or loading errors we recommend writing code that gracefully handles all possible api exceptions check the error message for more information below you find an overview of the various errors that are defined error description fix intelliactiontokenerror the provided action token is invalid request a new action token intelliwidgetnotfounderror the widget or variation of the widget is not found verify the method input values check the error message for more information intelliinvalidparametererror the parameter or value that was provided is invalid verify the method input values check the error message for more information intelliunexpectederror an unexpected error occurred check the error message for more information if the problem persists, please contact the support team intellisdkloadingerror the sdk failed to load properly reload the page if the problem persists, please contact the support team