kharradp-notification-sdk
v1.0.0
Published
HTTP client SDK for product notification microservices (Emploin, Votermood). Configure baseUrl per product gateway. Not the Nest service itself.
Maintainers
Readme
@kharradp/notification-sdk
Common client for Emploin / Votermood notification microservices.
Each product deploys its own notification service behind its own gateway and passes a different baseUrl.
npm install @kharradp/notification-sdkimport { createNotificationClient } from '@kharradp/notification-sdk';
const notifications = createNotificationClient({
baseUrl: process.env.NOTIFICATION_BASE_URL!, // Emploin or Votermood gateway host
apiKey: process.env.NOTIFICATION_API_KEY,
product: 'emploin', // or 'votermood'
});
await notifications.emit({
title: 'Hello',
message: 'World',
type: 'CUSTOM',
roles: ['Entity'],
userIds: ['user-1'],
});Nest:
import { NotificationSdkModule } from '@kharradp/notification-sdk/nest';
NotificationSdkModule.forRoot({
baseUrl: process.env.NOTIFICATION_BASE_URL!,
apiKey: process.env.NOTIFICATION_API_KEY,
product: 'votermood',
});This package does not include Mongo or the Nest notification microservice.
