1.0.1 • Published 24 days ago

@optimiser/notification v1.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
24 days ago

@optimiser/notification

TODO: description

Usage

const notification = require('@optimiser/notification');

// TODO: DEMONSTRATE API

@optimiser/notification

Common notification package for microoptimiser and its services. sends the notification from the application.

Installation

npm install @optimiser/notification

Usage

First, require the sendPushNotification function from the library:

const { sendPushNotification } = require('@optimiser/notification');

Sending an notification

const config = {
    FCM_SERVICE_KEY: 'firebasesetup.json',
    PROJECT_DOMAIN: 'your-project-domain',
    PUSH_NOTIFICATION_PRIVATE_KEY: 'your notification private key',
    PUSH_NOTIFICATION_PUBLIC_KEY: 'your notification public key'

};
const db = 'your-mongodb-instance';
const userId = 'client user Id',
const data = {
    PushNotificationObj:{
        title: 'your title name',
        message: 'your message',
        ....
    }
}


const sendPushNotificationResponse = await sendPushNotification(userId, db, data, config);
console.log(sendPushNotificationResponse);

Running Tests

npm test

Author

Optimiser

License

ISC

1.0.1

24 days ago