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/v2/\<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 true false 296false unhandled content type false unhandled content type false unhandled content type false unhandled content type 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\ fmag0np7ldler92db4x i when creating widgets intelli js loaded const loaded = intelliprovewidgets loaded(); mount a widget intelli mountwidget(selector, name, config, variation="", themeoverrides={}, version=null) 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 optionally specify the widget version to mount (e g , 1 or 2 ) if not set, the default widget version is used mount a widget intelli mountwidget( "#biomarker tile", "biomarker", { face scan id "3db0ca36ba714354bfc2c2c215aba2a9", biomarker "respiratory rate" }, "default" ); true false 296false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type exceptions intelliactiontokenerror , intelliwidgetnotfounderror , intelliinvalidparametererror , intelliunexpectederror , intellisdkloadingerror set default widget version intelli setdefaultwidgetversion(version) sets the default widget version (i e 1 or 2 ) to be used across all widgets the current default widget version is 2 to ensure consistent behavior, we recommend explicitly setting the desired widget version using this method or pass the version directly in mountwidget intelli setdefaultwidgetversion(1); 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'); true false 296false unhandled content type false unhandled content type false unhandled content type false unhandled content type 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 true false 289false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type