pmagaz / webpush-notification-server

NodeJs WebPush Notification Server with subscription storing
20 stars 15 forks source link

Send to multiple users or subscribe to topics? #1

Closed pwFoo closed 4 years ago

pwFoo commented 4 years ago

Is it possible to send notification to multiple users or subscribe different topics?

pmagaz commented 4 years ago

Hi,

Actually server will send notification to every user subscribed. Users subscriptions are stored in NeDB embebed database. You can easyly create differente topics passing the topic to /register endpoint and saving the topic as additional field. Then, when you want to send notifications for an especific topic, you have to query for subscriptions matching that topic. Take a look to (db/index.js)