Config

The config.json defines the plugin's general structure. Here we will take a look at what makes up a config file and see how we make one for hello-exchange

The general structure of the plugin is defined in the config.json file. Config includes the plugin name, description, icon, etc.

The Config is basically a draft of a plugin JSON- the final product. Most items in the config are self-explanatory but below they are fully defined.

When the plugin is initialized, the config.json file will not be created, so it must be added manually. Check the hello-exchange plugin walkthrough at the bottom to see how this process is generally done.

Click here for an example of how a config.json looks
{
	"name": "Plugin Name",
	"version": 1,
	"type": null,
	"author": "Author",
	"bio": "Short description shown in admin panel",
	"description": "Description shown on plugin page",
	"documentation": null,
	"logo": null,
	"icon": null,
	"url": null,
	"public_meta": {
		"public_value": {
			...
		}
	},
	"meta": {
		"private_value": {
			...
		}
	},
	"prescript": {
		"install": ["hello-world-npm"],
		"run": null
	},
	"postscript": {
		"run": null
	}
}

Config File Elements

  • Name: The name of your plugin must not include spaces and has to be unique from all other plugins installed on your Kit

  • Type: The type of this plugin. This value can be set to null. If this value is set, no other plugin with the same type can be installed.

  • Version: The version of your plugin is important when it comes to upgrading.

  • Bio: The bio is a short description of your plugin that shows in the plugin list on the blue admin panel

  • Description: The description is the full description of your plugin shown on the plugin page.

  • Author: The author who is shown on the plugin page.

  • Public_meta: The public_meta object holds all public values used in the plugin that can be changed while the plugin is running. It should hold values that are publicly available.

  • Meta: The meta-object holds all private values used in the plugin that can be changed while the plugin is running. It should hold values for unique keys, secrets, etc.

Note on Public_meta & Meta and their requirements

public_meta and meta are variables accessible in the plugin interface on the exchange operator control and they can easily be dynamically set by the exchange operator.

Variables like keys should be set in meta and variables that you want your public client web view to access should be set in public_meta .

Both the public_meta and meta objects require the keys type, required, description, and value for each parameter added.

  • type is the data type of the parameter (only number, string, boolean, and date-time are allowed).

  • required is whether or not the parameter is required for the plugin.

  • description is the description of the parameter in use.

  • value is the actual value set for the plugin.

  • Prescript: The prescript object holds two fields, install, and run. install is an array of strings. Each string is the name of the NPM library the plugin should install before running. run is a bash script run before the plugin is enabled. Currently, the run feature is not enabled.

Note on Prescript

prescript is a set of scripts that should run before the plugin goes live. Currently, it supports install which is an array of npm libraries you want to install.

Note that you do not need to install HollaEx Kit dependencies since they are already available by default.

  • Postscript: The postscript object holds the field run. run is a bash script that runs after the plugin is enabled. Currently, the run feature is not enabled.

  • Script: This is the ES6+ script for your plugin. When enabled, this script will run. The script should be passed as a minified string.

  • Web_view: This field will contain the plugin's web client code. You can read more about it in the later Web View Development page here.

  • Admin_view: This field will contain the plugin's admin client code. This is HTML code and once added to the plugin there will be a new section added to the left sidebar of the operator control that includes this code. This is used for cases where the admin wants to have more freedom and control over certain actions beyond just configuring meta and public_meta

To see an example of how these elements are used in a real plugin example check the hello-exchange walkthrough below.

To continue with the next section on how to make endpoints and server-side coding, click here.

Last updated