docs: clarify plugin entry export contract

This commit is contained in:
Peter Steinberger
2026-04-04 07:40:08 +01:00
parent d5cb8cebcd
commit 27aa659498

View File

@@ -245,7 +245,9 @@ See [`openclaw plugins` CLI reference](/cli/plugins) for full details.
## Plugin API overview
Plugins export either a function or an object with `register(api)`:
Native plugins export an entry object that exposes `register(api)`. Older
plugins may still use `activate(api)` as a legacy alias, but new plugins should
use `register`.
```typescript
export default definePluginEntry({
@@ -265,6 +267,11 @@ export default definePluginEntry({
});
```
OpenClaw loads the entry object and calls `register(api)` during plugin
activation. The loader still falls back to `activate(api)` for older plugins,
but bundled plugins and new external plugins should treat `register` as the
public contract.
Common registration methods:
| Method | What it registers |