Plugins

Plugin authoring

Build and serve an external Astrofox display or effect plugin.

An external plugin is a small directory containing an astrofox.plugin.json manifest plus a fragment shader or JavaScript module. Astrofox supports three combinations:

TypeRuntimePurpose
DisplayShaderGenerative 2D fragment-shader layer
EffectShaderPost-processing pass over the current scene
DisplayWorkerSandboxed JavaScript canvas or Three.js layer

Effect plugins support the shader runtime only. A worker effect is rejected.

Start with an example#

The Astrofox repository includes complete examples under examples/plugins:

ExampleShows
bass-glowShader effect with property uniforms
plasmaShader display with FFT data
pulse-bars2D canvas drawing in a sandboxed worker
audio-orbThree.js through the host-provided library and renderer
cubesThree.js instancing with host-driven camera controls

Copy the closest example, change its namespaced ID, label, and implementation, then run it locally.

Minimal shader display#

Create this structure:

Astrofox automatically adds position, rotation, scale, opacity, and reactor support to external displays. Displays without a camera also get the stage transform overlay. Camera-enabled worker displays use camera control instead.

Develop locally#

1
Install the Astrofox source dependencies

Clone the Astrofox repository and run pnpm install once.

2
Start the plugin server

Run pnpm dev:plugins from the Astrofox repository. It serves every example plugin with CORS enabled on an available local port and prints the manifest URLs.

3
Install the local manifest

In Astrofox, select Manage plugins in the action rail and install the printed http://localhost:…/astrofox.plugin.json URL.

4
Iterate

Edit the plugin files, then use Reload in Manage Plugins. Localhost plugins are marked as development installs.

Publish#

Host the manifest and all referenced files on the same HTTPS-accessible origin. Relative file references resolve from the manifest URL. The server must allow Astrofox to fetch the files with CORS.

Increase the manifest version when you publish changes. Installed releases are cached and integrity-pinned, so users choose when to update.

Keep plugin URLs stable and version the manifest semantically. Projects retain the plugin source URL and version, which makes missing dependencies understandable later.

Continue with Plugin runtimes or use the manifest reference.