SmartHub Application Loader for Modern Pages in SharePoint Online

 

About

This app is used as a generic way to inject JavaScript files into SharePoint Online modern pages.

It is used to integrate various components (such as the SmartHub Search Box) from SmartHub into SharePoint pages.

How to Deploy the App Package

  1. Navigate to your SharePoint Online Admin Center.

    1. For example: https://contoso-admin.sharepoint.com

  2. Open the App Catalog.

    1. Click "upload a new app."

    2. Navigate to the "shApplicationLoaderForModernSPO" directory from your local SmartHub installation:
      <SmartHub_Root>/integrations/shApplicationLoaderForModernSPO

    3. Select the file SmartHub Application Loader for Modern SPO.sppkg to upload.

    4. Before clicking "Enable app" make sure you enable the "Enable this app and add it to all sites" check box.

    5. Click Enable app

How to Configure the Application Loader

  1. Navigate to the file SHApplicationLoaderForModernSPO.exe.config at <SmartHub_root>/integrations/shApplicationLoaderForModernSPO/install.

  2. Open the file SHApplicationLoaderForModernSPO.exe.config for editing.

  3. Configure the settings based on the details provided in the table below:

Setting Name Description Example/default value
BaseSharepointAddress
  • This is used for SharePoint Online (SPO) scopes and site enumeration.

Example: https://contoso.sharepoint.com
FilesToLoad
  • Full path of the JavaScript files to load.

  • Example for SearchBox for Modern SharePoint Online (SPO):

    • "https://smarthub.contoso.com/integrations/searchBoxForModernSPO/SHSearchBoxModernLoader.js"

  • Example for multiple files to load:

    • "https://smarthub.contoso.com/site1Address/file1.js,https://smarthub.contoso.com/site2Address/file2.js"

ExcludeAlreadyInstalled
  • true or false.

  • Controls whether the application should be reinstalled on sites where it's already installed; useful when you change the configuration and want to apply the change everywhere.

true
SitesToInstallOn
  • If you don't want the integration to be applied to all the currently available sites (automatically enumerated at install time), specify all the site URLs where it should be installed.

Example: "https://contoso.sharepoint.com/site1Address,https://contoso.sharepoint.com/site2Address"
SmartHubAddress
  • The address of your SmartHub site.

Note: Do not use the trailing character '/'
Example: https://smarthub.contoso.com
CustomSettings
  • You can add any custom settings or parameters that you want to be available to the app.

  • They are available via the SH.SPOModernApplicationLoader.Properties.CustomSettings object loaded on the page.

Example of SearchBox for Modern SPO:

Copy
 {
        "SearchBoxCustomSettingsFilePath" : "https://smarthub.contoso.com/customer/SHSearchBoxModernIntegration/SHSearchBoxModernCustomSettingsTemplate.js'"
 } 

Mode
  • Controls the process - install or uninstall.

  • This enables you to remove the integration.

install
SpfxClientSideComponentId Controls the package that is installed (PROD/DEV/UAT)
  • Default value (PROD): f1841cbb-d250-40d0-ba30-5745589fc4ac

  • DEV: a89bb52b-a9b6-4956-bed6-3ea77627a792

  • UAT: 835f98f8-4013-4d83-8254-985c14edb143

How to Install

To inject the JavaScript files in SharePoint Online modern pages, run the file SHApplicationLoaderForModernSPO.exe in the same folder as the configuration above.