Manage Plugin Variables

Filter by IDE
Select the Progress AppBuilder client you are currently using for development.

IDE

You can use custom modules with plugin variables (for example, plugins for services which require additional authentication by unique identifier). After you add a module with plugin variables, you can set the values for the variables.

In this version of AppBuilder, you cannot work with configuration-specific values for plugin variables.

IMPORTANT: You will not be able to build your app, if you do not set values for the required plugin variables.

Prerequisite

  • Verify that you have added the custom module that you want to use.
  • Verify that your preferred AppBuilder client is running and you are logged in.
  • Verify that you have opened the code for your app in AppBuilder.

Procedure

You cannot test plugins in the developer app. To be able to verify that the plugins work as expected, you need to build and deploy your app as an application package on the device.

In-Browser

Set Variable Values for Plugins from npm

If you have added your plugin using this procedure, perform the following steps.

  1. In the Project Navigator, double-click Properties.
  2. Navigate to the Dependencies tab.
  3. Click the cogwheel icon for the plugin that you want to configure.
  4. Provide values for the plugin variables and click Done.
  5. Close the Properties dialog.
  6. (Optional) Verify that your package.json is updated properly.
    1. In the Project Navigator, double-click package.json in the root.
    2. Locate the nativescript block.
      If updated properly, this block contains a block named <pluginName>-variables which lists the plugin variables and their values as key-value pairs.

Set Variable Values for Plugins from the Telerik Verified Plugins Marketplace

If you have added your plugin using this procedure, perform the following steps.

  1. In the Project Navigator, double-click Properties.
  2. Navigate to the Dependencies tab.
  3. Click the cogwheel icon for the plugin that you want to configure.
  4. Provide values for the plugin variables and click Done.
  5. Close the Properties dialog.
  6. (Optional) Verify that your package.json is updated properly.
    1. In the Project Navigator, double-click package.json in the root.
    2. Locate the nativescript block.
      If updated properly, this block contains a block named <pluginName>-variables which lists the plugin variables and their values as key-value pairs.

Set Variable Values for Plugins Added via package.json

If you have added your plugin using this procedure, perform the following steps.

  1. Inspect the package.json file for the plugin.
    You can find this file in the root of the plugin.
  2. Locate the variables block and copy the listed plugin variables.
  3. In AppBuilder, in the Project Navigator, double-click package.json in the root of your app.
  4. After the devDependencies block, add the following block.
    If the nativescript block already exists, add your plugin variable entries inside it.

    "nativescript": {
        "<pluginName>-variables": {
            "<variableName1>": "<variableValue1>",
            "<variableName2>": "<variableValue2>"
        }
    }
    

    The following is an example of a complete package.json for an app which contains a locally added custom plugin in a custom-plugins directory in the root.

    {
        "dependencies": {
            "tns-core-modules": "2.2.0",
            "my-sample-plugin": "file:custom-plugins/my-sample-plugin"
    
        },
        "devDependencies": {},
        "nativescript": {
            "my-sample-plugin-variables": {
                "unique-identifier": "1234567890",
                "unique-name": "Sample App"
            }
        }
    }
    
  5. Save your changes.

Universal

Set Variable Values for Plugins from npm

If you have added your plugin using this procedure, perform the following steps.

  1. In the Project Navigator, double-click Properties.
  2. Navigate to the Dependencies tab.
  3. Click the cogwheel icon for the plugin that you want to configure.
  4. Provide values for the plugin variables and click Done.
  5. Close the Properties dialog.
  6. (Optional) Verify that your package.json is updated properly.
    1. In the Project Navigator, double-click package.json in the root.
    2. Locate the nativescript block.
      If updated properly, this block contains a block named <pluginName>-variables which lists the plugin variables and their values as key-value pairs.

Set Variable Values for Plugins from the Telerik Verified Plugins Marketplace

If you have added your plugin using this procedure, perform the following steps.

  1. In the Project Navigator, double-click Properties.
  2. Navigate to the Dependencies tab.
  3. Click the cogwheel icon for the plugin that you want to configure.
  4. Provide values for the plugin variables and click Done.
  5. Close the Properties dialog.
  6. (Optional) Verify that your package.json is updated properly.
    1. In the Project Navigator, double-click package.json in the root.
    2. Locate the nativescript block.
      If updated properly, this block contains a block named <pluginName>-variables which lists the plugin variables and their values as key-value pairs.

Set Variable Values for Plugins Added via package.json

If you have added your plugin using this procedure, perform the following steps.

  1. Inspect the package.json file for the plugin.
    It is located in the root of the plugin.
  2. Locate the variables block and copy the listed plugin variables.
  3. In AppBuilder, in the Project Navigator, double-click package.json in the root of your app.
  4. After the devDependencies block, add the following block.
    If the nativescript block already exists, add your plugin variable entries inside it.

    "nativescript": {
        "<pluginName>-variables": {
            "<variableName1>": "<variableValue1>",
            "<variableName2>": "<variableValue2>"
        }
    }
    

    The following is an example of a complete package.json for an app which contains a locally added custom plugin in a custom-plugins directory in the root.

    {
        "dependencies": {
            "tns-core-modules": "2.2.0",
            "my-sample-plugin": "file:custom-plugins/my-sample-plugin"
    
        },
        "devDependencies": {},
        "nativescript": {
            "my-sample-plugin-variables": {
                "unique-identifier": "1234567890",
                "unique-name": "Sample App"
            }
        }
    }
    
  5. Save your changes.

Windows

Set Variable Values for Plugins from npm

If you have added your plugin using this procedure, perform the following steps.

  1. In the Project Navigator, double-click Properties.
  2. Navigate to the Dependencies tab.
  3. Click the cogwheel icon for the plugin that you want to configure.
  4. Provide values for the plugin variables and click OK.
  5. Close the Properties dialog.
  6. (Optional) Verify that your package.json is updated properly.
    1. In the Project Navigator, double-click package.json in the root.
    2. Locate the nativescript block.
      If updated properly, this block contains a block named <pluginName>-variables which lists the plugin variables and their values as key-value pairs.

Set Variable Values for Plugins from the Telerik Verified Plugins Marketplace

If you have added your plugin using this procedure, perform the following steps.

  1. In the Project Navigator, double-click Properties.
  2. Navigate to the Dependencies tab.
  3. Click the cogwheel icon for the plugin that you want to configure.
  4. Provide values for the plugin variables and click OK.
  5. Close the Properties dialog.
  6. (Optional) Verify that your package.json is updated properly.
    1. In the Project Navigator, double-click package.json in the root.
    2. Locate the nativescript block.
      If updated properly, this block contains a block named <pluginName>-variables which lists the plugin variables and their values as key-value pairs.

Set Variable Values for Plugins Added via package.json

If you have added your plugin using this procedure, perform the following steps.

  1. Inspect the package.json file for the plugin.
    It is located in the root of the plugin. Based on where the plugin is hosted, you might need to locate the package.json in GitHub or inside your app.
  2. Locate the variables block and copy the listed plugin variables.
  3. In AppBuilder, in the Project Navigator, double-click package.json in the root of your app.
  4. After the devDependencies block, add the following block.
    If the nativescript block already exists, add your plugin variable entries inside it.

    "nativescript": {
        "<pluginName>-variables": {
            "<variableName1>": "<variableValue1>",
            "<variableName2>": "<variableValue2>"
        }
    }
    

    The following is an example of a complete package.json for an app which contains a locally added custom plugin in a custom-plugins directory in the root.

    {
        "dependencies": {
            "tns-core-modules": "2.2.0",
            "my-sample-plugin": "file:custom-plugins/my-sample-plugin"
    
        },
        "devDependencies": {},
        "nativescript": {
            "my-sample-plugin-variables": {
                "unique-identifier": "1234567890",
                "unique-name": "Sample App"
            }
        }
    }
    
  5. Save your changes.

Visual Studio

Set Variable Values for Plugins from npm

If you have added your plugin using this procedure, perform the following steps.

  1. In the Solution Explorer, double-click Properties.
  2. Navigate to the Dependencies tab.
  3. Click the cogwheel icon for the plugin that you want to configure.
  4. Provide values for the plugin variables and click OK.
  5. Close the Properties dialog.
  6. (Optional) Verify that your package.json is updated properly.
    1. In the Solution Explorer, double-click package.json in the root.
    2. Locate the nativescript block.
      If updated properly, this block contains a block named <pluginName>-variables which lists the plugin variables and their values as key-value pairs.

Set Variable Values for Plugins from the Telerik Verified Plugins Marketplace

If you have added your plugin using this procedure, perform the following steps.

  1. In the Solution Explorer, double-click Properties.
  2. Navigate to the Dependencies tab.
  3. Click the cogwheel icon for the plugin that you want to configure.
  4. Provide values for the plugin variables and click OK.
  5. Close the Properties dialog.
  6. (Optional) Verify that your package.json is updated properly.
    1. In the Solution Explorer, double-click package.json in the root.
    2. Locate the nativescript block.
      If updated properly, this block contains a block named <pluginName>-variables which lists the plugin variables and their values as key-value pairs.

Set Variable Values for Plugins Added via package.json

If you have added your plugin using this procedure, perform the following steps.

  1. Inspect the package.json file for the plugin.
    It is located in the root of the plugin. Based on where the plugin is hosted, you might need to locate the package.json in GitHub or inside your app.
  2. Locate the variables block and copy the listed plugin variables.
  3. In AppBuilder, in the Solution Explorer, double-click package.json in the root of your app.
  4. After the devDependencies block, add the following block.
    If the nativescript block already exists, add your plugin variable entries inside it.

    "nativescript": {
        "<pluginName>-variables": {
            "<variableName1>": "<variableValue1>",
            "<variableName2>": "<variableValue2>"
        }
    }
    

    The following is an example of a complete package.json for an app which contains a locally added custom plugin in a custom-plugins directory in the root.

    {
        "dependencies": {
            "tns-core-modules": "2.2.0",
            "my-sample-plugin": "file:custom-plugins/my-sample-plugin"
    
        },
        "devDependencies": {},
        "nativescript": {
            "my-sample-plugin-variables": {
                "unique-identifier": "1234567890",
                "unique-name": "Sample App"
            }
        }
    }
    
  5. Save your changes.

CLI

Set Variable Values for Plugins from npm

If you have added your plugin using this procedure, the command-line interface has prompted you to provide values for the plugin variables during the plugin installation. If you want to modify the values you provided earlier, perform the following steps.

  1. In the command prompt, navigate to the directory that contains your app.
  2. To list the current plugins and information about their plugin variables, run the following command:

    appbuilder plugin
    
  3. To configure the plugin variables of a selected plugin, run the following command:

    appbuilder plugin configure <Plugin Name or ID>
    

    <Plugin Name or ID> is the name or ID of the plugin as listed by appbuilder plugin

  4. When prompted, provide value for the plugin variable and press Enter.

Set Variable Values for Plugins from the Telerik Verified Plugins Marketplace

If you have added your plugin using this procedure, the command-line interface has prompted you to provide values for the plugin variables during the plugin installation. If you want to modify the values you provided earlier, perform the following steps.

  1. In the command prompt, navigate to the directory that contains your app.
  2. To list the current plugins and information about their plugin variables, run the following command:

    appbuilder plugin
    
  3. To configure the plugin variables of a selected plugin, run the following command:

    appbuilder plugin configure <Plugin Name or ID>
    

    <Plugin Name or ID> is the name or ID of the plugin as listed by appbuilder plugin

  4. When prompted, provide value for the plugin variable and press Enter.

Set Variable Values for Plugins Added via package.json

If you have added your plugin using this procedure, perform the following steps.

  1. In the command prompt, navigate to the directory that contains your app.
  2. To list the current plugins and information about their plugin variables, run the following command:

    appbuilder plugin
    
  3. To configure the plugin variables of a selected plugin, run the following command:

    appbuilder plugin configure <Plugin Name or ID>
    

    <Plugin Name or ID> is the name or ID of the plugin as listed in your package.json file.

  4. When prompted, provide value for the plugin variable and press Enter.

Next Steps

Build your app and test the plugin on device.

See Also

Start a free trial Request a demo
Contact us: +1-888-365-2779
sales@telerik.com
Copyright © 2016-2017, Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.