mongoose-ratbirddeprecated

mongoose plugin for ratbird notification preferences

Usage no npm install needed!

<script type="module">
  import mongooseRatbird from 'https://cdn.skypack.dev/mongoose-ratbird';
</script>

README

Mongoose Ratbird Preferences

Extend your Mongoose schemas with Ratbird notifier preferences.

Usage

Install with Node Package Manager:

npm install mongoose-ratbird

Invoke in you Mongoose schema:

var User = new mongoose.Schema({
  // ...
});

User.plugin(require('mongoose-ratbird'));

Now your mongoose Documents will have notification preferences that can be fed to the dispatch() method of an instance of ratbird.Notifier.

var notifier = ratbird.createNotifier(config);
// ...
notifier.dispatch({
  title: 'Some Notification',
  content: 'Something <em>really</em> important just happened!'
}, user._notifications);