How to build a custom adapter/plugin for OpenACP? #117
-
|
I want to build a custom adapter for OpenACP to support WhatsApp (or another platform). What interface do I need to implement and how does the plugin system work? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
OpenACP has a plugin system for creating custom adapters (e.g. WhatsApp, Matrix, Line, etc.). What is a plugin: An npm package that exports an interface AdapterFactory {
name: string;
createAdapter(core: OpenACPCore, config: ChannelConfig): ChannelAdapter;
}The plugin must export How to create a plugin:
How to install a plugin: openacp install <package-name> # Install plugin
openacp uninstall <package-name> # Remove plugin
openacp plugins # List installed pluginsPlugins are installed to {
"channels": {
"whatsapp": {
"enabled": true,
"adapter": "openacp-whatsapp-adapter"
}
}
}Related: Plugin System · Building Adapters · Adapter Reference |
Beta Was this translation helpful? Give feedback.
OpenACP has a plugin system for creating custom adapters (e.g. WhatsApp, Matrix, Line, etc.).
What is a plugin: An npm package that exports an
AdapterFactoryinterface:The plugin must export
adapterFactoryor adefaultexport conforming to this interface.How to create a plugin:
ChannelAdapterabstract class (handles sendMessage, sendPermissionRequest, sendNotification, session thread creation)AdapterFactorywith acreateAdapter()methodHow to install a plugin: