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.
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 sametype
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.
Prescript: The prescript object holds two fields,
install
, andrun
.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, therun
feature is not enabled.
Postscript: The postscript object holds the field
run
.run
is a bash script that runs after the plugin is enabled. Currently, therun
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
andpublic_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