Plugins
Built-in
3 built-in plugins are available out of the box:
http
- send the notification data to a specified url (POST by default)file
- write the notification data into a file (json
. Each notification on a new line)echo
- just logs the notification data into thePubliqate
logs
Community
There is a dedicated repo where community plugins will be hosted. We'll be keep adding plugins there but everyone is free to contribute:
- SMTP - send emails. Using template engines for the email body. Supported template engines are EJS, Handlebars (default), Pug and Mustache
- S3 - store the notification data to a S3 bucket
- HTML - generate HTML files using EJS, Handlebars (default), Pug or Mustache templating engines
Custom plugins
Publiqate
can load custom build plugins. The plugins should export a single JS function (implementation
) and meta
object. Publiqate
will pass the data to the function and use the meta
object to identify the plugin. The plugins can utilize whatever packages are needed and to be build to a ESM package (ideally into a single file).
The very basic plugin:
1 2 3 4 5 6 7 8 9 |
|
3 arguments will be passed to the implementation function:
callback
- the part of the config callback that is associated with that notificationnotification
- the actual notification datalogger
- logger instance. Write anything to the log file with it (instance of Winston logger)
notification
argument have the following structure:
1 2 3 4 5 6 |
|
notification.data
have the same structure for all notifications:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
|
notification.entities
property structure depends on what entity has triggered the notification. List of all entities and their structure can be seen on Qlik's Repository API reference page