Skip to Content
Plugins

Plugins

Content types are handled by plugins. Three ship built-in, and unknown file types fall back to a generic file plugin (packages/plugin-file).

PluginDescription
GalleryBuilt-in media gallery (images, animations, videos, danmaku, messages)
MangaManga reader with scroll/paged modes, per-page messages, position restore
NovelNovel reader

Architecture

A content plugin is made of three parts:

  • manifest.json — declares the plugin’s UUID, permissions, i18n strings, and UI templates
  • Server side — a main.js exposing createPlugin(api), implementing the ContentPlugin contract from @hoardodile/plugin-sdk-server (prefer definePlugin() for a declarative definition)
  • Client side — a renderer that runs inside a sandboxed iframe and talks to the host app over postMessage

The server loads each plugin’s dist/main.js via dynamic import. On the client, framework-agnostic plugins use @hoardodile/plugin-sdk-web; React plugins use @hoardodile/plugin-sdk-react (createPluginRoot, usePluginAPI, useVisibility).

Plugin SDK packages

PackageRole
@hoardodile/plugin-sdk-typesShared plugin runtime types
@hoardodile/plugin-sdk-serverServer-side plugin contract + helpers
@hoardodile/plugin-sdk-webFramework-agnostic iframe/postMessage runtime
@hoardodile/plugin-sdk-reactReact bindings for iframe plugins

The plugin-sdk-* packages are intended for future npm publication, so their public API surface is kept deliberate.

Last updated on