Plugin Lifecycle Methods

Plugin Lifecycle Methods

OnVendureBootstrap

A plugin which implements this interface can define logic to run when the Vendure server is initialized.

For example, this could be used to call out to an external API or to set up EventBus listeners.

Signature

interface OnVendureBootstrap {
  onVendureBootstrap(): void | Promise<void>;
}

Members

onVendureBootstrap

method
type:
() => void | Promise<void>

OnVendureWorkerBootstrap

A plugin which implements this interface can define logic to run when the Vendure worker is initialized.

For example, this could be used to start or connect to a server or databased used by the worker.

Signature

interface OnVendureWorkerBootstrap {
  onVendureWorkerBootstrap(): void | Promise<void>;
}

Members

onVendureWorkerBootstrap

method
type:
() => void | Promise<void>

OnVendureClose

A plugin which implements this interface can define logic to run before Vendure server is closed.

For example, this could be used to clean up any processes started by the OnVendureBootstrap method.

Signature

interface OnVendureClose {
  onVendureClose(): void | Promise<void>;
}

Members

onVendureClose

method
type:
() => void | Promise<void>

OnVendureWorkerClose

A plugin which implements this interface can define logic to run before Vendure worker is closed.

For example, this could be used to close any open connections to external services.

Signature

interface OnVendureWorkerClose {
  onVendureWorkerClose(): void | Promise<void>;
}

Members

onVendureWorkerClose

method
type:
() => void | Promise<void>