Premium Feature

The plugin system requires an active Premium subscription. Free edition users can browse installed plugins but cannot enable or load them.

What Are Plugins?

Plugins let you extend VMSC beyond its built-in capabilities. A plugin is a small Node.js module that hooks into the VMSC event bus to react to stream events, emit new events, or store its own configuration. Use cases include custom chat commands, third-party API integrations, hardware triggers, and anything else you can write in JavaScript.

Each plugin has a type that describes its role:

  • source — Produces events (e.g., polling an external API and emitting stream events)
  • output — Consumes events and performs side effects (e.g., sending data to a webhook)
  • action — Adds new action types that rules can trigger

Plugin Directory

VMSC discovers plugins from the following directory on your system:

%APPDATA%/vryionics-multistream-connector/plugins/

Each plugin lives in its own subfolder. The folder name can be anything, but it must contain a manifest.json file at its root. VMSC scans this directory on startup and loads any plugins that are enabled in your configuration.

Plugin Manifest

Every plugin requires a manifest.json that describes metadata and the entry point. Here is a complete example:

{
  "name": "my-plugin",
  "version": "1.0.0",
  "description": "A short description of what the plugin does",
  "author": "YourName",
  "type": "action",
  "entryPoint": "index.js",
  "minAppVersion": "1.2.0"
}

Required fields: name (unique identifier, used as config namespace), version (semver string), type (one of source, output, or action), and entryPoint (relative path to the main JS file). Optional fields include description, author, and minAppVersion.

Plugin API

When VMSC activates a plugin, it calls the exported activate(context) function and passes a PluginContext object. This context provides three namespaced APIs:

Event Bus

Subscribe to and emit stream events through the VMSC event bus.

  • context.eventBus.emit(event, data) — Fire an event into the event bus so rules and other plugins can react to it.
  • context.eventBus.on(event, handler) — Subscribe to stream events. Returns an unsubscribe function you should call during deactivate().

Scoped Config

Read and write configuration values scoped to your plugin. Values are persisted across restarts.

  • context.config.get(key) — Retrieve a stored value by key.
  • context.config.set(key, value) — Store a value. Keys must be simple strings (no dots or slashes).
  • context.config.getAll() — Returns the entire config object for your plugin.

Logger

Structured logging that prefixes messages with your plugin name.

  • context.logger.info(msg), .warn(msg), .error(msg), .debug(msg)

Creating a Simple Plugin

This example creates a plugin that logs every chat message to the console and stores a running message count.

1. Create the plugin folder and manifest:

mkdir "%APPDATA%/vryionics-multistream-connector/plugins/hello-chat"

Add a manifest.json:

{
  "name": "hello-chat",
  "version": "1.0.0",
  "description": "Logs chat messages and counts them",
  "author": "YourName",
  "type": "action",
  "entryPoint": "index.js"
}

2. Write the entry point (index.js):

let unsubscribe;

exports.activate = function (context) {
  const count = context.config.get('messageCount') || 0;
  context.logger.info('Hello Chat activated! Previous count: ' + count);

  unsubscribe = context.eventBus.on('chat', function (event) {
    const newCount = (context.config.get('messageCount') || 0) + 1;
    context.config.set('messageCount', newCount);
    context.logger.info('[' + newCount + '] ' + event.uniqueId + ': ' + event.comment);
  });
};

exports.deactivate = function () {
  if (unsubscribe) unsubscribe();
};

3. Enable the plugin from Settings > Plugins and restart VMSC. The plugin will begin logging chat messages immediately.

Managing Plugins

All discovered plugins appear in Settings > Plugins. From this panel you can:

  • Toggle individual plugins on or off
  • View plugin metadata (name, version, author, type)
  • See error messages if a plugin failed to load
  • Open the plugins folder on disk

Enabling or disabling a plugin takes effect immediately — VMSC will call activate() or deactivate() without requiring a restart.

Security and Notes

Plugins Run in the Main Process

Plugins execute inside the main Electron process with full Node.js API access. A plugin can read files, make network requests, and access system resources without restriction. Only install plugins from authors you trust. Future versions may introduce sandboxing via worker threads.

Advanced Users Only

Plugin development requires familiarity with JavaScript/Node.js and the VMSC event system. For a deeper reference, see the Plugin API Reference and Event Types documentation.