IntelliWidgets V2
IntelliWidgets.js SDK
introduction this reference documents the available methods in intelliprove's browser side javascript sdk, intelliwidgets js this guide applies to intelliwidgets version 2 note while we are slowly transitioning to docid\ emrqo mhuu6sjbgvbhdmk , which use web components, the v2 widgets are still supported and docid\ sxvsw2jfsohr7xbxeyz j are not available in the web component variant yet 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 docid\ biupvixvhltbukklr2ati 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 docid\ biupvixvhltbukklr2ati initialise intelli js const intelli = intelliprovewidgets("\<user action token>"); authentication docid\ biupvixvhltbukklr2ati true 296,100 unhandled content type unhandled content type unhandled content type 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 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 docid\ oorapckooi6 89xrafduv for a full list of the available widgets adjust the docid 2kl5bnrb 6uicqrfaqsig 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", parameter "respiratory rate" }, "default" ); true 296,100 unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type 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 296,100 unhandled content type unhandled content type unhandled content type 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 289,100,100 unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type custom use cases forking the sdk our sdk is designed to be widely compatible across browsers, devices, and frameworks we also recognize that some use cases require additional flexibility that’s why the sdk is available as a public git repository on https //github com/intelliprove/intelli widgets sdk you can fork the repository if your application needs a change or feature we don’t currently support pull requests are welcome if you believe your addition would benefit other users however, we only merge changes that maintain compatibility with major platforms and frameworks if your changes don’t meet this requirement, you’ll need to build, host, or bundle your own version of the sdk in such cases, intelliprove cannot provide support for your custom code https //github com/intelliprove/intelli widgets sdk