Function: require()
require<
F>(ctx,factory,caller?):InstanceType<ReturnType<F>["plugin"]>
Like instance but throws when the plugin is not registered. Use for
siblings whose absence is a wiring bug rather than a runtime condition (e.g.
requiring lakebase when the caller has storage / memory enabled).
caller is prepended to the error message so cross-plugin failures are easy
to attribute in logs.
Type Parameters
Section titled “Type Parameters”F extends PluginDataFactory
Parameters
Section titled “Parameters”PluginContextLike | undefined
factory
Section titled “factory”F
caller?
Section titled “caller?”string | NameLike
Returns
Section titled “Returns”InstanceType<ReturnType<F>["plugin"]>
Example
Section titled “Example”import { lakebase } from "@databricks/appkit";import { plugin } from "@dbx-tools/appkit";
const pool = plugin.require(this.context, lakebase, "mastra").exports().pool;