Plugin
In NocoBase, Client Plugin is the main way to extend and customize frontend functionality. You can inherit from the Plugin base class provided by @nocobase/client-v2 in your plugin's src/client-v2/plugin.tsx file, then register routes, models, and other resources in lifecycle methods like load().
Most of the time, you only need to focus on load() -- typically, core logic is registered during the load() phase.
Before developing a client plugin, make sure you have read the Writing Your First Plugin section and generated the basic plugin directory structure and files.
Basic Structure
Lifecycle
Each time the browser refreshes or the application initializes, plugins execute afterAdd() -> beforeLoad() -> load() in sequence:
Typically, developing a client plugin only requires writing load().
What to Do in load()
load() is the core entry point for registering plugin functionality. Common operations:
Register page routes:
For detailed usage, see Router.
Register FlowModels:
registerModelLoaders uses lazy loading (dynamic imports), loading the corresponding module only when the model is first used. This is the recommended registration method. For detailed usage, see FlowEngine.
Common Plugin Properties
Within the plugin class, the following properties can be accessed directly via this:
If you need to access more NocoBase capabilities (such as api, t (i18n), logger), you can get them through this.context:
For more context capabilities, see Context.
Related Links
- Router -- Register page routes and plugin settings pages
- Component -- How to write React components mounted by routes
- Context -- Use NocoBase built-in capabilities through context
- FlowEngine -- Register blocks, fields, actions, and other visually configurable components
- Writing Your First Plugin -- Create a plugin from scratch

