irecharge-notification-sdk
v1.0.4
Published
Unified notification SDK for iRecharge — email, SMS, WhatsApp, push, and webhook delivery with dynamic DB-driven provider switching
Maintainers
Readme
Notification SDK
Unified notification SDK for iRecharge — email, SMS, WhatsApp, push, and webhook delivery with dynamic DB-driven provider switching.
Features
- Multi-channel Support: Email (AWS SES), SMS (Infobip, Broadbased), WhatsApp, Push Notifications (FCM), and Webhooks
- Dynamic Provider Management: Database-driven provider configuration and switching
- Unified Interface: Consistent API across all notification channels
- TypeScript Support: Fully typed for better development experience
- Provider Flexibility: Easy to add new providers
Installation
npm install @irecharge/notification-sdkQuick Start
import { NotificationChannelService } from '@irecharge/notification-sdk';
// Initialize the service
const notificationService = new NotificationChannelService();
// Send email
await notificationService.sendEmail({
to: '[email protected]',
subject: 'Welcome',
body: 'Welcome to iRecharge'
});
// Send SMS
await notificationService.sendSms({
to: '+1234567890',
body: 'Your OTP is 123456'
});
// Send WhatsApp
await notificationService.sendWhatsApp({
to: '+1234567890',
body: 'Hello from iRecharge'
});
// Send Push Notification
await notificationService.sendPush({
deviceToken: 'fcm_token_here',
title: 'Notification Title',
body: 'Notification body'
});
// Send Webhook
await notificationService.sendWebhook({
url: 'https://example.com/webhook',
data: { /* your data */ }
});Supported Providers
- AWS SES
SMS
- Infobip
- Broadbased
Push Notifications
- Firebase Cloud Messaging (FCM)
- WhatsApp Business API
Webhooks
- HTTP/HTTPS endpoints
Development
# Install dependencies
npm install
# Build
npm run build
# Watch mode
npm run build:watchPublishing
Releases are automatically published to npm via GitHub Actions when you push tags in the format v*.*.* (e.g., v1.0.0).
Manual Publishing
# Ensure you have npm credentials configured
npm login
# Publish
npm publishLicense
MIT
Support
For issues and feature requests, please contact the iRecharge team.
