Configuration

The config.json file we will create lays the basic foundation of out plugin, its name, author, description etc.

Check the 'Advanced/ Config' page for a more in-depth look at what exactly the config.json file is, and a description of the attributes.

With the hello-plugin created within our HollaEx Kit folder, we can start building theconfig.json file with all the basic information needed, good idea here to get out your IDE of choice.

  1. Create a file namedconfig.json inside the server/ directory of the newly-created hello-plugin plugin.

  2. Copy and paste the following code into this newly created file:

Click here for the config.json code for hello-plugin
{
    "name": "hello-plugin",
    "version": 1,
    "type": null,
    "author": "You",
    "bio": "A short description",
    "description": "This is a longer description of your first plugin",
	"documentation": null,
	"logo": null,
	"icon": null,
	"url": null,
    "public_meta": {
        "public_message": {
          "type": "string",
          "required": false,
          "description": "I can be seen by anyone!",
          "value": "Hello, this text is from the plugin!"
        }
      },
      "meta": {
        "private_message": {
          "type": "string",
          "required": false,
          "description": "I can only be seen by some!",
          "value": "Hi, this is the secret text from the plugin!"
		}
	},
	"prescript": {
		"install": ["hello-world-npm"],
		"run": null
	},
	"postscript": {
		"run": null
	}
}

And that's all for what we need to do on this page!

Continue onto the next step, or read below for a bit more understanding of what this new config.json is actually doing.

What Did We Just Do?

Looking at the interesting bits of the config.json we can see what we have actually defined.

Check the list on this page, for full definitions of each element

{
  "name": "hello-plugin",
  "version": 1,
  "type": null,
  "author": "You",
  "bio": "A short description",
  "description": "This is a longer description of your first plugin",
    ...
}

The top part of the code we see above is fairly simple. We have defined the name, version, and author of the plugin (hello-plugin, on version 1, written by 'You'), as well as created its bio - a quick description, and the description - a more detailed description seen on the plugins page.

Documentation, logo, icon, and url are all set to null at the moment so we will ignore them for now.

{
    ...
    "public_meta": {
      "public_message": {
        "type": "string",
        "required": false,
        "description": "I can be seen by anyone!",
        "value": "Hello, this text is from the plugin!"
      }
    },
    "meta": {
      "private_message": {
        "type": "string",
        "required": false,
        "description": "I can only be seen by some!",
        "value": "Hi, this is the secret text from the plugin!"
      }
    },
    ...
}

Moving to the next code chunk, we find public-meta and meta.

Again for a more in-depth view of what these are, check the main config page. Bothpublic-meta and meta are core aspects of plugins, so it's good to have a solid understanding of them.

For hello-plugin, we have one object within both public-meta and meta, public-message and private_message respectively, both being fairly similar.

  • type : This defines the (surprisingly) type of the object, out of four allowed types (number, string, boolean, and date-time). In hello-plugin, both public-meta and meta objects will be strings

  • required : Neither of these values are strictly required for hello-plugin to run

  • description is the description of the values, here we are reminded that public-meta is not a secret and meta is a secret object.

  • value : Here we find the strings our plugin will actually use. We will see these values actually on the exchange in the appropriate places later.

{
    ...
"prescript": {
    "install": ["hello-world-npm"],
    "run": null
  },
  "postscript": {
    "run": null
  }
    ...
}

At the end of our code, we have the prescript and postscript. In hello-plugin all that will be installed is the hello-world-npm package before the plugin is live.

Last updated