opscms-openwa-plugin
v1.3.1
Published
Connect a WhatsApp number through the OpenWA bridge: pair by QR code or phone number, and manage the session and its webhooks, for an OpsCMS platform. Needs a platform that builds its admin with the package (the pairing panel is an admin component), so it
Maintainers
Readme
opscms-openwa-plugin
Connect a WhatsApp number through the OpenWA bridge. A channel plugin for the OpsCMS platform, built with opscms-sdk.
- The WhatsApp channel: the platform's notification service asks it to send; it sends plain text through the OpenWA gateway. A site's official Meta number, when it has one, is tried first.
- Session endpoints (
/api/openwa/...): create a session, pair it by QR code or phone number, start it and log it out, and manage its webhooks. On the platform's shared gateway a site can only reach the sessions its own settings record, and a gateway address a site types in must be a public host. - Its own settings table,
openwa-settings: the gateway address, the session and the key, for a site, an organization (used when a site has none) or the whole platform (used when neither has). Admins only; a site's admin never writes the platform-wide row. The key is encrypted and shown masked. - The pairing panel: an admin component on the settings form, with its style shipped inside it.
- WhatsApp among the owner alerts: where a site's owner is told about new orders and leads.
Install
This plugin has an admin screen of its own (the pairing panel), and an admin component is compiled into the platform's admin when the platform is built. So it is added to the platform's build, not installed from the admin:
- Depend on the published, pinned version in the platform's
package.json. - In the platform's
payload.config.ts, importopenwaPluginand add it topluginsafter the platform's automation (which owns the notification settings). - Run the platform's migrations: the plugin's one migration creates its table. Removing the plugin and running its
downdrops the table and the keys in it.
The platform currently carries this plugin in its own code under the same key; remove that copy when you add the package. The platform's seed for the OpenWA session-status webhook belongs to the platform's automation and stays there.
Needs
payload ^3, @payloadcms/ui ^3, react ^19 and opscms-sdk ^0.1.6.
Develop
npm install
npm run typecheck && npm test && npm run build && npm pack --dry-runopscms-sdk is linked from a sibling checkout (file:../opscms-sdk) until it is published.
