PluginContext

Properties

Environment Variables

  • MAIN_PLUGIN_REPO String
  • DEV_PLUGIN_REPO String
  • INTERNAL_PLUGIN_REPO String
  • __PLUGIN_PREINSTALL_DIR String
  • __PLUGIN_PREUNINSTALL_FILE String
  • CURRENT_API_VERSION String
  • COMPATIBLE_API_VERSIONS Array<String>

Utilities

Preference Objects

Example

'use strict';

module.exports = (pluginContext) => {
  const app = pluginContext.app;
  const toast = pluginContext.toast;
  const logger = pluginContext.logger;
  
  function startup() { ... }
  
  function search(query, res) { ... }
  
  function execute(id, payload) {
    if (id === '1') {
      toast.enqueue('This is message', 1500);
    } else if (id == '2') {
      app.close();
    } else if (id == '3') {
      logger.log('this is log');
    }
  }
  
  return { startup, search, execute };
};