Custom installation page

A custom installation page contains certain UI elements and workflows that are unavailable in a standard installation page. For example, a custom installation page can:

  • Contain elements such as nested fields, toggles, sliders, date and time pickers, mappers, and so on.
  • Make installation forms dynamic; the value of a parameter determines the other parameters to be displayed.
  • Help perform client-side validation of the installation parameter values entered.

For a demonstration of how custom installation pages are used, see the Custom Installation Page sample app.

To create and use a Custom Installation page:

  1. Create the iparams.html file, specifying all required HTML, CSS, and JavaScript (JS) information.
  2. In the iparams.html file, add the postConfigs method to retrieve the iparams as form fields with values and store them.
  3. In the iparams.html file, add the getConfigs method to retrieve the stored iparams’ values alone and populate the Edit Settings page.
  4. To perform client-side validation of the iparams entered, in the iparams.html file, add the validate method.
  5. Retrieve the stored iparams and use them in apps.

Note:To handle the secure iparam values entered in the Custom Installation page, the Request method is used. In SMI, when a serverless component is invoked, the iparams defined in a custom installation page are passed as a JSON payload.

Create custom iparams

  1. Navigate to the config directory and create an iparams.html file. Note:Ensure that the config directory contains only one of the two files - iparams.json or iparams.html.
  2. In the iparams.html file, include:
    1. The required HTML, CSS, and JS dependencies.
    2. The appclient through <script src="{{{appclient}}}"></script> if you are building apps by using FDK version 9.0.0 or later with platform version 2.3.
    3. A reference to the product style sheet, to maintain design consistency.
  3. To retrieve product account specific information such as the domain name and api key associated with an account, in iparams.html, use a text type input element with the data-bind attribute.
    <input type="text" name="api_key" data-bind="product.api_key">
    <input type="text" name="domain" data-bind="product.domain">

Note:You can add external assets, such as .css and .js, in the config/assets folder to render the Custom Installation page.

Use postConfigs method

To store the installation parameter values entered in the installation page, include this method in the iparams.html file. The method is triggered when, on the installation page, Install is clicked. The method stores the iparams and corresponding values entered in the installation page, as JSON key-value pairs. Secure iparam values are passed using the meta tag in this method.

Use getConfigs method

To retrieve the stored iparams’ values and populate them on the Edit Settings page, include this method in the iparams.html file. The method is triggered when you click the Settings icon on the Installed Apps Listing page.

Use validate method

To validate the values entered on the installation page or the Edit settings page, include this method in the iparams.html file. The method is triggered when:

  • During installation, users enter iparam values and click Install on the Installation page.
  • After installation, users edit iparam values and click Save on the Edit Settings page.

If the method returns false, the installation is stopped or the iparam values are not saved.

Retrieve

For information on how to retrieve the configured iparams and to use them in the app components, see the Retrieve iparams section.

Test iparams

To test the configured installation parameters:

  1. From the command prompt, navigate to the app project folder, and run the following command:
    fdk run
    If the app contains an Installation page, the following message is displayed:
    To test the installation page, visit - http://localhost:10001/custom_configs
  2. Navigate to the specified location. The Installation page is displayed.
  3. Enter appropriate values in the fields and click INSTALL.