Skip to content

Your first plugin

Build a small plugin using only the public SDK. You need a built FluxPlugs checkout and a compatible injected runtime. The SDK packages are not published to a registry by this change.

Copy plugin-creation/starter into a directory outside the checkout. The starter already contains a manifest, TypeScript configuration, and both UI modes.

For a minimal first plugin, keep its ID standalone-demo, set the manifest capabilities to [“ui”], and replace src/index.ts with:

import { definePlugin } from "@fluxplugs/plugin-api";
let removePanel: (() => void) | undefined;
export default definePlugin({
manifest: { id: "standalone-demo" },
async start(api) {
removePanel = await api.ui.registerPanel({
id: "hello",
title: "Hello from my plugin",
body: "My first FluxPlugs plugin is running.",
});
},
stop() {
removePanel?.();
removePanel = undefined;
},
});

Change the manifest name and description to identify your plugin. Before distributing it, choose your own stable ID and change both fluxplug.json and the identity in definePlugin together.

From the FluxPlugs project root, build the tooling and package your copied directory:

Terminal window
pnpm --filter @fluxplugs/plugin-tools... build
node packages/plugin-tools/cli.mjs pack /absolute/path/to/your-plugin

On Windows, pass a quoted absolute path such as “C:/Projects/my-plugin”. The pack command builds the entry, computes its hash, and writes a ZIP under your plugin’s releases directory.

In Fluxer, choose Settings → FluxPlugs → Plugins → Import local plugin, select the ZIP, and enable it after review. The panel should appear. Disable the plugin and verify that it disappears.

Learn lifecycle and cleanup before adding asynchronous features. Use packaging for standalone tooling and distribution.