0.0.8 • Published 5 years ago

siskhzoom-md-devices v0.0.8

Weekly downloads
1
License
ISC
Repository
-
Last release
5 years ago

Microserive Auth

Add private dependency from gitlab via ssh

npm install git+ssh://git@gitlab.com:zoom-sis/md-devices.git --save

Install

npm i siskhzoom-md-devices --save

In your code

const { sendNotificationTo, init } = require('md-devices');
// you have to init
init({
  app: {
    jwtVerifyNameSpace: '',
    publicKeyPath: '',
    privateKeyPath: '',
    masterAuthUrl: '',
    masterClientToken: ''
  },
  adminFirebase: {
    databaseURL: 'firebase database url',
    projectId: 'firebase project id',
    clientEmail: 'firebase client email',
    privateKey: '-----BEGIN PRIVATE KEY-----\n<KEY>\n-----END PRIVATE KEY-----'
  },
  redis: {
    host: '127.0.0.1',
    port: 6379,
    databaseIndex: 1,
    password: ''
  }
});

// Send notification to devices by auth ids
await sendNotificationTo(
  [], // authIds
  {
    title: 'Zoom chat',
    body: 'You have new notification'
  },
  {}, //payloadData follow firebase payload,
  { } //options follow firebase options
);

Set Up

Using yarn

yarn install

Using npm

npm install