@feathers-nuxt/feathers-notifme
v1.0.1-beta.1
Published
Feathers notification service
Downloads
5
Maintainers
Readme
feathers-notifme
Feathers notification service using
notifme-sdk
Installation
npm install @feathers-nuxt/feathers-notifme --save
API
const notifme = require('feathers-notifme');
app.use('/notifications', notifme(options))
options
is an object with two optional keys
- useNotificationCatcher: optional boolean.
false
by default. - channels: optional object. One of
email
,sms
,push
,webpush
orslack
Each channel configuration is an object with two keys: - multiProviderStrategy: optional string; one offallback
,roundrobin
,no-fallback
- providers: required array of objects each with a required keytype
See here for more details.
Example
The below example is in livescript.
notifme = require 'feathers-notifme'
# declare notifme-sdk options
options =
useNotificationCatcher: false
channels:
email:
providers:
* type: 'logger'
* type: 'smtp',
port: 465,
secure: true,
host: (app.get 'SMTP_HOST'),
auth: user: (app.get 'SMTP_USER'), pass: (app.get 'SMTP_PASSWORD')
...
# register the service with the options
app.use '/notifications', notifme options
# use the service to send email notification
alert =
email:
subject: 'Test Email Notification'
from: app.get 'SMTP_USER'
to: [email protected]
html: 'Hello world!'
(app.service 'notifications').create alert
License
Copyright (c) 2018
Licensed under the MIT license.