Installation Parameters

The installation parameters or iparams are essentially the settings that you want your users to configure when installing the apps. You can define these parameters via the iparams_en.yml file accessible via the config folder in your app project. Each parameter will have a key associated with it. And for each key, you can define a set of fields to provide the user context on what that particular setting or parameter does.


NOTE:
If your app needs parameters to work, you will have to set values for your iparam keys in iparam_test_data.yml file in order to enable local testing.


Sample iparam_en.yml

Copied Copy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
api_key: display_name: "API Key" description: "Please enter your API key" type: "text" required: true country: display_name: "Country" description: "Please enter your country" type: "dropdown" options: - India - Iceland - US - UK default_value: US
EXPAND ↓

The parameters that are available for you to use are:

  1. display_name: Users will see this as the parameter name in the installation form. This cannot exceed 50 characters.
  2. description: A description of what the parameter is. This cannot exceed 250 characters.
  3. type: Type of input expected from the user. This can be either a “text” or a “dropdown”.
  4. required (optional): Is input mandatory from the app installer? If so, set this field as “true”.

If you create a parameter of the “Dropdown” type then you will need to define two more fields.

  1. options: List of dropdown options
  2. default_value: Make one as default from the list of options.

Once you have configured the iparams for your app, you can use them in your template.html or app.js by following the liquid convention {{iparam.field_name}} where field_name is the name of the key that you have configured. For example, If api_key is the name of the key which you have configured within your iparam_*.yml files, you’ll have to use {{iparam.api_key}} to access that within your template.html and app.js files.

template.html
Copied Copy
1
2
3
4
5
6
7
8
9
INPUT: <div> My API key is : {{iparam.api_key}} </div> OUTPUT: <div> My API key is : YOUR API KEY </div>
app.js
Copied Copy
1
2
3
4
5
6
7
8
9
10
11
INPUT: (function() { return { initialize: function() { console.log("My API key is : {{iparam.api_key}}"); } } })(); OUTPUT: My API key is : YOUR API KEY
EXPAND ↓

When you run the init command, a sample iparam_en.yml is created. You can modify this and reuse for your app. Please make sure you uncomment all the lines in the file before using it, else the parameters won’t be usable.

Log in with your Freshdesk account

Enter your helpdesk URL to proceed to login

Proceed

By clicking "Proceed", you agree to our Terms of Use.