Official Lumia Stream Plugin SDK for building Lumia Stream plugins.
npm install @lumiastream/pluginOfficial TypeScript/JavaScript SDK for developing plugins for Lumia Stream.
``bash`
npm install @lumiastream/plugin
`ts
import {
Plugin,
type PluginManifest,
type PluginContext,
} from "@lumiastream/plugin";
export default class MyPlugin extends Plugin {
constructor(manifest: PluginManifest, context: PluginContext) {
super(manifest, context);
}
async onload(): Promise
// Plugin loaded
}
async onunload(): Promise
// Plugin unloaded
}
}
`
Every plugin requires a manifest.json file that describes your plugin, its metadata, and configuration:
`json`
{
"id": "my_awesome_plugin",
"name": "My Awesome Plugin",
"version": "1.0.0",
"author": "Your Name",
"description": "A brief description of what your plugin does",
"lumiaVersion": "^9.0.0",
"category": "utilities",
"config": {
"settings": [
{
"key": "apiKey",
"label": "API Key",
"type": "text",
"required": true
}
]
}
}
- onload() – invoked when the plugin is enabled inside Lumia Stream.onunload()
- – called when your plugin is disabled or unloaded.onupdate(oldVersion, newVersion)
- – triggered after version upgrades.onsettingsupdate(settings, previousSettings)
- – called whenever settings change.actions(config)
- – handle custom actions invoked from Lumia automations. action.value
Note: action parameters are provided via . Use const params = action?.value ?? {};.
Interact with Lumia Stream using the strongly typed ILumiaAPI helper on the plugin context:
`ts`
await this.lumia.triggerAlert({
alert: "follow",
extraSettings: { username: "StreamerFan" },
showInEventList: true,
});
await this.lumia.playAudio({ path: "alert.mp3", volume: 0.7 });
this.lumia.setVariable("follower_count", 1337);
this.lumia.displayChat({
username: "Viewer123",
message: "Hello from the plugin!",
});
See the API reference for the full surface area.
Plugins execute in an isolated Node.js process (no browser DOM). Use Node-compatible packages and avoid browser-only APIs like window, document, localStorage, or XMLHttpRequest. Bundle or ship your dependencies with the plugin; do not assume Lumia provides third-party packages unless documented.
- npm run build – compile the SDK to the dist folder.npm run lint
- – type-check the source without emitting output.
The CLI is distributed separately via lumia-plugin. Use it with npx (requires npm 7+).
- npx lumia-plugin create my_plugin scaffold a feature-rich sample plugin showing logging, variables, and alertsnpx lumia-plugin validate ./path/to/plugin
- check manifest.json, entry files, and config for common mistakesnpx lumia-plugin build ./path/to/plugin --out ./plugin.lumiaplugin
- bundle the directory into a distributable archive
- Getting Started
- API Reference
- Manifest Guide
- Field Types Reference
- examples/rumble` – Plain JavaScript Rumble livestream plugin that polls the API, updates variables, and fires alerts.
The SDK is released under the MIT License. See LICENSE for details.