Skip to content
We're currently creating a lot of content. Sign up to get notified when it's ready.

Overview

The Plugin Engine API exposes some global methods and the plugin interface, where all the engine code will run.

Plugin Interface

The plugin engine class should implement this interface. There’s only one mandatory method run. The other methods are used to subscribe to events. Events available are listed here.

Example

Instantiate a plugin.

import { PluginI, SDK } from "@qatium/plugin/engine";
class Plugin implements PluginI<string> {
run(sdk: SDK) {}
};
const myPlugin = new Plugin();

registerPlugin()

The function registerPlugin is the entry point for the plugin engine. It should be called with the plugin instance in order to run the plugin.

Method signature

registerPlugin<T>(plugin: PluginI<T>): void;
Parameters
  • plugin: PluginI<T>: A Plugin instance

Example

Register a plugin instance.

import { PluginI, SDK, registerPlugin } from "@qatium/plugin/engine";
class Plugin implements PluginI<string> {
run(sdk: SDK) {}
};
const myPlugin = new Plugin();
registerPlugin(myPlugin);