@platform-x/hep-push-notification-client
v1.0.9
Published
@platform-x/hep-push-notification-client
Downloads
549
Maintainers
Keywords
Readme
@platform-x/hep-push-notification-client
Provide module to push notifications to the users.
Installation
npm install @platform-x/hep-push-notification-clientQuick Start
import {
initPushNotificationWithExternalMongo,
initPushNotificationSecrets,
pushNotificationManager
} from '@platform-x/hep-push-notification-client';
import mongoose from 'mongoose';
// Initialize with your existing mongoose connection
initPushNotificationWithExternalMongo(mongoose);
// Initialize secrets
initPushNotificationSecrets(yourSecretService);
// Use the notification manager
const manager = new pushNotificationManager();
const client = await manager.pushNotificationProvider('sitename');
await client.fetchTopics(type);MongoDB Integration
Important: This package requires MongoDB connection initialization to avoid duplicate connections when used in services that already have MongoDB setup.
📖 See MONGODB_INTEGRATION.md for detailed MongoDB integration guide
Usage
import the modules and implement:
const fcmClient: any = new pushNotificationProvider(sitename);
await fcmClient.fetchTopics(type);