Plugins overview
What plugin hosts are, the two ways Remedia uses them, and how to set one up.
A plugin host exposes application-defined operations. Use one to resolve playable media at playback time or return JSON data such as catalog results. The server operator registers each host and chooses the callable operations.
Applications using a remote Remedia node need only its configured host ID. Direct callers of @remedia/plugin-host own their local host and invoke it without RPC.
Two ways to use a plugin host
| Playing audio through a plugin | Executing a plugin operation | |
|---|---|---|
| What it does | The server asks the host for audio and plays it | Your application asks the host a question and gets JSON back |
| Typical use | A source whose audio URL must be resolved right before playback | Catalog, metadata, or lyrics lookups defined by your application |
| You call | voice.play({ hostId, pluginId, operation, input }) | client.plugins.execute({ ... }) |
| Result | Audio decoded and sent to Discord | Whatever JSON the operation returns |
| Guide | Playing audio through plugins | Executing plugin operations |
Both use the same host, the same server-side allowlist, and the same security rules.
Set one up
-
Build the host with
@remedia/plugin-host: Creating a plugin host. -
Register it on the Remedia server and choose which operations are allowed:
remedia-server plugins install https://plugins.example.com --token-env REMEDIA_PLUGIN_TOKENSee Server CLI. Restart the server afterwards.
-
Use it from your application with
@remedia/client.
Registering a host records where it is and what Remedia may run. It never installs or executes plugin code on the Remedia server.
Where to read next
- Permissions and security: what is allowed, who decides, and what is protected.
@remedia/plugin-hostreference: HTTP protocol, cancellation, and limits.- Server configuration: every
pluginHostsfield.