eLabSDK2.Marketplace.Addon

Hierarchy

Methods

isAddonLoadedByRootVar

Static isAddonLoadedByRootVar(rootVar): boolean

Check if a specific add-on is loaded by its root variable name.

This checks whether an add-on with the specified root variable (rootVar) is currently installed and loaded in the application. Each add-on registers itself in the custom plugin namespace using a unique root variable name. Use this to detect add-on presence for conditional functionality, feature flagging, or integration with other add-ons.

Parameters

NameTypeDescription
rootVarstringThe unique root variable name of the add-on to check (e.g., 'MY_CUSTOM_ROOTVAR').

Returns

boolean

True if the add-on with the specified rootVar is loaded, false otherwise.

Example

// Check if custom add-on is loaded
if (eLabSDK2.Marketplace.Addon.isAddonLoadedByRootVar('MY_CUSTOM_ROOTVAR')) {
  console.log('Add-on is installed and loaded');
  enableCustomFeatures();
} else {
  console.log('Add-on is not installed');
}

Example

// Conditionally enable integration features
const hasLIMSAddon = eLabSDK2.Marketplace.Addon.isAddonLoadedByRootVar('LIMS_INTEGRATION');
if (hasLIMSAddon) {
  setupLIMSSync();
}

Example

// Feature detection for add-on dependencies
function initializeFeature() {
  const hasRequiredAddon = eLabSDK2.Marketplace.Addon.isAddonLoadedByRootVar('REQUIRED_ADDON');
  if (!hasRequiredAddon) {
    eLabSDK2.UI.Toast.showToast('Required add-on not installed', 3000);
    return;
  }
  // Proceed with feature initialization
}

© 2023 eLabNext