All plugins are registered with Kirby's static Kirby::plugin() method. It doesn't matter if you want to create just a simple KirbyTag plugin or a custom field for the Panel. Kirby::plugin() is your way to go.

To store more information about your plugin, you can add a composer.json to your plugin folder. We recommend to use composer's composer init command to simplify this step. All information in the composer.json can later be queried from your plugin:

The fields in the example composer.json above are just the basic metadata fields. Composer is also a tool that's useful to install plugins. How to setup your plugin for that is explained in our plugin setup articles.

Note that the name inside the composer.json file is only the name of the Composer package. If needed, it can differ from the name you give your plugin when registering it with Kirby::plugin(), which will be used when getting plugin data. We recommend to keep both names consistent to avoid confusion.

Each plugin can have its own assets folder with any number of additional assets, such as images or CSS and JS files. Kirby will automatically take care to make those assets publicly available without needing to copy them to a specific folder.

Kirby will automatically add timestamps to each asset URL to enable cache busting out of the box. This means that assets will automatically be refreshed when a user installs an updated version of your plugin.