Skip to content

Plugin Architecture

Otso plugins extend imports, publishers, and enrichers. A plugin is a Node module exporting a manifest and hooks.

Plugins are discovered via package.json using the "otso" field or by loading from the local plugins/ directory.

Example manifest:

export const manifest = {
name: 'example',
version: '1.0.0',
hooks: ['import', 'publish']
};
import type { ImportHook } from 'otso';
export const importHook: ImportHook = async (ctx) => {
// fetch data and yield events
};

Hook functions receive a context with logging, storage, and config helpers.

  • Use pnpm link during development.
  • Provide fixtures for APIs and run pnpm test inside your plugin repo.
  • See @otso/import-github for a real world example.