Aether Home Plugin API

API Documentation

Aether plugins provide a simple way to extend and tweak the behaviour of the client without having to modify the core code. Almost any action that occurs in the client can be hooked into and manipulated through plugins - only internal state for each component is inaccessible to plugins.

Plugins for Aether are written in Node v6 compatible JavaScript. Some features from ES6 and ES7 are unavailable in Aether plugins directly - instead, you should use a transpiler such as Babel and distribute the ES5-compatible code.

Understanding Aether’s Design

To understand how a plugin works, we must first understand how Aether is structured, and how actions from the IRC connection eventually reach the user.

The answer to all of that is Redux. For our purposes, all we need to know is this:

This ASCII diagram may illustrate the point:

ACTION ---> PLUGINS ---> REDUCERS ---> STORE ---> UI
 |                                                 |
 |--------------------<-----------------------------
 ^
CLIENT CONNECTION

Plugins are allowed to change actions, delete them completely or trigger new actions. There are also a few other things that plugins can do that don’t fit into the above cycle:

Plugins can require any built-in Node.js module, such as https, fs, or net. Libraries from npm must be bundled with your plugin.

Getting Started

Aether plugins are, at their heart, just simple JavaScript objects that are created with the new syntax. Here are some examples of a minimal valid plugin in both ES5 and ES6 syntax.

ES5

function MyPlugin(registerForHook, registerForMime, store, actions) {
  this.name = 'Example Plugin';
  this.author = 'ExampleCreator';
  this.description = 'Acts as an example plugin.';
  this.version = [1, 0, 0];
  this.uuid = '49d8c38a-22ca-4b53-9133-70e5177bc2e7';
  this.defaultSettings = {};
  this.settings = [];
}

module.exports = MyPlugin;

ES6

class MyPlugin {
  constructor(registerForHook, registerForMime, store, actions) {
    this.name = 'Example Plugin';
    this.author = 'ExampleCreator';
    this.description = 'Acts as an example plugin.';
    this.version = [1, 0, 0];
    this.uuid = '49d8c38a-22ca-4b53-9133-70e5177bc2e7';
    this.defaultSettings = {};
    this.settings = [];
  }
}

export default MyPlugin;

Plugins must provide the following values, as shown above:

Metadata

TODO.

Handling Drag and Drop

TODO.

Hooks

TODO.