Skip to content

Function: instance()

instance<F>(ctx, factory): InstanceType<ReturnType<F>["plugin"]> | undefined

Look up a sibling plugin instance from the AppKit plugin context, keyed off the factory’s registered name and typed via its plugin class.

Returns undefined when the context is missing or the plugin is not registered. For required siblings prefer require.

F extends PluginDataFactory

PluginContextLike | undefined

F

InstanceType<ReturnType<F>["plugin"]> | undefined

import { lakebase } from "@databricks/appkit";
import { plugin } from "@dbx-tools/appkit";
const lake = plugin.instance(this.context, lakebase);
// ^^ inferred as LakebasePlugin | undefined
lake?.exports().pool;