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.jsonfile. 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.
"name": "Plugin Name",
"bio": "Short description shown in admin panel",
"description": "Description shown on plugin page",
- 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
typecan 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.
metaare 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
metaand variables that you want your public client web view to access should be set in
metaobjects require the keys
valuefor each parameter added.
typeis the data type of the parameter (only
requiredis whether or not the parameter is required for the plugin.
descriptionis the description of the parameter in use.
valueis the actual value set for the plugin.
- Prescript: The prescript object holds two fields,
installis an array of strings. Each string is the name of the NPM library the plugin should install before running.
runis a bash script run before the plugin is enabled. Currently, the
runfeature is not enabled.
- Postscript: The postscript object holds the field
runis a bash script that runs after the plugin is enabled. Currently, the
runfeature 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.
- 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
To see an example of how these elements are used in a real plugin example check the hello-exchange walkthrough below.