Plugin
Base class for a gateway plugin, binding this.core to the gateway Core.
A plugin that runs on either transport extends the base from @seedcord/core/plugin, whose this.core is typed to the shared members only.
abstract class Plugin<
Opts extends GatewayPluginOptions = { transport: "gateway"; runtime: "server" }
> extends Plugin<Opts, Core>Member visibility
Filter class members by access level.
constructor
Constructs a new instance of the Plugin class
Plugin(host: CoreBase, spec?: PluginLifecycleSpec)Inherited from:Plugin
Showing members with Protected visibility and higher.
Opts
The transport and runtime the plugin declares.
Opts extends GatewayPluginOptions = { transport: 'gateway'; runtime: 'server'; }- optional
dispose()
Runs during teardown, in ShutdownPhase.Disconnect by default. It never runs when init() has thrown.
init()
Runs in StartupPhase.Configuration by default. Move it to a different phase with the PluginLifecycleSpec.
onHmr()
Override to reload plugin state on an HMR update.
async onHmr(_event: HmrUpdateEvent): Promise<void>Inherited from:Plugin
- optional
ready()
Runs in the Ready phase, after every attached plugin's init() has resolved. The other Ready tasks run alongside it, including the http server binding its port.
Override it when your work needs a logged-in client or a resolved application id.
registerCriticalFiles()
Registers critical file patterns that should trigger a full restart when changed in Dev HMR.
rejectOptions()
Throws a SeedcordError that contains the plugin class name and the reason.